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

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

问题描述

当我构建从 sphinx 生成的 LaTeX 文件时,TOC 条目和节标题是蓝色的.有没有一种简单的方法可以禁用这些项目的着色?如果没有,有没有一种简单的方法可以让它们变黑?我的目标是在非彩色打印机上打印文档,这样做时 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.但是,关于此选项的文档并不是特别有启发性.您可以从 sphinx-dev 更有帮助;它有更多关于如何使用它的详细信息,以及一些学习 LaTex 的好链接(如果这是你需要获得黑白输出的东西).最后,看看 default .cls.sty 文件.

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天全站免登陆