Convert a LaTeX Package to PDF

Last modified by Vincent Massol on 2026/08/30 19:36

Steps

The LaTeX format of the export menu gives you a ZIP of LaTeX sources, not a finished document. Compile it into a PDF yourself when your wiki offers no PDF (LaTeX) entry because it has no PDF conversion set up, or when you want to edit the sources before compiling them.

The commands below run pdflatex inside a Docker container, so the only thing you have to install is Docker itself.

  1. Unzip the package and put yourself at its root. Download the helper script of the blang/latex-docker project next to index.tex, and make it executable.
    wget https://raw.githubusercontent.com/blang/latex-docker/master/latexdockercmd.sh
    chmod +x latexdockercmd.sh
  2. Compile index.tex by running the helper twice. A single run leaves the table of contents empty, for the reason the wiki's own PDF conversion also compiles twice.
    ./latexdockercmd.sh pdflatex -shell-escape index.tex
    ./latexdockercmd.sh pdflatex -shell-escape index.tex

    generated-pdf-contents.png

  3. Open index.pdf, next to index.tex at the root of the package. It holds the exported pages typeset, with their images and the table of contents in front of them.

    generated-pdf-page.png

FAQ

Can I compile the package without Docker?

Yes, any TeX distribution does. Run pdflatex -shell-escape index.tex twice from the root of the unzipped package. Code blocks are typeset with the minted package, which is what needs -shell-escape and a local Pygments installation.

Related

Get Connected