Text variables overview

Last updated on Jun 2, 2026

Understand how text variables automatically update content like dates, file names, and page numbers throughout your documents in Adobe InDesign.

Text variables are elements you insert in a document that update automatically based on context. Instead of typing repeated or changing information manually, you insert a variable that reflects the current state or content of the document. For example, a variable can show the last page number and update when pages are added or removed.

Text variable behavior

Text variables update dynamically as the content or document changes. When you insert a variable tied to a document attribute, such as a page number, file name, or running header, InDesign refreshes the value whenever the source information changes.

Where variables are commonly used

Text variables are useful when information needs to reflect the current document structure or metadata. Common uses include:

  • Running headers and footers that reflect chapter titles or section names.
  • Page numbering and Page X of Y formats.
  • Slug areas that show metadata such as creation date or file name.
  • Templates where repeated values should stay consistent across pages or documents.

Types of text variables and their behaviors

InDesign provides the following variable types, each designed for specific content:

  • Chapter Number: This variable displays the current chapter number and supports text before or after it, along with a chosen numbering style. When a chapter continues from a previous document in a book, the book’s numbering may need to be updated to show the correct chapter number.
  • Creation Date, Modification Date, and Output Date: These variables display when a document is first saved, last saved, or processed for output such as printing, PDF export, or packaging. Each date supports text before or after it, and all date variables share the same date format settings.
  • Date Format: This setting controls how dates appear and lets you enter a format directly or choose one from a list. Date variables follow the language of the surrounding text, so the exact date can appear differently in documents that use different languages.
    For example, MM/dd/yy displays as 12/25/07, while MMM. d, yyyy displays as Dec. 22, 2025. Date variables use the same language as text. For example, the creation date may appear in Spanish text as 01 diciembre 2025 and in German as 01 Dezember 2025.
  • File Name: This variable inserts the current file name into the document. It’s commonly added to the slug area of the document for printing or used in headers and footers. In addition to Text Before and Text After, you can select the following options.
    • Include Entire Folder Path: Includes the full folder path with the file name. The standard path conventions for either Windows or macOS are used.
    • Include File Extension: Includes the file name extension. The File Name variable is updated whenever you save the file with a new name or to a new location. The path or extension does not appear in the document until it’s saved.
  • Image Name: This variable displays image metadata and is primarily used for generating automatic captions. The Image Name variable includes a Metadata Caption variable type. If a text frame containing this variable is adjacent to or grouped with an image, the variable displays the metadata of that image. You can edit the Image Name variable to determine which metadata field is used.
  • Last Page Number: This variable displays the total number of pages and is commonly used in Page X of Y formats. It updates automatically as pages are added or removed and can count pages within a section or across the entire document.
  • Running Header (Paragraph Style or Character Style): This running header variable displays the first or last occurrence of styled text on a page. When no matching text appears on a page, the value is pulled from the previous page.
  • Custom Text: This variable displays reusable text that may need to be changed later. Updating the variable updates all instances at once, which is helpful for placeholders such as project or code names.
Tip

You can add special characters to text variables for more control over content.