Linked Questions

2
votes
2answers
147 views

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

I have written a function Fun as below: ...
2
votes
1answer
162 views

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 ...
566
votes
19answers
143k views

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
4answers
3k views

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? ...
32
votes
1answer
2k views

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 ...
20
votes
2answers
842 views

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 ...
14
votes
3answers
2k views

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 ...
3
votes
1answer
4k views

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?
14
votes
1answer
434 views

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 ...
4
votes
1answer
106 views

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?...