##### 26.4.2.5 Providing aliases for paragraph formats

To specify an alternate name, or alias, for a paragraph format:

    [DocBookAlias]
    ; paragraph format = format name to use in place of that
    ;  paragraph format for DocBook purposes
    ParaFmtName = AlternateName

An alias works in any [DocBook*] configuration section that uses format names. The alias can be the name of another paragraph format in your document, provided the two formats map to exactly the same element with all the same DocBook settings; or, the alias can be a name you invent.

For additional aliases for the same format, insert a DocBookAlias PI marker in each instance of the format that requires a different alias, with content the name of another alias. You can also use a DocBookAlias PI marker to override an alias assigned in section [DocBookAlias].

You can use as many different aliases for the same paragraph format as your document requires.

You might need to create aliases in the following situations:

One-to-many mappings of the same format to different DocBook elements

Many-to-one mappings of two or more formats to the same DocBook element.

One-to-many mappings

Suppose your document includes a paragraph format named Body2, used in the following situations:

- most often as a continuation of a Numbered1 or Numbered paragraph
- less often as a continuation of a Bulleted paragraph
- occasionally as a quotation, not part of any list.

This means that in different places in your document Body2 would have to be mapped to different elements, or participate in different DocBook hierarchies.

To resolve this conflict, you would assign aliases to the alternate uses of Body2. You could keep the original format name for the most frequent use; however, the name Body2 does not convey anything about the differing semantics. Therefore you might want to use aliases for every use; for example, Body2OList, Body2IList, and Body2Quote.

To create an alias for the most prevalent use of Body2:

    [DocBookAlias]
    Body2 = Body2OList

For the other two uses of Body2, you would have to insert a DocBookAlias PI marker in each instance, with content one of the other aliases: Body2IList or Body2Quote. Then you could specify the following in your project configuration file:

    [DocBookTags]
    Body2?list = para
    Body2Quote = blockquote

Many-to-one mappings

Suppose your document includes three different paragraph formats for quotations:

Quote in body text

FtnQ in footnotes

CellQ in table cells.

All three map to DocBook element <blockquote>. You can make this semantic equivalence explicit in section [DocBookAlias], and use the collective alias in other configuration sections:

    [DocBookTags]
    Quote = blockquote

    [DocBookAlias]
    FtnQ = Quote
    CellQ = Quote

Previous Topic: 26.4.2.4 Overriding element mapping for paragraph formats

Next Topic: 26.4.3 Mapping character formats to DocBook elements

Parent Topic: 26.4.2 Mapping paragraph formats to DocBook elements

Sibling Topics:

26.4.2.1 Assigning DocBook elements to paragraph formats

26.4.2.2 Specifying a default element for unmapped paragraph formats

26.4.2.3 Omitting invalid tags for default DocBook block elements

26.4.2.4 Overriding element mapping for paragraph formats