LATEXMLMATH(1p) | User Contributed Perl Documentation | LATEXMLMATH(1p) |
"latexmlmath" - transforms a TeX/LaTeX math expression into various formats.
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. If any of the output files are '-', the result is printed on standard output.
Note that, unless you are reading texmath from standard input, the texmath string will be processed by whatever shell you are using before "latexmlmath" even sees it. This means that many so-called meta characters, such as backslash and star, may confuse the shell or be changed. Consequently, 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:
latexmlmath \\frac{-b\\pm\\sqrt{b^2-4ac}}{2a} echo "\\sqrt{b^2-4ac}" | latexmlmath --pmml=quad.mml -
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.
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.
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.
latexml, latexmlpost, LaTeXML
2023-02-03 | perl v5.36.0 |