How do I get rid of the “Release 1” in the Page He

2020-02-14 10:19发布

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?

4条回答
女痞
2楼-- · 2020-02-14 10:49

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

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

查看更多
Juvenile、少年°
3楼-- · 2020-02-14 11:01

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.

查看更多
姐就是有狂的资本
4楼-- · 2020-02-14 11:09

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

查看更多
Melony?
5楼-- · 2020-02-14 11:15

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.

查看更多
登录 后发表回答