1
$\begingroup$

Is there a setting to display the required arguments of a function when typing as Visual Studio, Matlab, etc. does?

$\endgroup$
12
  • 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$
    – andre314
    Commented 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$
    – kale
    Commented 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$
    – Matthew
    Commented 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 1

1
$\begingroup$

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:

arguments

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:

options

If you're having trouble making function templates work with user defined function, you should read this.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.