#### 7.2.3 Understanding how DITA2Go builds format chains

When DITA2Go opens your project configuration file, DITA2Go starts with any [Templates]Configs= setting, and builds the entire general-configuration template chain before doing anything else. All other template references follow the rules of inheritance for the general configuration chain; see §39.1.3 Understanding how templates are chained together.

Next DITA2Go looks up the template referenced by [Templates]Formats: whichever template is so referenced either in your project configuration file, or failing that, in the configuration template next closest in the general-configuration chain. From this reference DITA2Go builds a chain of text-format templates. Not table formats, not page layouts, just text formats.

Next DITA2Go looks for references to table-format, subformat, and page-layout templates. DITA2Go looks first in the general-configuration template chain, then in the text-format template chain. If a table-format, subformat, or page-layout template is referenced in your project configuration file, or in any general-configuration template of your own, that reference takes precedence over any reference in a text-format template, even if the text-format template is referenced in your own project configuration file.

Finally DITA2Go builds the chains for table-format, subformat, and page-layout templates. Each such chain consists of only one kind of template; for example, if you try to reference page layouts from a subformat template, DITA2Go never sees the reference.

Suppose you use DITA2Go to produce Word RTF. In the supplied set of templates, d2rtf_config.ini references local_d2rtf_formats.ini, but not local_d2rtf_pages.ini. Then local_d2rtf_formats.ini references d2rtf_formats.ini, and the latter references local_d2rtf_pages.ini.

This means that if you provide your own text-format configuration file, but you want to use the supplied page-format template, you have the following options:

- If you have some use for the supplied text-format template, just link to its editable counterpart from your own new text-format file; the supplied page formats will come along.
- Reference the editable page-format configuration file from your text-format file or from your project configuration file; if you reference it from both, DITA2Go uses the reference in your project configuration file.
- Provide your own page-format configuration file and link from it to the supplied editable page-format configuration file.

But if you neither reference the supplied page-format file yourself, nor reference the supplied text-format file that references the page formats, your project will not have access to the supplied page layouts.

Previous Topic: 7.2.2 Specifying paths to your own format configuration files

Next Topic: 7.2.4 Understanding how DITA2Go processes format chains

Parent Topic: 7.2 Working with format configuration files

Sibling Topics:

7.2.1 Understanding where to define output formats

7.2.2 Specifying paths to your own format configuration files

7.2.4 Understanding how DITA2Go processes format chains