Minimal HTTP daemon which converts TeX to SVG.
Running the docker image:
# replace MATHYD_HMAC_KEY with a secret key
docker run --rm -d -e MATHYD_HMAC_KEY=secret -p 3000:3000 pablotron/mathyd:latest
Given this input TeX file:
% quadratic formula
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
Run the following command:
# set URL and HMAC key
export MATHYD_URL=http://whatever.example.com:3000/
export MATHYD_HMAC_KEY=secret
# render output
bin/mathy < quadratic.tex > quadratic.svg
You can pipe directly into standard input, but you'll need a ludicrous number backslashes to handle shell escaping:
# set URL and HMAC key
export MATHYD_URL=http://whatever.example.com:3000/
export MATHYD_HMAC_KEY=secret
# render tex, save SVG to quadratic.svg
# (all the double escapes are necessary because of the shell)
echo "x = \\\\frac{-b \\\\pm \\\\sqrt{b^2 - 4ac}}{2a}" | \
bin/mathy > quadratic.svg
TBD. See bin/mathy
for example.
See examples/
for sample TeX files.