InDesign has several preset variables that insert contextual values into a document. You can also create new text variables and update them, including preset variables, as needed.
Just as the text variable name suggests, the values of the variable items are changeable best in a 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 change those values everywhere in a book manually. 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 essential to display the page numbering format like ‘Page 2 of 5’, where Last Page Number gives 5 in a document. Last Page Number’s value keeps updating whenever you add or delete the pages in a document.
Similarly, Chapter Number and Running Header text variables are helpful when placed on parent pages. The values of these text variables also change according to the context where and how they are used. Chapter Number will display different numbers for different documents, and Running Header will display either of the formatting styles (paragraph or character style) used in document pages. I recommend you read a lovely 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. 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 a new text variable of Chapter Number type. You can also format the numbering style and add any text before or after to the 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 the date format of the date variables.
- File Name – It prints the current file’s name in a document. It is especially useful to place the file’s name in the slug area, the header, or the document’s footer. Note that the File Name text variable automatically updates its value when you rename a file. Like other text variables, you can add any text before or after the File Name. Additionally, you can customize options to include the entire folder path and File extension.
- Image Name – It is helpful for automatically generating image captions 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 the metadata field of the Metadata Caption text variable type.
- Last Page Number – This is useful for displaying the total number of pages in a section or a document. You can add text before or after the number, customize the display of numbers, and add the scope of the last page number as a 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 the current heading or title on a document’s header or footer section. For example, you defined a character style to format headings in your book and applied that style to the document page. Now, you can automatically pick that heading text, whether used first or last on page, by using running header to reappear on document pages. When you have multiple occurrences of the same heading style on a page, the first style on the beginning of a page is given by the First on Page and the last style by the Last on Page options in the Running Header text variable type. If the heading style is absent on a page, the running header picks the style from the previous page. You can also add before or after text and choose the heading cases from options available in Running Header. While creating a 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 the 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 the left side of the 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.