# Appendix K CSS Classes

When the target format is in the HTML family (XHTML, HTML or HTML5), LaTeXML adds various classes to the generated html elements. This provides a trail back to the originating markup, and leverage to apply CSS styling to the results. Recall that the class attribute is a space-separated list of class names. This appendix describes the class names used.

The basic strategy is the following:

ltx_element

with element being the LaTeXML element name that generated the html element. These elements reflect the original TeX/LaTeX markup, but are not identical. See Appendix I for details.

ltx_font_font

where font can indicate any of the font characteristics:

family

: serif, sansserif, typewriter, caligraphic, fraktur, script;

series

: bold, medium;

shape

: upright, italic, slanted, smallcaps;

These sets are open-ended.

ltx_align_alignment

where alignment indicates the alignment of the contents within the element.

horizontally

: left, right, center, justify;

vertically

: top, bottom, baseline, middle.

ltx_border_edges

indicates single or double borders on an element with edges being: t, r, b, l, tt, rr, bb, ll; these are typically used for table cells.

ltx_role_role

reflects the distinct uses a particular LaTeXML elements serve which is indicated by the role attribute. Examples include creator, for ‘document creators’, where the role may be author, editor, translator or others. Thus, depending on your purposes and the expected markup, you might choose to write CSS rules for ltx_creator or ltx_role_author. Similarly, quote is stretched to accomodate translation or verse.

ltx_title_section

marks the titles of various sectional units. For example, a chapter’s title will have two classes: ltx_title and ltx_title_chapter.

ltx_theorem_type

marks various types of ‘theorem-like’ objects, where the type is whatever was used in \newtheorem.

ltx_float_type

marks various types of floating objects, such as might be defined using the float package using \newfloat.

ltx_lst_role

reflects the various roles of items within listings, such as those created using the listings package (whose containing element would have class ltx_lstlisting). Such classes include: ltx_lst_language_lang, ltx_lst_keywordclass, ltx_lxt_line, ltx_lst_linenum.

ltx_bib_item

indicates various items in bibliographys, typically generated via BibTeX; the items include key, number, type, author, editor, year, title, author-year, edition, series, part, journal, volume, number, status, pages, language, publisher, place, status, crossref, external, cited and others.

ltx_toclist_type, ltx_tocentry_type

reflects the levels of Table of Contents lists: they carry the ltx_toclist class, from the element used to represent them, and also ltx_toclist_section naming the sectional unit for which this list applies to assist in styling. A nested TOC for a chapter might thus have ul’s carrying ltx_toclist_chapter and ltx_toclist_section. Additionally, ltx_toc_compact and ltx_toc_verycompact can be added to style compact and very compact styles (eg single line). Note that the generated li items will have class ltx_tocentry and ltx_tocentry_type, for the type of the entry.

ltx_ref_item

hypertext links, whether within or across documents, whether created from \ref or \href, will get ltx_ref and, sometimes, extra classes applied. For example, a reference that ends up pointing to the current page is marked with ltx_ref_self. Cross-referencing material used to fill-in the contents of the reference is marked: a reference number gets ltx_ref_tag; a title ltx_ref_title.

ltx_note_part

reflects the separate parts of notes; Note that the kind of note is generally reflected in the role attribute, such as footnote, endnote, etc. The parts are separated to facilitate formatting, hover effects, etc: outer contains the whole; mark for the mark, if any; content the actual contents of the note. type is for an extra span indicating the type of note if it is unusual.

ltx_page_item

reflects page layout components created during the XSLT; items include: main, content, header, footer, navbar logo, columns, column1, column2.

ltx_eqn_item

reflects different parts related to equation formatting: pad reflects padding to align equations on the page; eqnarray and lefteqn arise from LaTeX’s eqnarray environment; gather and align arise from AMS environments; intertext arises from text injected between aligned equations.

Any other explicit use of the addClass(class) function or of the \lxAddClass{class} macro from the latexml package will add the given class as is, without any additional ltx_ prefix.

Two oddball items that may get refactored away are: ltx_phantom and ltx_centering. The latter seems slightly distinct from ltx_align_center.