TeXmacs documents

Whereas TeXmacs document fragments can be general TeXmacs trees, TeXmacs documents are trees of a special form which we will describe now. The root of a TeXmacs document is necessarily a document tag. The children of this tag are necessarily of one of the following forms:

<TeXmacs|version>
(TeXmacs version)

This mandatory tag specifies the version of TeXmacs which was used to save the document.

<project|ref>
(part of a project)

An optional project to which the document belongs.

<style|version>

<style|<tuple|style|pack-1||pack-n>>
(style and packages)

An optional style and additional packages for the document.

<body|content>
(body of the document)

This mandatory tag specifies the body of your document.

<initial|table>
(initial environment)

Optional specification of the initial environment for the document, with information about the page size, margins, etc.. The table is of the form <collection|binding-1||binding-n>. Each binding-i is of the form <associate|var-i|val-i> and associates the initial value val-i to the environment variable var-i. The initial values of environment variables which do not occur in the table are determined by the style file and packages.

<references|table>
(references)

An optional list of all valid references to labels in the document. Even though this information can be automatically recovered by the typesetter, this recovery requires several passes. In order to make the behaviour of the editor more natural when loading files, references are therefore stored along with the document.

The table is of a similar form as above. In this case a tuple is associated to each label. This tuple is either of the form <tuple|content|page-nr> or <tuple|content|page-nr|file>. The content corresponds to the displayed text when referring to the label, page-nr to the corresponding page number, and the optional file to the file where the label was defined (this is only used when the file is part of a project).

<auxiliary|table>
(auxiliary data attached to the file)

This optional tag specifies all auxiliary data attached to the document. Usually, such auxiliary data can be recomputed automatically from the document, but such recomputations may be expensive and even require tools which are not necessarily installed on your system. The table, which is specified in a similar way as above, associates auxiliary content to a key. Standard keys include bib, toc, idx, gly, etc.

Example 1. An article with the simple text “hello world!” is represented as

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".