§ 4.2.2 CSS

css stylesheets can be supplied to latexmlpost to be included in the generated documents in addition to, or as a replacement for, the standard stylesheet LaTeXML.css. See the directory installationdir/LaTeXML/resources/CSS/ for samples.

To best take advantage of this capability so as to design css rules with the correct specificity, the following points are helpful:

  •  converts the  to its own schema, with structural elements (like equation) getting their own tag; others are transformed to something more generic, such as note. In the latter case, a class attribute is often used to distinguish. For example, a \footnote generates

    <note class=’footnote’>

    whereas an \endnote generates

    <note class=’endnote’>
  • The provided xslt stylesheets transform ’s schema to xhtml, generating a combined class attribute consisting of any class attributes already present as well as the  tag name. However, there are some variations on the theme. For example, ’s \section yeilds a  element section, with a title element underneath. When transformed to xhtml, the former becomes a <div class=’section’>, while the latter becomes <h2 class=’section-title’> (for example, the h-level may vary with the document structure),

Mode begin and end

For most elements, once the main html element has been opened and the primary attributes have been added but before any content has been added, a template with mode begin is called; thus it can add either attributes or content. Just before closing the main html element, a template with mode end is called.

Computing class and style

Templates with mode classes and styling.