Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable colors in LaTeX output generated from sphinx?

When I build the LaTeX file generated from sphinx, the TOC entries, and section headers are blue. Is there an easy way to disable coloring these items? If not, is there an easy way to make them black instead? My goal is to print the document on a non-color printer, and the TOC and headings do not look as dark as the rest of the text when I do so.

I would like to make one change that applies to the whole document if possible.

Note: I am using the howto document class.


Update

Thanks to ddbeck's input, I took a closer look at sphinx.sty which defines the colors that I needed to change. I set (created) the latex_elements dictionary in conf.py as follows:

mypreamble ='''
\\pagenumbering{arabic}
\\definecolor{TitleColor}{rgb}{0,0,0}
\\definecolor{InnerLinkColor}{rgb}{0,0,0}
'''
latex_elements = {
    'papersize':'letterpaper',
    'pointsize':'11pt',
    'preamble':mypreamble
    }

This worked out exactly as I wanted it. Thanks ddbeck!

like image 582
Jason Avatar asked Feb 11 '10 00:02

Jason


1 Answers

You can add LaTeX by using the latex_elements['preamble'] configuration option. If you change the value of that key, you can override Sphinx's normal LaTeX. The docs on this option aren't particularly illuminating, however. You may find this thread from sphinx-dev a bit more helpful; it has more detail on how that might be used, as well as some good links for learning about LaTex (if that's something you need to get black and white output). Finally, it might help to take a look at the default .cls and .sty files.

like image 82
ddbeck Avatar answered Nov 07 '22 08:11

ddbeck