Skip to main content

Section 4.25 Document Information

A <docinfo> element, first below the root <pretext> element, is a small database about your document. Everything in it shares one character: it is a fact required to interpret or build your source. Remove an item and the document no longer means the same thing, or no longer builds. Choices about how the same content is presented belong instead in a publication file (Chapter 45); the dividing line is discussed for authors in Section 5.6 and rigorously in Section 49.2.

Identity and Catalog.

A <document-id> is a stable identifier for the project—make it distinctive, and never change it—with an optional @edition; services that track a project across builds (such as Runestone) rely on it. A <blurb> is a short markup-free description, roughly what you would expect on the back cover of a book, with an optional @shelf that tells Runestone how to categorize the work. An <initialism> is a useful short form of the title, such as FCLA.

The Vocabulary of the Document.

A <rename> element substitutes your name for a PreTeXt element’s, such as calling every <activity> a “Laboratory”; an @xml:lang attribute makes the substitution per-language. A <cross-references> element sets the document-wide style of cross-reference text via its @text attribute (Section 4.5)—this is <docinfo> material precisely because that text lands inside sentences you wrote around it.

What the Mathematics Needs.

Your <macros> are shared by every conversion (Subsection 4.9.13). A <math-package> element names a package and its MathJax extension so mathematics may rely on both (see Section 4.9).

What the Images Need, and Where Files Live.

A <latex-image-preamble> and an <asymptote-preamble> supply setup for images described by source code, and a pf:prefigure-preamble does the same for PreFigure (Section 4.14). A <directories> element declares the directories that run with your source: @external names the directory of files you curate (images and other assets—a different directory is a different document), and @data the directory of data files that images and programs consume. The destination for generated files remains a publication file entry (Section 5.7).

Defaults for Authored Attributes.

A document-wide default for an attribute you write on individual elements lives with the source, gathered in a single <defaults> element. Each child is the plural of the element it serves: an <images> child may carry default @width and @margins for every <image> lacking its own; a <programs> child defaults the attributes of <program> elements, notably @language; a <parsons> child defaults the language of Parsons problems.

Compatibility and Identity Marks.

A <doenetml> element records, in its @version attribute, which version of the DoenetML viewer the document’s DoenetML content was authored against. A <logo> element places an image at absolute coordinates of a printed page—the letterhead of a letter or memorandum—via @source, @llx, @lly, an optional @width, and @pages electing the first page (default) or every page.

No Longer Here.

Several items once configured in <docinfo> have found better homes, and old placements are honored with a warning during a transition. The masthead brand logo and requests for image archive links are publication file entries (Subsection 45.5.3, Subsection 45.5.8). An <event>—the occasion of a presentation—is bibliographic content and resides in the <bibinfo> (Section 4.26). Analytics, search, favicon, base URL, and worksheet-margin configuration all moved to the publication file in years past.
A <docinfo> exercising most of this could read:
<docinfo>
    <document-id edition="2">fauna-guide</document-id>
    <blurb shelf="Mathematics">A field guide to the fauna of PreTeXt.</blurb>
    <initialism>FG</initialism>
    <rename element="activity">Laboratory</rename>
    <cross-references text="type-global"/>
    <macros>\newcommand{\adjoint}[1]{#1^\ast}</macros>
    <math-package latex-name="cancel" mathjax-name="cancel"/>
    <latex-image-preamble>\usepackage{pgfplots}</latex-image-preamble>
    <directories data="data"/>
    <defaults>
        <images width="60%"/>
        <programs language="python"/>
        <parsons language="natural"/>
    </defaults>
    <doenetml version="0.7"/>
</docinfo>