如何禁用从狮身人面像生成的LaTeX输出中的颜色? [英] How do I disable colors in LaTeX output generated from sphinx?

查看:80
本文介绍了如何禁用从狮身人面像生成的LaTeX输出中的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

构建从狮身人面像生成的LaTeX文件时,TOC条目和节标题为蓝色.有一种简单的方法可以禁用这些项目的着色吗?如果没有,有没有简单的方法可以将它们变黑?我的目标是在非彩色打印机上打印文档,这样做时,目录和标题看起来不像其余文本那么暗.

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.

注意:我正在使用howto文档类.

Note: I am using the howto document class.

由于ddbeck的输入,我仔细研究了sphinx.sty,它定义了我需要更改的颜色.我在conf.py中设置(创建)了 latex_elements 字典,如下所示:

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
    }

这完全符合我的要求.谢谢ddbeck!

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

推荐答案

您可以使用latex_elements['preamble']配置选项添加LaTeX.如果更改该键的值,则可以覆盖Sphinx的常规LaTeX.但是,关于此选项的文档并不是特别有用.您可能会从默认.cls文件.

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.

这篇关于如何禁用从狮身人面像生成的LaTeX输出中的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆