<?latex?>, <?db2latex?> — Insert Arbitrary text into the LaTeX file


<?latex content ?>


These Processing Instructions are unusual in that they have no attribute. Instead, the content is put directly into the generated LaTeX document.

The <?db2latex?> PI is deprecated and should not be used anymore. It was provided for backward compatibility. Use the <?latex?> PI instead.

This can provide the ultimate in customization, but can be very dangerous since it breaks the abstractions provided by dblatex.


These Processing Instructions can be used to inject arbitrary LaTeX into the output stream. Please check if a safer customization method can be used instead. See the other customization methods.

While it is pretty clear that insertion of certain sorts of LaTeX text, at some points within the document, will always be expected to work, there is no guarantee that any inserted LaTeX will continue to work in the future with newer versions of dblatex or its underlying software stack.

Inserting LaTeX into CDATA, i.e. in places where document text appears, is likely to be more robust than inserting LaTeX elsewhere. But again, no guarantees are made.

Care must be taken with whitespace. Leading and trailing spaces matter within the processing instruction. The content consists of everything following the first space and before the closing ?>. Further care must be taken with any whitespace which follows the processing instruction -- the TeX tokenization scan may consume whitespace which follows the processing instruction. One possible solution when this happens is to end your content with the \ character.

The <?latex?> Processing Instruction takes special steps to work in verbatim blocks, screen, programlisting, and literallayout elements, while <?db2latex?> is directly written as is.

Safe LaTeX Insertions

Although the latex processing instruction can be dangerous there are a few latex content values that are safe to use within CDATA words, within the words of the actual text of your document. The following content values provide LaTeX with information it can use to improve your document's formatting:


Soft hyphen. A backslash followed by a dash indicates a soft hyphen. LaTeX may or may not break the line and hyphenate at this point. Useful when over-long variable names and similar fail to hyphenate and thereby cause lines to exceed their normal lengths.

Once a soft hyphen is inserted into a word the insertion point becomes the only place at which hyphenation is permitted in that occurrence of the word.


Do not kern (join together) characters. An empty pair of curly braces placed between two characters indicates that the characters should not be joined together. Depending on the font and the characters, some pairs of characters may be joined together. E.g. a pair of lower-case f characters may be have a their crossbars joined. This may not be desirable, as when each of the characters is a component of a separate word within a larger compound word. Placing this PI between the characters which are to remain separated prevents the two characters from kerning.


Really, do not kern (join together) characters. A stronger version of {}.


A backslash followed by the at sign, when placed after a capital letter and before a period, indicates that the period is the end of a sentence. Periods following capital letters do not otherwise end sentences and sentences may be used by LaTeX when determining layout.


Recognized in all elements.