InDesign has several preset variables which insert contextual values in a document. You can also create a new text variable and update those, including preset variables, as per your needs.
Just as the text variable name suggests, the values of variable items are changeable best in context where and when the variables are used. You may need to copy and paste chapter numbers, chapter names, or headings of a book while designing a book. Changing any values of those items may require you to manually change those values everywhere in a book. However, text variables simplify your task of copying items and pasting them into documents. In a more precise way, text variables automatically copy the contextual value for your workflow. For example, the Last Page Number text variable will be important to display the page numbering format like ‘Page 2 of 5’, where 5 is given by Last Page Number in a document. The value of Last Page Number keeps on updating whenever you add or delete the pages in a document.
Similarly, Chapter Number and Running Header text variables are useful to place on parent pages. The values of these text variables also change as per the context where and how they are used. Chapter Number will display different numbers for different documents, and Running Header display either of the formatting styles (paragraph or character style) used in document pages. I recommend you to read a very nice article I found about text variables here.
Types of Preset Text Variables
The following picture shows the default text variables in InDesign version 18.1. These variables can directly be used in a document. They also serve as the basis for creating new text variables of that type. In addition, you can edit a text variable in a way you desire, but the available options differ based on the types of text variables.
Listing the Preset Text Variables
What are the usages of those text variables? Let’s simply explain each of them.
- Chapter Number – It inserts chapter number in a document. You can create new text variable of Chapter Number type. You can also format the numbering style, and add any text before or after to default or new text variable.
- Date Variables: Creation, Modification, and Output – These date variables hold dates or times the specific actions have happened. Creation Date variable inserts date or time the document is saved for the first time, while Modification Date inserts date or time the document is saved for the latest time. Likewise, the Output Date inserts date or time the document starts outputting – printing, exporting, or packaging. You can add any text before or after and customize date format of date variables.
- File Name – It prints the name of current file in a document. It is especially useful to place the name of file in slug area, header, or footer of a document. Note that File Name text variable automatically updates its value when you rename a file. Just like other text variables, you can add any text before or after the File Name. Additionally, you can customize options for Include Entire Folder Path and Include File Extension.
- Image Name – It is useful for generating image captions automatically from the metadata. It contains Metadata Caption variable, which automatically updates when you move text frame containing caption variable close to the image in a document. You can choose a wide range of metadata in metadata field of Metadata Caption text variable type.
- Last Page Number – It is useful for displaying total number of pages in a section or a document. You can add text before or after, customize the display of numbers, and add scope of last page number as section or document.
- Running Header – There are two types of running headers. They are paragraph style and character style.
What is Running Header in InDesign?
The running header is useful for displaying current heading or title on header or footer section of a document. For example, you defined character style to format headings in your book and applied that style in your document page. Now, you can pick that heading text, whether used first or last on page, automatically by using running header to reappear on document pages. When you have multiple occurrences of the same heading style on a page, first style on the beginning of a page is given by First on Page and last style by Last on Page options in Running Header text variable type. If heading style is absent on a page, running header picks the style from previous page. You can also add before or after text and choose the heading cases from options available in Running Header. While creating Running Header type text variable, you need to have character or paragraph styles defined beforehand.
How to Create Text Variables in InDesign?
You can create and edit text variables in InDesign documents. The options available for creating or editing a text variable depend on the type of that text variable. Note that you should not place too much text on text variables, if you do, it may cause text to be overset or compressed. This happens because text variables do not break across lines. You can create or define several text variables of the same type. Follow these steps to create text variables in InDesign:
- First of all, close all opened documents so that the new text variable is available on all new documents.
- Navigate to Type > Text Variables > Define.
- To create a new variable, select the listed variable on left side of Text Variables panel and click on New.
- Give variable name and choose the appropriate options available in New Text Variable panel.
- To edit the existing variable, select the variable from the list and click Edit.
- Change the variable as per the options available in Edit Text Variable panel.
If you want to use the existing text variable in a document, go to Type > Text Variables > Insert Variable and select a variable name to insert. You can read more about how to delete text variables on official documents.