To be a complete LaTeX toolchain we need something like latexmk to be able to perform the correct number of executions of pdflatex and bibtex, and unfortunately there isn't a good native (and hence Emscripten-able) or Javascript solution for this. As a stopgap, we currently use latexmk and rely on a system Perl interpreter for macOS/Linux (a reasonably safe bet) and use pp to compile a standalone Windows binary of latexmk for Windows (where we can't guarantee at all that a perl interpreter will be kicking around).
This repository stores the current version of latexmk that we use in Latexjs and the compiled Windows binary version.
On Windows:
- Install Strawberry Perl
- Following these instructions first install the cpanm tool:
cpan App::cpanminus
- Then use this to install
pp:
cpanm pp
With this done, we can now build a binary of latexmk:
- Download the latest version of latexmk
- Run
pp -M FindBin -o latexmk.exe latexmk.pl
To build a Windows binary. Note that we manually include FindBin as we use this in our custom latexmk config perl script.
- Commit and push the changes
- Rebuild
latexjs/latexjsto include the new version in an update ofLatexjs.