Trekkie
Trekkie

Reputation: 994

Sphinx PDF output using latexpdf

I am trying to build Sphinx doc output as PDF rather than HTML. I can only use the tools which come with Sphinx, i.e. I cannot download additionl tools like rst2pdf. I have tried using 'make latexpdf', per the Sphinx documentation, which states it will produce pdf in addition to the .tex files. However I am only getting .tex. What am I missing? The Sphinx documentation states that PDF files will be produced.

Upvotes: 14

Views: 19641

Answers (1)

TheCodeArtist
TheCodeArtist

Reputation: 22517

Sphinx uses Latex to export the documentation as a PDF file.
Thus one needs the basic Latex dependencies used to write a pdf on the system.

For example, on a system running Ubuntu 16.04, they can be downloaded and installed by :

apt-get install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended

If running Sphinx 1.6 or above on GNU/Linux or OSX, you may also need the latexmk package.
Reference: sphinx.builders.latex.LaTeXBuilder documentation.

After installing the above packages, running make latexpdf in the sphinx project directory generates the documentation output as the PDF file ./_build/latex/<sphinx-project-name>.pdf>


Note: In the current scenario where you do not see a PDF file on your system after running make latexpdf, check the output of the command for any errors regarding missing latex tools/files. Use the system package manager to identify the missing packages and install them.

Upvotes: 26

Related Questions