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:
jfbu
2017-05-15 11:53:07 +02:00
parent f06a7e4bef
commit 6422f7b8c9
2 changed files with 11 additions and 1 deletions

View File

@@ -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'