mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #3742: missing `Index
` bookmark and TOC entry in PDF builds at RTD
The trick is to create an Index TOC/bookmarks entry in anticipation of makeindex execution, as RTD (currently) does only one pdflatex run after makeindex. https://github.com/rtfd/readthedocs.org/issues/2857 The workaround works for Sphinx own docs, which uses ``'manual'`` docclass and puts the general index at very end of document.
This commit is contained in:
5
CHANGES
5
CHANGES
@@ -17,6 +17,11 @@ Bugs fixed
|
||||
* #3756: epub: Entity 'mdash' not defined
|
||||
* #3758: Sphinx crashed if logs are emitted in conf.py
|
||||
* #3755: incorrectly warns about dedent with literalinclude
|
||||
* #3742: `RTD <https://readthedocs.org/>`_ PDF builds of Sphinx own docs are
|
||||
missing an index entry in the bookmarks and table of contents. This is
|
||||
`rtfd/readthedocs.org#2857
|
||||
<https://github.com/rtfd/readthedocs.org/issues/2857>`_ issue, a workaround
|
||||
is obtained using some extra LaTeX code in Sphinx's own :file:`conf.py`
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@@ -56,7 +56,12 @@ latex_logo = '_static/sphinx.png'
|
||||
latex_elements = {
|
||||
'fontpkg': '\\usepackage{palatino}',
|
||||
'passoptionstopackages': '\\PassOptionsToPackage{svgnames}{xcolor}',
|
||||
'printindex': '\\footnotesize\\raggedright\\printindex',
|
||||
# fix missing index entry due to RTD doing only once pdflatex after makeindex
|
||||
'printindex': r'''
|
||||
\IfFileExists{\jobname.ind}
|
||||
{\footnotesize\raggedright\printindex}
|
||||
{\begin{sphinxtheindex}\end{sphinxtheindex}}
|
||||
''',
|
||||
}
|
||||
latex_show_urls = 'footnote'
|
||||
|
||||
|
Reference in New Issue
Block a user