代码之家  ›  专栏  ›  技术社区  ›  theDmi

如何去掉Sphinx乳胶输出页面标题中的“Release 1”?

  •  3
  • theDmi  · 技术社区  · 16 年前

    我使用的是Sphinx的“manual”文档类,除了页眉之外,我对乳胶输出的外观非常满意。它包含了我论文的标题,以及“发行版1”。

    因为我写的是论文而不是文档,所以我显然不需要发布信息。不幸的是,很难找到关于如何定制Sphinx乳胶输出的信息。

    有人知道怎么做吗?

    4 回复  |  直到 6 年前
        1
  •  8
  •   ddbeck    15 年前

    要抑制乳胶输出顶部的发布信息,需要设置 release 和 latex_elements['releasename'] conf.py . 所以你可以在 形态py :

    release = ''
    latex_elements = { 'releasename': '' }
    

        2
  •  1
  •   E Kelly    8 年前

    从Sphinx 1.5开始,设置空字符串的解决方案就停止了工作——至少在我的情况下是这样(我用它来禁止在标题页上打印“Release”)。但是,将release设置为空白对我确实有效。Sphinx用户组对此有更多讨论: https://groups.google.com/forum/#!topic/sphinx-users/L5PUfwVu8f0 还有一个相关的错误报告: https://github.com/sphinx-doc/sphinx/pull/4411

        3
  •  0
  •   Andrej Debenjak John T    10 年前

    下面的行也消除了标题中的逗号。将它们添加到 conf.py 文件:

    latex_custom = r'''
    \makeatletter
    
        \fancypagestyle{normal}{
            \fancyhf{}
            \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}}
            \fancyfoot[LO]{{\py@HeaderFamily\nouppercase{\rightmark}}}
            \fancyfoot[RE]{{\py@HeaderFamily\nouppercase{\leftmark}}}
            \fancyhead[LE,RO]{{\py@HeaderFamily \@title}}
            \renewcommand{\headrulewidth}{0.4pt}
            \renewcommand{\footrulewidth}{0.4pt}
    
    \makeatother
    '''
    
    latex_elements = {'preamble': latex_custom}
    

    这样的解决方案只影响头。

        4
  •  -3
  •   tszming    16 年前
    推荐文章