How do I get rid of the “Release 1” in the Page Header of the Sphinx Latex Output?

狂风中的少年 提交于 2020-01-10 05:22:05

问题


I'm using the "manual" document class of Sphinx and I'm quite happy with how the Latex Output looks like, except for the page header. It contains the title of my paper, as well as a "Release 1".

Since I'm writing a paper and not a documentation, I clearly don't need the release information. Unfortunately, it is very hard to find information on how to customize Sphinx latex output.

Does somebody know how to do it?


回答1:


To suppress the release info at the top of your Latex output, you need to set the release and latex_elements['releasename'] to empty strings in your conf.py. So you might add or modify something like this in conf.py:

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

Then the release info will be hidden.




回答2:


As of Sphinx 1.5 something, the workaround of setting an empty string stopped working - at least in my case (I had used it to suppress printing "Release " on the title page) . However, setting release to a blank space does work for me. There's more discussion of it here in the Sphinx-Users group: https://groups.google.com/forum/#!topic/sphinx-users/L5PUfwVu8f0 and there was a related bug report filed: https://github.com/sphinx-doc/sphinx/pull/4411




回答3:


The bellow lines eliminate also the comma in the header. Add them in your conf.py file:

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}

Such a solution affects only the header. If you want to remove the release sign also from the front page use the solution provided by ddbeck.




回答4:


You can use stopwords - Stopwords are the words that will not be indexed.

http://sphinxsearch.com/docs/current.html#conf-stopwords



来源:https://stackoverflow.com/questions/3882770/how-do-i-get-rid-of-the-release-1-in-the-page-header-of-the-sphinx-latex-outpu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!