#### 37.3.4 Using predefined macro variables

DITA2Go provides a collection of predefined macro variables, listed in Table 37-5. Every predefined macro variable name begins with “$$_”. Predefined macro variables are read-only; you cannot assign values to them, and you cannot increment or decrement them. However, you can do the following:

- Use predefined macro variables in expressions; see §37.6.1 Understanding macro expressions).
- Format output of a predefined macro variable; see §37.6.3 Displaying expression results in output).

Note: Only <$$_basename> and <$$_currpath> can be used in system commands; other predefined macro variables do not work in system commands. See §43.1.5 Supplying system commands in a macro.

Table 37-5 Predefined macro variables

Macro variable | Where used | Description | Ref
    $$_basefile
| HTML split files | Base name only of parent file, without extension | 27.7
    $$_basename
| System commands | Base file name (without path or extension) of current DITA file | 43.1.2
    $$_basetitle
| HTML split files | Original document title, unaffected by splits | 27.7
    $$_class
| Elements (HTML) | CSS class name of current paragraph | 37.6.6
    $$_count
| Loop constructs | Current iteration count for <$_repeat> loops | 37.6.4.3
    $$_currbase
| Output files | File name of current file, without extension | 27.7
    $$_currfile
| Output files | File name of current file, with extension, | 27.7
    $$_currfilepath
| Output files | Path and name of current file, with extension | 27.7
    $$_currpath
| System commands | Path, without trailing slash, to project directory | 43.1.2
    $$_currtitle
| HTML split files | Current file title, unaffected by extracts | 27.7
    $$_dcount
| Loop constructs | Down-count for <$_repeat> loops | 37.6.4.3
    $$_element
| Elements (HTML) | Name of the current element | 37.6.6
    $$_extrfile
| HTML extract files | File name of extracted file | 27.8.3
    $$_extrgraph
| HTML extract files | File name of first extracted graphic | 27.8.3
    $$_extrtitle
| HTML extract files | Title of extracted file | 27.8.3
    $$_firstfile
| HTML split files | 1 if first split part after original file, otherwise 0 | 27.7
    $$_graphbase
| HTML graphics | File name for <img src= /> attribute, no extension | 32.4.2
    $$_graphorighigh
| HTML graphics | Original height in pixels of the image | 32.4.2
    $$_graphorigwide
| HTML graphics | Original width in pixels of the image | 32.4.2
    $$_graphsrc
| HTML graphics | File name for <img src= /> attribute, with extension | 32.4.2
    $$_indexfilename
| HTML index | File name for non-Help HTML index file, with extension | 14.7.3.5
    $$_lastfile
| HTML split files | 1 if last part (regardless of splitting), or if unsplit; otherwise 0 | 27.7
    $$_linksrc
| HTML link attributes | href content of a link | 28.2.4
    $$_macroparam
| Macros | Value of parameter passed in parentheses | 37.7
    $$_nextfile
| HTML split files | File name of split part that follows $$_currfile | 27.7
    $$_nexttitle
| HTML split files | Title of $$_nextfile split part | 27.7
    $$_paratag
| Formats | Name of current paragraph format | 37.6.6
    $$_prevfile
| HTML split files | File name of split part that precedes $$_currfile | 27.7
    $$_prevtitle
| HTML split files | Title of $$_prevfile split part | 27.7
    $$_prjpath
| System commands | Path (without trailing slash) to the directory where the map file resides | 43.1
    $$_seqcurrtitle
| HTML navigation links | Title of current file | 29.3
    $$_seqnextfile
| HTML navigation links | Name of following file, with extension .htm | 29.3
    $$_seqnexttitle
| HTML navigation links | Title of following file | 29.3
    $$_seqprevfile
| HTML navigation links | Name of preceding file, with extension .htm | 29.3
    $$_seqprevtitle
| HTML navigation links | Title of preceding file | 29.3
    $$_tblcols
| Tables | Count of columns in current table | 33.5.6
    $$_tblrows
| Tables | Count of rows in current table | 33.5.6
    $$_wcount
| Loop constructs | Iteration count for <$_while> loops | 37.6.4.3

Previous Topic: 37.3.3 Incrementing and decrementing macro variables

Next Topic: 37.3.5 Creating macro variables from paragraph content

Parent Topic: 37.3 Using macro variables

Sibling Topics:

37.3.1 Creating and invoking macro variables

37.3.2 Assigning values to macro variables

37.3.3 Incrementing and decrementing macro variables

37.3.5 Creating macro variables from paragraph content