| 1 |
# LuaMML: Automated LuaLaTeX math to MathML conversion |
| 2 |
This is an attempt to implement automatic conversion of LuaLaTeX inline and display math expressions into MathML code to aid with tagging. |
| 3 |
It works best with `unicode-math`, but it can also be used with traditional math fonts if mappings to Unicode are provided. |
| 4 |
|
| 5 |
## Installation |
| 6 |
Run `l3build install` to install `luamml` into your local `texmf` tree. |
| 7 |
|
| 8 |
## Usage |
| 9 |
To generate MathML of your LuaLaTeX formulas you should use latex-lab-math which will internally call LuaMML. A typical example would be |
| 10 |
|
| 11 |
``` |
| 12 |
\DocumentMetadata{lang=en, tagging=on, tagging-setup={math/setup=mathml-SE}} |
| 13 |
\documentclass{article} |
| 14 |
\usepackage{unicode-math} |
| 15 |
\begin{document} |
| 16 |
\[ E=mc^2 \] |
| 17 |
\end{document} |
| 18 |
``` |
| 19 |
|
| 20 |
This will automatically generate MathML nd embed it into the tagging structure |
| 21 |
of the output. |
| 22 |
See the latex-lab-math documentation for details. |
| 23 |
|
| 24 |
## License |
| 25 |
LuaMML may be modified and distributed under the terms of the [LaTeX Project Public License](https://www.latex-project.org/lppl/), version 1.3c or greater. |
| 26 |
It is written by Marcel Krüger and the LaTeX Project Team. |
| 27 |
|
| 28 |
<!-- Also see a [`tagpdf` experiment using this to tag PDF formulas](https://github.com/u-fischer/tagpdf/blob/develop/experiments/exp-mathml-lua.tex). --> |
| 29 |
|
| 30 |
<!-- If you are very brave you can also try running `pdflatex test_pdf` and afterwards run `./pdfmml.lua test_pdf.lua` to get pdflatex formulas converted. --> |