Sphinx latex output filename

Viewed 524

When running sphinx-build -b latex ... Sphinx writes a *.tex file into some output directory. The name of that *.tex file seems to somehow be derived from the project title set in conf.py.

I'd like to integrate the Sphinx Latex generation into my build system. For the dependency management I need to know the exact name of the generated *.tex file.

Is there any way to determine the name of the generated file without hard-coding that name into the build system? Or is there a way to set this name manually (without changing the project variable)?

1 Answers

As suggested by mzjn and explained in the Sphinx docs, one can set the name of the *.tex and *.pdf files via the latex_documents option in conf.py.

The canonical use case is probably to add the following at the end of conf.py.

#...
latex_documents = [('index', 'doc.tex', project, author, 'manual')]

This eventually produces a file doc.pdf.

Related