Linked Questions

2 votes
2 answers

How do I make my function behave more like Plot? [duplicate]

I have written a function Fun as below: ...
xyz's user avatar
  • 635
2 votes
1 answer

Having variables appear aqua in user defined function [duplicate]

In many of the inbuilt mathematica function, variables appear aqua like in: However, when creating your own function, variables no longer have that green coloring and are instead colored like an ...
1110101001's user avatar
  • 1,989
603 votes
19 answers

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
24 votes
4 answers

How to program a F::argx message?

How useful is it to program a user-built function in a package to produce a red warning message F::argx if you give the wrong number of arguments to that function? ...
Hp Radojewski Schäfer Von's user avatar
35 votes
1 answer

Customizing syntax highlighting for private cell styles

Is there any way to set up a cell style with a particular syntax highlighting? For example, I'd like to have a CProgram cell to write in blue the C special words. I have done it by setting ...
Rojo's user avatar
  • 42.7k
21 votes
2 answers

When should I, and when should I not, set the HoldAll attribute on a function I define?

I have seen a number of examples on this site (such as in syntax highlighting and checking evaluation status) in which functions definitions are preceded with ...
Michael Underwood's user avatar
14 votes
3 answers

Strategies to avoid LessEqual::nord in NMinimize?

When using NMinimize on functions with complex intermediate expressions (but a real end result), quite often one gets the error ...
celtschk's user avatar
  • 19.2k
3 votes
2 answers

Complex line integral

Can someone recommend an online article or introductory tutorial that will show me how to do real and complex line integrals using Mathematica?
David's user avatar
  • 14.9k
14 votes
1 answer

SyntaxInformation: take allowed options from multiple symbols – possible?

Suppose I have a function like Options[f] = {foo -> 1}; f[opt : OptionsPattern[{f,g}]] := h@g[Sequence @@ FilterRules[{opt}, Options[g]]] I purposefully do ...
Szabolcs's user avatar
  • 236k
4 votes
1 answer

Why does SyntaxInformation "ColorEqualSigns" color like wrong options?

In my copy of Mathematica 11.1, SyntaxInformation[f] = {"ColorEqualSigns" -> {1, 1}} colors like wrong options: How do I make it not color like wrong options?...
QuantumDot's user avatar
  • 19.7k