python-sphinx - 如何使用 sphinx 删除 reStructuredText 中代码块周围的框

标签 python-sphinx restructuredtext

我正在使用重组文本来记录某些内容。要使用指令“代码块”,代码似乎总是包含在生成的文档中的一个框中。例如,

     .. code-block:: C++
        :linenos:
        :emphasize-lines: 2

        void readIntegerFile(const string& fileName, vector<int>& dest)
            throw(invalid_argument, runtime_error)
        {
            // some code ...
        }

C++ 代码始终包含在生成的 PDF 文件中。我想知道是否有一个旋钮可以关闭盒子。我用谷歌搜索了一下,找不到它。事实上,我什至找不到代码块旋钮的完整列表

谢谢

最佳答案

该框似乎是硬编码的,但您可以通过添加此命令来隐藏它 conf.py 文件中的 latex_elements['preamble']:

\definecolor{VerbatimBorderColor}{rgb}{1,1,1}

如果您没有纯白色背景,则效果不会很好。

关于python-sphinx - 如何使用 sphinx 删除 reStructuredText 中代码块周围的框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29403100/

相关文章:

python-sphinx - 如何使用 RST 和 Sphinx 包含文件目录

python-sphinx - 重组文本中的不同字体大小

python - 在目录中首先列出本地部分,最后列出链接页面

python - 狮身人面像 :ivar tag goes looking for cross-references

python - 如何在 reStructuredText 中找到标题

restructuredtext - 在第一个图像中添加标题属性

restructuredtext - 在缩略图插件生成的帖子中使用缩略图

pdf - 在 Windows 上从 Markdown 生成 CHM 和 PDF 文档的工具

python-sphinx - 如何使用 sphinx 链接到 rst 中的文件?

python-sphinx - Sphinx docs/RST 包含来自动态路径的文件?