4.1 Init File Expansion Contexts: Normal, Preformatted, Code, String, Math

There are five expansion contexts of interest:

normal context

Paragraphs, index entries, tables, ...

preformatted context

When spaces between words are kept. For example, within the @display (see @display in Texinfo) and @example environments (see @example in Texinfo), and in menu comments. The preformatted regions are usually rendered using <pre> elements in HTML.

code context

When quotes and minus are kept. In particular ---, `` and other similar constructs are not converted to dash and quote special characters. For example, in @code or @option commands (see Useful Highlighting in Texinfo).

math context

Math (see @math in Texinfo). Code or preformatted specifications are often used for math too. In those cases, there is no way to separately specify the formatting in math context.

string context

When rendering strings without formatting elements, for example in titles. The string context allows for limited formatting, typically without any element when producing HTML or XML, so the value can be used in an attribute. XML entities can be used in strings.

It is worth mentioning that in some cases, in particular for file names, plain text can also be used in conversion. There is no associated context in the converter, so the conversion to plain text is usually performed by converting a Texinfo elements tree outside of the main conversion flow.