Linked Questions

2 votes
2 answers
156 views

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
176 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 ...
1110101001's user avatar
  • 1,989
603 votes
19 answers
157k 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
4 answers
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? ...
Hp Radojewski Schäfer Von's user avatar
35 votes
1 answer
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 ...
Rojo's user avatar
  • 42.7k
21 votes
2 answers
983 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 ...
Michael Underwood's user avatar
14 votes
3 answers
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 ...
celtschk's user avatar
  • 19.2k
3 votes
2 answers
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?
David's user avatar
  • 14.9k
14 votes
1 answer
526 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 ...
Szabolcs's user avatar
  • 236k
4 votes
1 answer
130 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?...
QuantumDot's user avatar
  • 19.7k