LATEXMLPOST(1)

๐Ÿ“ฆ
version 0.8.8 ยท 4 versions
, in fedora 43, fedora 44

๐ŸŽ€ LATEXMLPOST ๐ŸŽ€

okay so bestie, welcome to latexmlpost โ€” yes, that's LATEXMLPOST(1) if you're reading the manpage header, but we're on a first-name basis here ๐Ÿ’–


โœจ 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.

like, latexml does its thing and hands you an xml file, and then this little icon picks it up and makes it web-ready. math โ†’ images? graphics inclusions โ†’ handled? she does all of it. ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

latexmlpost [options] xmlfile

and the options are giving so much, let's get into it:

  • --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)
and one more lil thing: if xmlfile is -, latexmlpost reads the XML from standard input. so pipe it in, queen ๐Ÿซถ

๐Ÿ’– OPTIONS AND ARGUMENTS ๐Ÿ’–

๐ŸŒˆ General Options ๐ŸŒˆ

  • --verbose โ€” Requests informative output as processing proceeds. Can be repeated to increase the amount of information. so like, once is "oh cute, it's working", and more times is "okay now I want the full tea" ๐Ÿ‘‘
  • --VERSION โ€” Shows the version number of the LaTeXML package.. (yes, two dots, that's canon)
  • --help โ€” Shows this help message. the classic "help me pls" button ๐Ÿฅบ

๐Ÿฆ‹ 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. basically: if she can't figure out where your source lives, tell her or your graphics will be ghosting you ๐Ÿ˜ญ
  • --validate, --novalidate โ€” Enables (or disables) the validation of the source XML document (the default). so validation is on by default, and --novalidate is your "I live dangerously" pass ๐Ÿ’€

โœจ 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.

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.

ngl, the default xml is giving "I left it in the drafts folder". you probably don't want that one, bestie.
  • --destination=destination โ€” Specifies the destination file and directory. The directory is needed for mathimages, mathsvg and graphics processing. ๐Ÿ“
  • --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. numbered sections stay winning by default ๐Ÿ”ข
  • --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.

the way there's a whole theme situation in here?? theme-blue is so cute ๐Ÿ’™

  • --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 tab icon moment ๐ŸŽ€
  • --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. iykyk โœจ

๐Ÿ‘‘ 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. (and yes, "the the" โ€” we keep it exactly as written, fr fr)
  • --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. so like, pick your granularity, bestie โ€” how small are we chopping this salad ๐Ÿ”ช
  • *--splitpath=xpath* ** โ€” hands you the aux cord for splitting: this XPath expression picks which nodes get their very own separate pages. The default splitpath is literally
//ltx:section | //ltx:bibliography | //ltx:appendix | //ltx:index

so bestie, if you want subsections to get their own pages too, you'd say

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

and boom, the doc splits at subsections as well as sections. ๐Ÿ’…

  • *--splitnaming=(id|idrelative|label|labelrelative)* ** โ€” the naming glow-up for files created by splitting. id and label just use the id or label of the subdocument's root node for its filename, simple as. idrelative and labelrelative use only the portion of the id or label that comes after the parent document's id or label. And to keep things structured and unique, if a split document has children that are also split, that document (plus its children) gets tucked into a separate subdirectory named index. ๐ŸŽ€
  • --scan, --noscan โ€” turns scanning of documents ON (that's the default, bestie) or OFF. Scanning hunts for ids, labels, references, indexmarks, etc, so it can fill in refs, cites, index and all that good stuff. Lowkey useful to disable when you're generating documents that aren't based on the LaTeXML doctype. โœจ
  • --crossref, --nocrossref โ€” enables (default) or disables filling in references, hrefs, etc, based on a previous scan (either from --scan or from --dbfile). Again, it may be useful to disable when you're generating documents not based on the LaTeXML doctype. ๐ŸŒธ
  • *--urlstyle=(server|negotiated|file)* ** โ€” decides how URLs inside your documents get formatted, depending on how you're planning to serve them. The default, server, eliminates those unnecessary trailing index.html bits. With negotiated, the trailing file extension (typically html or xhtml) gets eliminated. And the file scheme preserves complete (but relative) urls so the whole site can be browsed as files, no server required. ๐Ÿฆ‹
  • *--navigationtoc=(context|none)* ** โ€” generates a table of contents up in the navigation bar; default is none. The context style of TOC is a lil verbose ngl and reveals more detail near the current page, so it's most suitable for navigation bars placed on the left or right. 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 indexmarks embedded within the document. Pro tip: enabling this has no effect unless there's an index element in the document (the one generated by \printindex). ๐Ÿ™ˆ
  • --splitindex, --nosplitindex โ€” enables or disables (default) splitting generated indexes into separate pages per initial letter. ๐Ÿ“
  • --bibliography=pathname ** โ€” specifies a bibliography generated from a BibTeX file to be used to fill in a bibliography element. Hand-written bibliographies living in a thebibliography environment do **not need this. Heads up: the option has no effect unless there's a bibliography element in the document (generated by \bibliography).
Not me being the messenger but: this option provides the bibliography to be 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) splitting generated bibliographies into separate pages per initial letter. โœจ
  • --prescan โ€” by default latexmlpost processes a single document into one (or more; go peek at --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 cross-referencing data (ids, titles, urls, and so on) in dbfile. A later pass then has complete information, letting all documents reference each other, and it also constructs an index and bibliography that reflects the entire document set. The same effect (though less efficient) can be achieved by running latexmlpost twice, provided a dbfile is specified. ๐Ÿ”ฅ
  • --dbfile=file โ€” specifies a filename to use for the crossreferencing data when using 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 to make it more portable. ๐ŸŒˆ

๐Ÿงฎ Math Options ๐Ÿงฎ

These options specify how math should be converted into other formats. Multiple formats can be requested; how they'll be combined depends on the format and other options. It's giving โœจchoose your own adventureโœจ.

  • --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 are 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 that it is 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 โ€” same idea, 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). ๐Ÿซถ
  • --contentmathml, --nocontentmathml โ€” requests or disables conversion of math to Content MathML. Conversion is disabled by default. Note that this conversion is only partially implemented. ๐Ÿ’€
  • --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, the intermediate math representation gets removed. This option preserves it; it will be used as secondary parallel markup, when it follows the options for 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 will be converted to a more appropriate file target format; for example, postscript files used for graphics with LaTeX will be converted to png format for use on the web. As with LaTeX, when a graphics file is specified without a file type, the system will search for the most appropriate target type file.

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

The default settings 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 are 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, you ate that fr fr ๐Ÿ’– this came from the perl v5.40.0 era, dated 2025-01-16, so go forth and latexmlpost your little heart out. mwah ๐Ÿซถโœจ

๐Ÿ“ฆ where this page comes from