#### 7.4.6 Modifying DITA2Go default output formats

To change the definition of a format supplied in the DITA2Go format templates, include a section for that format in the corresponding local_ format configuration file or your own format configuration file, and override the default values of any properties you wish to change. Your version of the format will inherit all the properties that you do not redefine. Because many of the supplied formats also inherit from other formats, you will have to follow the chain for each inherited property of interest until you find its actual value, then decide how to override that value.

For example, suppose you want to change the vertical alignment of text in header cells in tables that you have assigned format SeaTable, for RTF output. You would look in format configuration template d2rtf_tables.ini for the default definition:

[SeaTable]
based = NormalTable
border top = NoBorder
border bottom = NoBorder
header rows = SeaHeaderRow
body rows = SeaBodyRow

This definition tells you that header rows are in format SeaHeaderRow; so you look for that definition:

[SeaHeaderRow]
based = HeaderRow
body cells = SeaColHeadCell
border bottom = NoBorder
shading = SeaHeadShade

Now you see that the cells of the header row are defined in format SeaColHeadCell, so you look for that definition:

[SeaColHeadCell]
based = ColHeadCell
border bottom = NoBorder
shading = SeaHeadShade

Now you find that SeaColHeadCell does not have any alignment properties defined, but instead is based on ColHeadCell, so you look there:

[ColHeadCell]
based = BodyCell
margin top = 1pt
margin bottom = 3pt
border bottom = LightBorder
vertical align = Bottom

Finally you have found the properties that govern vertical alignment of text in header cells! You might not want to change the definition of ColHeadCell, because that definition might be inherited by table formats other than SeaTable. But you can be fairly sure that SeaColHeadCell is specific to SeaTable, just based on its name. To be absolutely sure, you would check for any inheritance of SeaColHeadCell by any other table or row format in the current template or in any table format configuration file “downstream” of that template.

Now you can redefine SeaColHeadCell as you wish, overriding only those properties you want changed: namely, vertical align (and possibly margin top and margin bottom), inherited from ColHeadCell:

[SeaColHeadCell]
vertical align = top

Any tables in your document that are assigned format SeaTable will now have header cells with text alignment toward the top of the cell instead of the bottom, within the confines of the relevant margin settings.

In this particular example, all the inherited properties are defined in the same format configuration template. However, to modify some formats you might have to look further “upstream” in other templates to find the properties you want to change. You would start looking in the format configuration file referenced by your project configuration file, and work back from there.

Previous Topic: 7.4.5 Basing format properties on other formats

Next Topic: 7.4.7 Applying CSS and RTF code to output formats

Parent Topic: 7.4 Understanding how to define output formats

Sibling Topics:

7.4.1 Naming output formats

7.4.2 Assigning values to format properties

7.4.3 Documenting output formats

7.4.4 Understanding the basis of format properties

7.4.5 Basing format properties on other formats

7.4.7 Applying CSS and RTF code to output formats

7.4.8 Assigning content-adding properties to formats

Table of Contents • Index