How to | Use Function Templates

The Wolfram Language lets you insert function templates that contain placeholders for the arguments of a function. You can do this directly from the keyboard or with several of the Wolfram System's built-in palettes. Entering the arguments of a function using a template helps to make sure that the syntax you are entering is correct. Templates also reduce the number of times you need to leave your notebook to view information about a function in the documentation.

To insert a function template using the keyboard on a PC, type the function and then type Ctrl+Shift+K. If you are using a Macintosh, type Cmd+Shift+K. These are the keyboard shortcuts for the Edit Make Template menu item.

Here, the keyboard was used to insert the template for Plot. Note that the placeholder for the first argument in Plot is automatically selected:

Use Tab to move through the placeholders, or click on a specific placeholder to select it.

Inserting function templates also works when you type a partial function name and then select your desired function from the popup menu that appears when you use the keyboard shortcut.

To insert a function template in place of what you typed, double-click the function you want (single-click in Mac OS X) or navigate the list with the arrow keys until it is highlighted and press Enter:

The templates you get for built-in functions are usually only the simplest of several possible argument forms. To see all the argument forms of a function, see its page in the Documentation Center. See How to: Find Information about Functions for detailed instructions on viewing documentation about functions.

    

Many of the Wolfram System's built-in palettes also let you insert function templates. You can access these through the Palettes menu.

Open the Basic Math Assistant palette from the Palettes menu, open the Basic Commands section of the palette, and then click the 2D tab. Click one of the functions to enter its template:

Here, the template for Plot was entered using the Basic Math Assistant palette:

In[1]:=
Click for copyable input

You can also access templates for functions in other sections of the Basic Math Assistant palette.