The xml2tex configuration file schema.

The set element

The root element of the xml2tex configuration.

The import element

Import other xml2tex configuration files. Imported character maps and templates will always have a lower priority than those in the importing configuration. Imported preamble, front and back will be replaced if they exist in the importing configuration

The preamble element

Place declarations such as document class, used packages and other information TeX will need to format the document correctly

The front element

Used for TeX instructions to be placed immediately after the begin of the document (e.g. \begin{document}).

The back element

Used for TeX instructions to be placed immediately before the end of the document (e.g. \end{document}).

The ns element

Specify the XML namespaces used in the document.

The template element

Used to create a TeX instruction for a specified XML context.

The style element

This is a shorter but less powerful alternative for template. You can select elements by a specific attribute and value. The attribute name has to be declared globally with @style-attribute at xml2tex:set.

The regex element

Create TeX instructions where the specified regular expression pattern matches a part of text.

The charmap element

A collection of mapping instructions for mapping characters to specific TeX instructions.

The rule element

Specify name and type of the TeX instruction and additional formatting.

The file element

You can store the evaluated context of the template to a separate file by specifying a file reference.

The char element

Used to replace a character with a TeX instruction.

The text element

Used to add text after the TeX instruction such as \foo bar. There are three ways to control how the content is applied:

a) <text/> The context which is specified by template/@content is applied.
b) <text select="foo"/> The context which is specified by the XPath expression in the @select attribute is applied.
c) <text>foo</text> The plain text string is inserted.

The param element

Used to create a parameter for a TeX instruction such as \foo{bar}. There are three ways to control how the content is applied:

a) <param/> The context which is specified by template/@content is applied.
b) <param select="foo"/> The context which is specified by the XPath expression in the @select attribute is applied.
c) <param>foo</text> The plain text string is just inserted.

yes no

The option element

Used to create an option for a TeX instruction such as \foo[bar]. There are three ways to control how the content is applied:

a) <text/> The context which is specified by template/@content is applied.
b) <text select="foo"/> The context which is specified by the XPath expression in the @select attribute is applied.
c) <text>foo</text> The plain text string is just inserted.

For style mapping via style you can choose the attribute to be evaluated as style e.g. role in DocBook or rend in TEI. Should Unicode combining characters automatically converted to its LaTeX supplements, e.g. Ü =>\"U? yes no Specify the table-model which is used to create TeX tables. Permitted values are tabular, tabularx and htmltabs. tabular tabularx htmltabs Specify whether table grid lines should be rendered. Only effective when selected table-model is tabular or tabularx. yes no Overrides the table column declaration of the first column. Overrides the table column declaration. You can specify different declarations for first and last column with the options table-first-col-declaration and table-last-col-declaration. Overrides the table column declaration of the last column. Choose the method docx2tex detects lists. indent role none

The select attribute

Value: XPath expression

Specify an XPath expression to select a node within the selected context.

The type attribute

Value: 'text'

Specify if XPath expression in @select should be evaluated as text only.

The select attribute

Value: xs:integer

Specify the number of the regex groups to be selected.

The href attribute

Value: path

Import other xml2tex configuration files by specifying their relative or absolute path.

The prefix attribute

Value: xs:string

Specify the namespace prefix. The values of prefix and uri are used to create an XML namespace declaration in the generated stylesheet.

The uri attribute

Value: xs:string

Specify the namespace URI. The values of prefix and uri are used to create an XML namespace declaration in the generated stylesheet.

The context attribute

Value: XPath expression

The content of this attribute is an XSLT 2 matching pattern that may contain QNames with namespace prefixes. These prefixes and the namespaces must be declared first in the XML and second with the ns element.

The name attribute

Value: xs:string

Provides a name for the template. will be expanded to an XSLT 2 named template with the possibility to declare rule-Elements within..

The priority attribute

Value: xs:integer

Can be used to override the internally evaluated priority of the template order.

The name attribute

Value: xs:string

Provides a name for the TeX instruction. The name foo will expand to either \foo or \begin{foo}…\end{foo} depending on the value of the type attribute.

The type attribute

Values: cmd|env

Declares whether you want to create a command (cmd)such as \foo or an environment env such as \begin{foo}…\end{foo}

cmd env

The break-after attribute

Value: xs:integer

Specifiies the number of breaks which will be added after the TeX instruction

The break-before attribute

Value: xs:integer

Specifies the number of breaks which will be added before the TeX instruction

The mathmode attribute

Values: true|false

The content will be enclosed in '$' characters which cause TeX to switch to math mode.

The ignore-imported-charmaps attribute

Value: xs:boolean

Whether character maps from imported configurations should be ignored (true) or overridden (false). When you omit this attribute, the default is to override imported configurations, e.g. prefer character mappings from the importing configuration.

The character attribute

Value: xs:string

Character to be replaced

The string attribute

Value: xs:string

The value of the @character attribute is replaced with the value of this attribute.

The context attribute

Value: XPath expression

The content of this attribute is an XSLT 2 matching pattern that may contain QNames with namespace prefixes. These prefixes and the namespaces must be declared first in the XML and second with the ns element.

Please be aware that MathML is converted by a separate module, named mml2tex. Please look there into texmap/texmap.xml

The mode attribute

Values: text or math

Specifies the mode to which the character mapping is applied. If no mode attribute was specified, the character mapping can be applied to both modes (if applicable).

text math

The name attribute

Value: XML Attribute value

Specifies the attribute value of an XML element. The attribute name has to be declared globally with @style-attribute at xml2tex:set.

The start attribute

Value: Plain text

The value of this attribute is inserted before the selected XML element.

The end attribute

Value: Plain text

The value of this attribute is inserted after the selected XML element.

The regex attribute

Value: regular expression pattern

Specifies the regular expression pattern to match certain text strings.

You can also use regular expression groups to reference them later with the @regex-group attribute in param, option or text

The href attribute

Specifies a path on the local file system.

The encoding attribute

With this optional attribute, you can specify the file encoding. The default value is 'utf-8'

The method attribute

With this optional attribute, you can specify the serialization method. The default value is 'text', other permitted values are 'xml' and 'html'.

text xml xhtml html
It's not permitted to use inline text and both a @select expression. Please correct xml2tex:template[@context eq '']. The @regex-group attribute is not permitted, when the parent is <xml2tex:template> The @select attribute is not permitted, when the parent is <xml2tex:regex>