#### 37.2.3 Storing a macro definition in a separate file

You might want to use individual files for very large macros; or a separate file for a macro that you want to include in different configurations, much like a text inset.

A macro file is a text file that contains a nameless macro, with content that comprises the definition of the macro. A macro file can have any name and any extension; however, it makes sense to give the file a base name that is the name you would have given the same macro if included in a macro library file.

To invoke a macro in a macro file, specify a path to the macro file inside a $< ... > wrapper. The path must include at least one path separator (forward slash or backslash); this is what distinguishes a file macro invocation from a local or library macro invocation. A relative path is relative to the project directory. For example:

[ParaStyleCodeReplace]
ParaFmt = <$./mymacro.ini>

would cause DITA2Go to replace each instance of ParaFmt in the output with the content of mymacro.txt, located in the project directory.

A macro in a macro file can invoke other macros, including predefined macros, macros in other macro files, macros in library files, and macros in configuration files. Macros in macro files do not participate in the rules of precedence for chained macro libraries.

See also:

§37.2.4 Including macro definitions in your own macro library

Previous Topic: 37.2.2 Modifying DITA2Go-supplied macro definitions

Next Topic: 37.2.4 Including macro definitions in your own macro library

Parent Topic: 37.2 Accessing DITA2Go macro libraries

Sibling Topics:

37.2.1 Understanding DITA2Go-supplied macro libraries

37.2.2 Modifying DITA2Go-supplied macro definitions

37.2.4 Including macro definitions in your own macro library

Table of Contents • Index