![]() |
Customizing the treatment of title information | ![]() |
TeXmacs uses the doc-data tag in order to specify global data for the document. These data are treated in two stages. First, the document data are separated into several categories, according to whether the data should be rendered as a part of the main title or in footnotes or running headers. Secondly, the data in each category are rendered using suitable macros. In recent versions of TeXmacs, the first stage is no longer implemented by macros: the doc-data macro of title-base is defined as <xmacro|args|<extern|doc-data|<quote-arg|args>|>>, and the actual reorganization of the data is done by the Scheme function doc-data in
progs/database/title-markup.scm
(which is loaded by title-base through use-module). Similarly, author-data is handled by the Scheme function author-data.
Each child of the doc-data is a tag with some specific information about the document. Currently implemented tags are doc-title, doc-subtitle, doc-author, doc-date, doc-misc, doc-note, doc-running-title, doc-running-author and doc-inactive. The doc-author tag may occur several times. The optional tag doc-title-options may be used in order to specify options for the treatment of the title data, such as abbreviate-authors, cluster-all, cluster-by-affiliation or ams-title. The author-data tag is used in order to specify structured data for each of the authors of the document. Each child of the author-data tag is a tag with information about the corresponding author. Currently implemented tags with author information are author-name, author-affiliation, author-email, author-homepage, author-misc and author-note. Keywords and subject classifications are no longer part of the title data, but specified using the abstract-data tag (with children abstract, abstract-keywords, abstract-msc, abstract-acm, abstract-arxiv and abstract-pacs).
Most of the tags listed above also correspond to macros for rendering the corresponding information as part of the main title. For instance, if the date should appear in bold italic at a distance of at least 1fn from the other title fields, then you may redefine doc-date as
<document| <assign|doc-date|<macro|body|<\concat| <vspace*|1fn> | <doc-title-block|<with|font-shape|italic|font-series|bold|body>> | <vspace|1fn> > >>> |
The doc-title-block macro is used in order to make the text span appropriately over the width of the title; for author information, the analogous macros doc-author-block and doc-authors-block are used. In order to customize only the font of the title, it suffices to redefine doc-title-name (which defaults to strong). Some styles, such as title-book and title-seminar, introduce additional hooks like doc-render-title and author-render-name.
Notice also that the doc-running-title and doc-running-author macros do not render anything, but rather call the header-title and header-author call-backs for setting the appropriate global page headers and footers. By default, the running title and author are extracted from the usual title and author names.
In addition to the rendering macros which are present in the document, the main title (including author information, the date, etc.) is rendered using the doc-make-rich-title macro, which takes the hidden data (running title and author, footnote texts) and the main title as its arguments, and which relies on doc-make-title. When the document has several authors, they are grouped together using doc-authors. Notes attached to the title or to one of the authors (doc-note and author-note) are turned into footnotes: their references are rendered using doc-note-ref and the footnotes themselves using doc-footnote-text; the author-…-note variants of the author tags (like author-email-note) are used for author information which is rendered as a note.
The first stage of processing the document data is more complex and the reader is invited to take a look at the short descriptions of the macros which are involved in this process. It is also good to study the definitions of these macros in the package itself and the Scheme code in $TEXMACS_PATH/progs/database/title-markup.scm. For instance, the function doc-data-impl can be overloaded (using tm-define with a :require clause on the title options, as is done for the ams-title option) in order to completely change the way the title data are organized.