Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create PDF documentation with Sphinx in Windows

I am using Sphinx to create documentation for my Python project in Windows. I need to generate PDF documentation. I found many explanation how to do this in Linux, but no good explanation how to do this in Windows. As far as i understand I need to create Latex format with Sphinx, and than use Texworks to convert Latex to PDF. Can someone provide step by step explanation how can I do this, assuming I created documentation in Latex format and installed Texworks?

like image 224
Alex Avatar asked Oct 31 '12 10:10

Alex


People also ask

What is Sphinx-build?

sphinx-build generates documentation from the files in <sourcedir> and places it in the <outputdir> . sphinx-build looks for <sourcedir>/conf.py for the configuration settings. sphinx-quickstart(1) may be used to generate template files, including conf.py . sphinx-build can create documentation in different formats.


1 Answers

Install MiKTeX (< 200mb)

wget -nv -N http://mirrors.ctan.org/systems/win32/miktex/setup/miktex-portable-2.9.4757.exe
7z.exe x -y miktex-portable-2.9.4757.exe -o"miktex"

Add the bin directory to your path

SET Path=%Path%;%CD%\miktex\miktex\bin

Run Sphinx's "make.bat" to generate the .tex file.

SET SPHINXOPTS=-W -E
make.bat latex

Invoke MiKTeX's pdflatex:

cd build/latex
pdflatex.exe YOUR_PROJECT_NAME.tex

The resultant PDF will be in your build/latex directory

like image 102
Boinst Avatar answered Oct 24 '22 13:10

Boinst