Question

I use the Sphinx Python documentation generator. Creating pdf documents is very easy and simple, but I have one problem.

All generated pdf documents have English words like "chapter", "release", and "part".

How can I override these English labels in another language, or remove them completely?

Was it helpful?

Solution

Sphinx generates LaTeX files, and then uses LaTeX to generate the PDF. So yes, you can, but it typically involves learning LaTeX and changing the LaTeX macros. I did a quick search and couldn't find any place where the "Chapter" was defined, so it's probably defined in the Bjarne chapter heading style (which is the default), which means you need to find that definition and see of you can override it, or make a new definition.

LaTeX is big, so take a deep breath. But it's definitely possible. :)

OTHER TIPS

In your conf.py, there is the following paragraph (around line 57 in a conf.py created by sphinx-quickstart):

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

In my case, I changed it to:

language = nl      # bug!

Which of course should be:

language = 'nl'    # don't forget the quotes :-)

This will work for all Sphinx output; in my case, I only checked the html and latex output. On the Spinx website, there is list of supported languages.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top