Is there a setting to display the required arguments of a function when typing as Visual Studio, Matlab, etc. does?
-
2$\begingroup$ You may use the command completion ctrl-shift-K (at least until mathematica 8,I'm not sure it works on mathematica 9) $\endgroup$– andre314Commented May 4, 2013 at 14:24
-
$\begingroup$ @andre It works on 9.0.1, but was broken in 9.0.0. v9 also allows one to use multiple templates $\endgroup$– rm -rf ♦Commented May 4, 2013 at 14:37
-
$\begingroup$ Cmd-Shift-K if on the ole Macintosh. $\endgroup$– kaleCommented May 4, 2013 at 14:40
-
$\begingroup$ @andre That is useful, but is there a way to have the function arguments display? Say, once you type in the name of the function, a command that displays what arguments the function requires? $\endgroup$– MatthewCommented May 4, 2013 at 14:56
-
1$\begingroup$ @Matthew Well, that's because you haven't defined them :) See this answer, which is applicable to version 9. The method is the same for version 8, except that only 1 template is completed (the first one, IIRC) $\endgroup$– rm -rf ♦Commented May 4, 2013 at 16:15
1 Answer
The closest thing to what you're describing are function templates, there is a tutorial on how to use them here.
You first have to write the name of the function, for example Plot
, and then you hit cmd+shift+k on OS X and ctrl+shift+k on Windows, you'll get this:
Once you have typed the mandatory arguments, you can hit cmd+k on OS X or ctrl+k on Windows to get a list of any options you supply:
If you're having trouble making function templates work with user defined function, you should read this.