Crates.io | latexml-runner |
lib.rs | latexml-runner |
version | 0.1.6 |
source | src |
created_at | 2020-12-23 19:02:10.034223 |
updated_at | 2021-03-11 21:34:56.692906 |
description | Rust runner for high-performance TeX to HTML conversions with latexml |
homepage | https://github.com/dginev/latexml-runner |
repository | https://github.com/dginev/latexml-runner |
max_upload_size | |
id | 326652 |
size | 17,371,216 |
Rust runner for high-performance conversions with latexmls.
This executable is useful over the native Perl executables of latexml if:
If your conversion task requires a distributed setup and/or is unable to preload most dependencies, this crate won't offer you much of a speedup. For such cases, consider LaTeXML::Plugin::Cortex as one alternative.
You can try it out by using the publick docker image and avoid any installation headaches.
In the following example, we use an invocation useful for converting math in sites such as StackExchange and Wikipedia:
$ for i in {1..200}; do echo "\sqrt{x}+\frac{1}{2}=0" >> formula_latex.txt; done
$ time docker run --cpus="2.0" --memory="8g" \
-v "$(pwd)":/workdir -w /workdir \
latexml/latexml-runner:latest \
-i formula_latex.txt -o formula_xml.csv -l formula_status.log \
--preload=LaTeX.pool --preload=bm.sty --preload=texvc.sty \
--preload="literal:\\let\\theequation\\relax" \
--whatsin=math --whatsout=math --pmml --cmml --mathtex --format=html5 \
--nodefaultresources --timeout=30
Should complete in e.g. 9.5 seconds on a Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
.
Importantly, the formula_status.log
file should contain two hundred zeros, one on each line, to signal that the conversions are robustly finishing error-free. In other words, that the harness and latexmls
are communicating correctly.