summaryrefslogtreecommitdiff
path: root/doc/conf.py
diff options
context:
space:
mode:
authorjfbu <jfbu@free.fr>2017-05-15 11:53:07 +0200
committerjfbu <jfbu@free.fr>2017-05-20 09:54:09 +0200
commit6422f7b8c94a66798bcb24ba6c06dd05687c64c9 (patch)
treed149746b932cbd32448182bd84aa8f4938a701b9 /doc/conf.py
parentf06a7e4bef996787d13cd561e5e5a504e7e13dde (diff)
downloadsphinx-git-6422f7b8c94a66798bcb24ba6c06dd05687c64c9.tar.gz
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.
Diffstat (limited to 'doc/conf.py')
-rw-r--r--doc/conf.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/conf.py b/doc/conf.py
index 6817af12a..e63c2b0c8 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -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'