LATEXMLMATH(1)
π NAME π
okay so bestie, welcome to the LATEXMLMATH(1) manual page!! π this one's about latexmlmath β it transforms a TeX/LaTeX math expression into various formats. that's it, that's the whole vibe. β¨
πΈ SYNOPSIS πΈ
latexmlmath [options] texmath
Options:
--mathimage=file converts to image in file
--mathsvg=file converts to svg image in file
--magnification=mag specifies magnification factor
--presentationmathml=file converts to Presentation MathML
--pmml=file alias for --presentationmathml
--linelength=n do linewrapping of pMML
--contentmathml=file convert to Content MathML
--cmml=file alias for --contentmathml
--openmath=file convert to OpenMath
--om=file alias for --openmath
--unicodemath=file convert to UnicodeMath
--XMath=file output LaTeXML's internal format
--noparse disables parsing of math
(not useful for cMML or openmath)
--preload=file loads a style file.
--includestyles allows processing raw *.sty files
(normally it avoids this)
--path=dir adds a search path for style files.
--quiet reduces verbosity (can repeat)
--verbose increases verbosity (can repeat)
--strict be more strict about errors.
--documentid=id assign an id to the document root.
--debug=package enables debugging output for the
named package
--inputencoding=enc specify the input encoding.
--VERSION show version number and exit.
--help shows this help message.
-- ends options
If texmath is -, latexmlmath reads the TeX from standard input. And if any of the output files are -, the result is printed on standard output. π
π₯ Input notes
ngl this part is important so listen up π«Ά β unless you're reading texmath from standard input, the texmath string will be processed by whatever shell you are using before latexmlmath even sees it. that means a whole bunch of so-called meta characters, like backslash and star, may confuse the shell or be changed. π so you will need to quote and/or slashify the input appropriately. most particularly, \ will need to be doubled to \\ for latexmlmath to see it as a control sequence.
Using -- to explicitly end the option list is useful for cases when the math starts with a minus (and would otherwise be interpreted as an option, probably an unrecognized one). Alternatively, wrapping the texmath with {} will hide the minus. π
Simple examples, slay:
latexmlmath \\frac{-b\\pm\\sqrt{b^2-4ac}}{2a}
echo "\\sqrt{b^2-4ac}" | latexmlmath --pmml=quad.mml -
β¨ OPTIONS AND ARGUMENTS β¨
π¦ Conversion Options
These options specify what formats the math should be converted to. In each case, the destination file is given. Except for mathimage, the file can be given as -, in which case the result is printed to standard output. π
If no conversion option is specified, the default is to output presentation MathML to standard output. periodt.
--mathimage=file β requests conversion to png images. πΈ--mathsvg=file β requests conversion to svg images. π¨--magnification=factor β specifies the magnification used for math image. Default is 1.75.--presentationmathml=file β requests conversion to Presentation MathML. β¨--pmml=file β alias for--presentationmathml. iykyk, same thing bestie π--linelength=number β (Experimental) line-breaks the generated Presentation MathML so that it is no longer than numbercharacters.--plane1β converts the content of Presentation MathML token elements to the appropriate Unicode Plane-1 codepoints according to the selected font, when applicable.--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). π₯--contentmathml=file β requests conversion to Content MathML. > heads up bestie: this conversion is only partially implemented. don't come for me π--cmml=file β alias for--contentmathml. π«Ά--openmath=file β requests conversion to OpenMath. > also only partially implemented, fr fr. π--om=file β alias for--openmath.--unicodemath=file β requests conversion to UnicodeMath (an unstructured Unicode string). π--XMath=file β requests conversion to LaTeXML's internal format. π
π Other Options
--preload=module β requests the loading of an optional module or package. This may be useful if the TeX code does not specifically require the module (eg. through input or usepackage). For example, use--preload=LaTeX.poolto force LaTeX mode.--includestylesβ this optional allows processing of style files (files with extensionssty,cls,clo,cnf). By default, these files are ignored unless a latexml implementation of them is found (with an extension ofltxml).
These style files generally fall into two classes: those that merely affect document style are ignorable in the XML. Others define new markup and document structure, often using deeper LaTeX macros to achieve their ends. Although the omission will lead to other errors (missing macro definitions), it is unlikely that processing the TeX code in the style file will lead to a correct document. π
--path=dir β add dir to the search paths used when searching for files, modules, style files, etc; somewhat likeTEXINPUTS. This option can be repeated. π--documentid=id β assigns an ID to the root element of the XML document. This ID is generally inherited as the prefix of ID's on all other elements within the document. This is useful when constructing a site of multiple documents so that all nodes have unique IDs. π--quietβ reduces the verbosity of output during processing, used twice is pretty silent. π€«--verboseβ increases the verbosity of output during processing, used twice is pretty chatty. Can be useful for getting more details when errors occur. π£οΈ--strictβ specifies a strict processing mode. By default, undefined control sequences and invalid document constructs (that violate the DTD) give warning messages, but attempt to continue processing. Using--strictmakes them generate fatal errors. β οΈ no soft launch, it just ends.--inputencoding=encoding β specify the input encoding, eg.--inputencoding=iso-8859-1. The encoding must be one known to Perl's Encode package. Note that this only enables the translation of the input bytes to UTF-8 used internally by LaTeXML, but does not affect catcodes. It is usually better to use LaTeX's inputenc package. Note that this does not affect the output encoding, which is always UTF-8.--VERSIONβ shows the version number of the LaTeXML package.. (yes bestie, two periods, i don't make the rules π )--debug=package β enables debugging output for the named package. The package is given without the leadingLaTeXML::.--helpβ shows this help message. π
π BUGS
This program runs much slower than would seem justified. This is a result of the relatively slow initialization including loading TeX and LaTeX macros and the schema. Normally, this cost would be ammortized over large documents, whereas, in this case, we're processing a single math expression.
not the ammortized typo, but we keep it, because we keep EVERYTHING. π«Ά
π SEE ALSO
latexmllatexmlpostLaTeXML
and that's the whole page bestie!! π this was perl v5.40.0, dated 2025-01-16, and you just read the LATEXMLMATH(1) manual. go convert some math, you're gonna eat. πβ¨π¦
π¦ where this page comes from
- fedora 43: LaTeXML 0.8.8-3.fc42 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: LaTeXML 0.8.8-3.fc42 Β· LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms