Building Alloy Docs to PDF file

posted on 2023-06-12

Alloy docs recently got updated to Alloy 6 and cover temporal logic into model checking. This alone make it my go to toolkit for model verification.

I like to have documentation available offline and on my book reader – just to be able to have some quick reading done when waiting in the car or something. It allows me to redeem, in a sense, this time.

Alloy docs use Sphinx documentation framework which do include PDF exporting out of the box, but the default of Alloy docs lacks one configuration parameter that would allow Sphinx to build PDF file.

So here are instructions to make it work:

cd ~/Src/opensource
git clone
cd alloydocs
latex_elements = {

the following:

latex_engine = "xelatex" # solves problem of unicode characters

so it will look like this:

# -- Options for LaTeX output ------------------------------------------------
latex_engine = "xelatex" # solves problem of unicode characters
latex_elements = {
    # The paper size ('letterpaper' or 'a4paper').
make latexpdf

Output file will be available at: _build/latex/AlloyDocumentation.pdf

I have contributed this small fix so hopefully anyone will be able to build a PDF file just by cloning the repository and executing latexpdf make target.

edit: The pull request was merged the same day, you can skip the modification step above.

Happy hacking!