LATEXMLPOST(1p)

๐Ÿฆ‹ LATEXMLPOST(1p) โ€” User Contributed Perl Documentation ๐Ÿ’–

okay bestie, pull up a chair, because this is the glow-up page for latexmlpost. (yes, the manual name is literally "latexmlpost", quotes and all, she's quirky like that ๐Ÿ’…)


โœจ NAME โœจ

"latexmlpost" โ€” postprocesses an xml file generated by "latexml" to perform common tasks, such as convert math to images and processing graphics inclusions for the web. ๐ŸŽ€


๐ŸŒธ SYNOPSIS ๐ŸŒธ

latexmlpost [options] xmlfile

Options (yes, the whole squad, no cuts, no skips ๐Ÿ’–):

  • --verbose โ€” shows progress during processing.
  • --VERSION โ€” show version number.
  • --help โ€” shows help message.
  • --sourcedirectory=sourcedir โ€” sets directory of the original source TeX file.
  • --validate, --novalidate โ€” Enables (the default) or disables validation of the source xml.
  • --format=html|html5|html4|xhtml|xml โ€” requests the output format. (html defaults to html5)
  • --destination=file โ€” sets output file (and directory).
  • --omitdoctype โ€” omits the Doctype declaration,
  • --noomitdoctype โ€” disables the omission (the default)
  • --numbersections โ€” enables (the default) the inclusion of section numbers in titles, crossrefs.
  • --nonumbersections โ€” disables the above
  • --stylesheet=xslfile โ€” requests the XSL transform using the given xslfile as stylesheet.
  • --css=cssfile โ€” adds css stylesheet to (x)html(5) (can be repeated)
  • --nodefaultresources โ€” disables processing built-in resources
  • --javascript=jsfile โ€” adds a link to a javascript file into html4/html5/xhtml (can be repeated)
  • --xsltparameter=name:value โ€” passes parameters to the XSLT.
  • --split โ€” requests splitting each document
  • --nosplit โ€” disables the above (default)
  • --splitat โ€” sets level to split the document
  • --splitpath=xpath โ€” sets xpath expression to use for splitting (default splits at sections, if splitting is enabled)
  • --splitnaming=(id|idrelative|label|labelrelative) โ€” specifies how to name split files (idrelative).
  • --scan โ€” scans documents to extract ids, labels, etc. section titles, etc. (default)
  • --noscan โ€” disables the above
  • --crossref โ€” fills in crossreferences (default)
  • --nocrossref โ€” disables the above
  • --urlstyle=(server|negotiated|file) โ€” format to use for urls (default server).
  • --navigationtoc=(context|none) โ€” generates a table of contents in navigation bar
  • --index โ€” requests creating an index (default)
  • --noindex โ€” disables the above
  • --splitindex โ€” Splits index into pages per initial.
  • --nosplitindex โ€” disables the above (default)
  • --permutedindex โ€” permutes index phrases in the index
  • --nopermutedindex โ€” disables the above (default)
  • --bibliography=file โ€” sets a bibliography file
  • --splitbibliography โ€” splits the bibliography into pages per initial.
  • --nosplitbibliography โ€” disables the above (default)
  • --prescan โ€” carries out only the split (if enabled) and scan, storing cross-referencing data in dbfile (default is complete processing)
  • --dbfile=dbfile โ€” sets file to store crossreferences
  • --sitedirectory=dir โ€” sets the base directory of the site
  • --mathimages โ€” converts math to images (default for html4 format)
  • --nomathimages โ€” disables the above
  • --mathsvg โ€” converts math to svg images
  • --nomathsvg โ€” disables the above
  • --mathimagemagnification=mag โ€” sets magnification factor
  • --presentationmathml โ€” converts math to Presentation MathML (default for xhtml & html5 formats)
  • --pmml โ€” alias for --presentationmathml
  • --nopresentationmathml โ€” disables the above
  • --linelength=n โ€” formats presentation mathml to a linelength max of n characters
  • --contentmathml โ€” converts math to Content MathML
  • --nocontentmathml โ€” disables the above (default)
  • --cmml โ€” alias for --contentmathml
  • --openmath โ€” converts math to OpenMath
  • --noopenmath โ€” disables the above (default)
  • --om โ€” alias for --openmath
  • --keepXMath โ€” preserves the intermediate XMath representation (default is to remove)
  • --mathtex โ€” adds TeX annotation to parallel markup
  • --nomathtex โ€” disables the above (default)
  • --unicodemath โ€” adds TeX annotation to parallel markup
  • --nounicodemath โ€” disables the above (default)
  • --plane1 โ€” use plane-1 unicode for symbols (default, if needed)
  • --noplane1 โ€” do not use plane-1 unicode
  • --graphicimages โ€” converts graphics to images (default)
  • --nographicimages โ€” disables the above
  • --graphicsmap=type.type โ€” specifies a graphics file mapping
  • --pictureimages โ€” converts picture environments to images (default)
  • --nopictureimages โ€” disables the above
  • --svg โ€” converts picture environments to SVG
  • --nosvg โ€” disables the above (default)

okay and the little plot twist ๐Ÿซถ: if xmlfile is -, latexmlpost reads the XML from standard input. like, literally just pipes it in. iconic.


๐Ÿ’… OPTIONS AND ARGUMENTS ๐Ÿ’…

๐Ÿงš General Options ๐Ÿงš

  • --verbose โ€” Requests informative output as processing proceeds. Can be repeated to increase the amount of information. (so like, spam it as many times as you want for maximum yapping ๐Ÿ“ข)
  • --VERSION โ€” Shows the version number of the LaTeXML package.. (two periods, she's dramatic, we respect it ๐Ÿ’€)
  • --help โ€” Shows this help message.

๐ŸŽ€ Source Options ๐ŸŽ€

  • --sourcedirectory=source โ€” Specifies the directory where the original latex source is located. Unless latexmlpost is run from that directory, or it can be determined from the xml filename, it may be necessary to specify this option in order to find graphics and style files. (ngl if she can't find the source, the graphics and style files just ghost you ๐Ÿ™ˆ)
  • --validate, --novalidate โ€” Enables (or disables) the validation of the source XML document (the default).

๐ŸŒˆ Format Options ๐ŸŒˆ

  • --format="(html|html5|html4|xhtml|xml)" โ€” Specifies the output format for post processing. By default, it will be guessed from the file extension of the destination (if given), with html implying "html5", xhtml implying "xhtml" and the default being "xml", which you probably don't want.

So here's the tea on the formats โ˜•:

  • The "html5" format converts the material to html5 form with mathematics as MathML; "html5" supports SVG.
  • "html4" format converts the material to the earlier html form, version 4, and the mathematics to png images.
  • "xhtml" format converts to xhtml and uses presentation MathML (after attempting to parse the mathematics) for representing the math.
  • "html5" similarly converts math to presentation MathML. In these cases, any graphics will be converted to web-friendly formats and/or copied to the destination directory.
  • If you simply specify "html", it will treat that as "html5".

For the default, "xml", the output is left in LaTeXML's internal xml, although the math can be converted by enabling one of the math postprocessors, such as --pmml to obtain presentation MathML. For html, html5 and xhtml, a default stylesheet is provided, but see the "--stylesheet" option. โœจ

  • --destination=destination โ€” Specifies the destination file and directory. The directory is needed for mathimages, mathsvg and graphics processing. (she needs a whole place to put her little guys ๐Ÿซถ)
  • --omitdoctype, --noomitdoctype โ€” Omits (or includes) the document type declaration. The default is to include it if the document model was based on a DTD.
  • --numbersections, --nonumbersections โ€” Includes (default), or disables the inclusion of section, equation, etc, numbers in the formatted document and crossreference links. ๐Ÿ”ข
  • --stylesheet=xslfile โ€” Requests the XSL transformation of the document using the given xslfile as stylesheet. If the stylesheet is omitted, a standard one appropriate for the format (html4, html5 or xhtml) will be used.
  • --css=cssfile โ€” Adds cssfile as a css stylesheet to be used in the transformed html/html5/xhtml. Multiple stylesheets can be used; they are included in the html in the order given, following the default "ltx-LaTeXML.css". The stylesheet is copied to the destination directory, unless it is an absolute url.

Some stylesheets included in the distribution are:

  • --css=navbar-left โ€” Puts a navigation bar on the left. (default omits navbar)
  • --css=navbar-right โ€” Puts a navigation bar on the left.
  • --css=theme-blue โ€” A blue coloring theme for headings.
  • --css=amsart โ€” A style suitable for journal articles.
(yes navbar-right really does say "left" in the source, bestie. we did not touch it. she said what she said ๐Ÿ’€)
  • --javascript=jsfile โ€” Includes a link to the javascript file jsfile, to be used in the transformed html/html5/xhtml. Multiple javascript files can be included; they are linked in the html in the order given. The javascript file is copied to the destination directory, unless it is an absolute url.
  • --icon=iconfile โ€” Copies iconfile to the destination directory and sets up the linkage in the transformed html/html5/xhtml to use that as the "favicon". ๐ŸŽ€ (tiny little tab icon, so cute)
  • --nodefaultresources โ€” Disables the copying and inclusion of resources added by the binding files; This includes CSS, javascript or other files. This does not affect resources explicitly requested by the "--css" or "--javascript" options.
  • --timestamp=timestamp โ€” Provides a timestamp (typically a time and date) to be embedded in the comments by the stock XSLT stylesheets. If you don't supply a timestamp, the current time and date will be used. (You can use "--timestamp=0" to omit the timestamp).
  • --xsltparameter=name:value โ€” Passes parameters to the XSLT stylesheet. See the manual or the stylesheet itself for available parameters.

๐Ÿ‘‘ Site & Crossreferencing Options ๐Ÿ‘‘

  • --split, --nosplit โ€” Enables or disables (default) the splitting of documents into multiple pages. If enabled, the the document will be split into sections, bibliography, index and appendices (if any) by default, unless "--splitpath" is specified. (yes, "the the", she's excited, let her live ๐Ÿ˜ญ)
  • --splitat=unit โ€” Specifies what level of the document to split at. Should be one of "chapter", "section" (the default), "subsection" or "subsubsection". For more control, see "--splitpath".

part 1 of 2, bestie โ€” hold on, there's more coming ๐Ÿ’œ

  • --splitpath=xpath โ€” bestie, this is how you tell it which nodes get their own separate page. The default splitpath is:
//ltx:section | //ltx:bibliography | //ltx:appendix | //ltx:index

And if you wanted to split at subsections too, you'd hand it something like:

--splitpath="//ltx:section | //ltx:subsection
       | //ltx:bibliography | //ltx:appendix | //ltx:index"

now the doc gets chopped at subsections as well as sections. ๐Ÿ’…

  • --splitnaming=(id|idrelative|label|labelrelative) โ€” the โœจnamingโœจ aesthetic for the files of all those subdocuments created by splitting. id and label are the simple ones: they just take the id or label of the subdocument's root node and use it as the filename. idrelative and labelrelative are the glow-up versions: they use only the chunk of the id or label that comes after the parent document's id or label. And because we love structure + uniqueness, if a split document has children that are also split, that document (and its children) get tucked into their own separate subdirectory named index. ๐ŸŽ€
  • --scan, --noscan โ€” turns the scanning of documents for ids, labels, references, indexmarks, etc. on (that's the default) or off. What's the scan even for? Filling in refs, cites, index and all that good stuff. Ngl it may be useful to disable this one when you're generating documents that aren't based on the LaTeXML doctype. ๐ŸŒธ
  • --crossref, --nocrossref โ€” turns the filling-in of references, hrefs, etc. on (default) or off, based on a previous scan (either from --scan, or from --dbfile). Again: it may be useful to disable when generating documents not based on the LaTeXML doctype. ๐Ÿฆ‹
  • --urlstyle=(server|negotiated|file) โ€” this one decides how URLs inside your documents get formatted, depending on how you're planning to serve them. The default, server, drops those unnecessary trailing index.html bits. With negotiated, the trailing file extension (usually html or xhtml) gets eliminated. And the scheme file preserves complete (but relative) urls so you can browse the whole site straight as files, no server needed. ๐Ÿ’–
  • --navigationtoc=(context|none) โ€” generates a table of contents in the navigation bar; default is none. The context style of TOC is kind of verbose and reveals more detail near the current page, so it's most suitable for navigation bars placed on the left or right. And, direct quote energy: other styles of TOC should be developed and added here, such as a short form. ๐Ÿ‘‘
  • --index, --noindex โ€” enables (default) or disables generating an index from the indexmarks embedded in the document. Heads up though: enabling this does literally nothing unless there's an index element in the document (the one generated by \printindex). ๐Ÿซถ
  • --splitindex, --nosplitindex โ€” enables, or disables (default), the splitting of generated indexes into separate pages per initial letter. ๐Ÿ”ค
  • --bibliography=pathname โ€” hands over a bibliography generated from a BibTeX file, to be used to fill in a bibliography element. Hand-written bibliographies sitting in a "thebibliography" environment don't need this at all. And this option has no effect unless there's a bibliography element in the document (the one generated by \bibliography).

โš ๏ธ Also note: this option provides the bibliography that gets used to fill in the bibliography element (generated by "\bibliography"); latexmlpost does not (currently) directly process and format such a bibliography.

  • --splitbibliography, --nosplitbibliography โ€” enables or disables (default) the splitting of generated bibliographies into separate pages per initial letter. ๐Ÿ“š
  • --prescan โ€” okay so by default latexmlpost processes a single document into one (or more โ€” see --split) destination files in a single pass. But when you're generating a complicated site made of several documents, it may be advantageous to first scan through the documents to extract and store (in dbfile) cross-referencing data โ€” ids, titles, urls, and so on. Then a later pass has complete info, letting all the documents reference each other, plus it constructs an index and bibliography that reflects the entire document set. The same effect (though less efficient, fr) can be achieved by running latexmlpost twice, as long as you specify a dbfile. โœจ
  • --dbfile=file โ€” specifies a filename to use for the crossreferencing data when you're doing two-pass processing. This file may reside in the intermediate destination directory. ๐Ÿ—‚๏ธ
  • --sitedirectory=dir โ€” specifies the base directory of the overall web site. Pathnames in the database are stored relative to this directory, which makes it way more portable. ๐ŸŒˆ

๐Ÿงฎ Math Options ๐Ÿงฎ

These options specify how math should be converted into other formats. Multiple formats can be requested โ€” how they'll get combined depends on the format and the other options. ๐Ÿ”ฅ

  • --mathimages, --nomathimages โ€” requests or disables the conversion of math to images (png by default). Conversion is the default for html4 format. ๐Ÿ–ผ๏ธ
  • --mathsvg, --nomathsvg โ€” requests or disables the conversion of math to svg images. โœจ
  • --mathimagemagnification=factor โ€” specifies the magnification used for math images (both png and svg), if they're made. Default is 1.75. ๐Ÿ”
  • --presentationmathml, --nopresentationmathml โ€” requests or disables conversion of math to Presentation MathML. Conversion is the default for xhtml and html5 formats. ๐Ÿ’…
  • --linelength=number โ€” (Experimental) line-breaks the generated Presentation MathML so it's no longer than number characters. ๐Ÿ“
  • --plane1 โ€” converts the content of Presentation MathML token elements to the appropriate Unicode Plane-1 codepoints according to the selected font, when applicable (this is the default). ๐Ÿ›ธ
  • --hackplane1 โ€” converts the content of Presentation MathML token elements to the appropriate Unicode Plane-1 codepoints according to the selected font, but only for the mathvariants double-struck, fraktur and script. This gives support for current (as of August 2009) versions of Firefox and MathPlayer, provided a sufficient set of fonts is available (eg. STIX). no cap, that date is really in there ๐Ÿ˜ญ
  • --contentmathml, --nocontentmathml โ€” requests or disables conversion of math to Content MathML. Conversion is disabled by default. Note that this conversion is only partially implemented โ€” so, lowkey, don't expect the full thing. ๐Ÿ™ˆ
  • --openmath โ€” requests or disables conversion of math to OpenMath. Conversion is disabled by default. Note that this conversion is only partially implemented. ๐Ÿ’€
  • --keepXMath โ€” by default, when any of the MathML or OpenMath conversions are used, that intermediate math representation gets removed. This option preserves it, and it'll be used as secondary parallel markup when it follows the options for the other math representations. ๐Ÿซถ

๐ŸŽจ Graphics Options ๐ŸŽจ

  • --graphicimages, --nographicimages โ€” enables (default) or disables the conversion of graphics to web-appropriate format (png). ๐Ÿ–ผ๏ธ
  • --graphicsmap=sourcetype.desttype โ€” specifies a mapping of graphics file types. Typically, graphics elements specify a graphics file that'll be converted to a more appropriate file target format; for example, postscript files used for graphics with LaTeX get converted to png format for use on the web. Same as with LaTeX: when a graphics file is specified without a file type, the system searches for the most appropriate target type file. ๐Ÿ”

When this option is used, it overrides and replaces the defaults, giving you a mapping of sourcetype to desttype. The option can be repeated to provide several mappings, with the earlier formats preferred. And if the desttype is omitted, it specifies copying files of type sourcetype, unchanged.

The default setting is equivalent to having supplied the options:

--graphicsmap=svg
--graphicsmap=png
--graphicsmap=gif
--graphicsmap=jpg
--graphicsmap=jpeg
--graphicsmap=eps.png
--graphicsmap=ps.png
--graphicsmap=ai.png
--graphicsmap=pdf.png

The first formats are preferred and used unchanged, while the latter ones get converted to png. ๐Ÿ’…

  • --pictureimages, --nopictureimages โ€” enables (default) or disables the conversion of picture environments and pstricks material into images. ๐Ÿ–ผ๏ธ
  • --svg, --nosvg โ€” enables or disables (default) the conversion of picture environments and pstricks material to SVG. โœจ

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

latexml, latexmlmath, LaTeXML


okay bestie that's the whole page, we ate and left no crumbs ๐Ÿ“ this one's from perl v5.40.1 and it's dated 2025-11-16 โ€” LATEXMLPOST(1p), iconic behavior, go forth and convert ๐Ÿ’–๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from