Skip to content

Commit 5edcb28

Browse files
authored
Merge pull request #5239 from jfbu/latex_revert_5181_RTDbug_workaround
Revert "LaTeX: extend to all projects the #3742 fix for PDF builds at RTD"
2 parents b899bc7 + f0067f4 commit 5edcb28

File tree

5 files changed

+16
-40
lines changed

5 files changed

+16
-40
lines changed

doc/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@
6464
'passoptionstopackages': '\\PassOptionsToPackage{svgnames}{xcolor}',
6565
'preamble': '\\DeclareUnicodeCharacter{229E}{\\ensuremath{\\boxplus}}',
6666
'fvset': '\\fvset{fontsize=auto}',
67-
'printindex': '\\footnotesize\\raggedright\\sphinxprintindex',
67+
# fix missing index entry due to RTD doing only once pdflatex after makeindex
68+
'printindex': r'''
69+
\IfFileExists{\jobname.ind}
70+
{\footnotesize\raggedright\printindex}
71+
{\begin{sphinxtheindex}\end{sphinxtheindex}}
72+
''',
6873
}
6974
latex_show_urls = 'footnote'
7075
latex_use_xindy = True

doc/latex.rst

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ example::
5555
\setlength{\cftsecnumwidth}{1.25cm}
5656
''',
5757
'fncychap': r'\usepackage[Bjornstrup]{fncychap}',
58-
'printindex': r'\footnotesize\raggedright\sphinxprintindex',
58+
'printindex': r'\footnotesize\raggedright\printindex',
5959
}
6060
latex_show_urls = 'footnote'
6161

@@ -399,23 +399,6 @@ Macros
399399
:file:`sphinxmanual.cls` and :file:`sphinxhowto.cls`.
400400
- the citation reference is typeset via ``\sphinxcite`` which is a wrapper
401401
of standard ``\cite``.
402-
- regarding the general index, the :confval:`latex_elements` dictionary has a
403-
``'printindex'`` key which defaults to ``'\\sphinxprintindex'``. It often
404-
proves advantageous to use::
405-
406-
'printindex': '\\footnotesize\\raggedright\\sphinxprintindex',
407-
408-
especially if the index contains long entries. The LaTeX class for Japanese
409-
``'manual'``-type documents already does the font size and text
410-
justification change, so the above is not needed then.
411-
412-
.. tip::
413-
414-
Advanced LaTeX users can also, via :confval:`latex_additional_files`, use
415-
a custom :program:`makeindex` style file :file:`python.ist`, or a custom
416-
:program:`xindy` style file :file:`sphinx.xdy` (see
417-
:confval:`latex_use_xindy`) in order to modify how the general index is
418-
typeset.
419402

420403
Environments
421404
~~~~~~~~~~~~
@@ -470,8 +453,7 @@ Environments
470453
- the bibliography uses ``sphinxthebibliography`` and the Python Module index
471454
as well as the general index both use ``sphinxtheindex``; these environments
472455
are wrappers of the ``thebibliography`` and respectively ``theindex``
473-
environments, needed mainly to insert a corresponding entry in the PDF
474-
bookmarks and table of contents.
456+
environments as provided by the document class (or packages).
475457

476458
.. versionchanged:: 1.5
477459
formerly, the original environments were modified by Sphinx.

doc/usage/configuration.rst

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,8 +1763,8 @@ the `Dublin Core metadata <http://dublincore.org/>`_.
17631763
Options for LaTeX output
17641764
------------------------
17651765

1766-
These options influence LaTeX output. For customization of LaTeX
1767-
macros and environments, see also :doc:`/latex`.
1766+
These options influence LaTeX output. Refer to :doc:`/latex` for more
1767+
information.
17681768

17691769
.. confval:: latex_engine
17701770

@@ -2173,14 +2173,11 @@ macros and environments, see also :doc:`/latex`.
21732173
Remove unneeded ``{}`` after ``\\hrule``.
21742174

21752175
``'printindex'``
2176-
"printindex" call, the last thing in the file.
2177-
2178-
.. versionchanged:: 1.8
2179-
Former default ``'\\printindex'`` now ``'\\sphinxprintindex'``.
2180-
This macro works around an issue__ with PDF builds at RTD doing too
2181-
few ``pdflatex`` runs.
2182-
2183-
__ https://github.com/rtfd/readthedocs.org/issues/2857
2176+
"printindex" call, the last thing in the file, default
2177+
``'\\printindex'``. Override if you want to generate the index
2178+
differently or append some content after the index. For example
2179+
``'\\footnotesize\\raggedright\\printindex'`` is advisable when the
2180+
index is full of long entries.
21842181

21852182
``'fvset'``
21862183
Customization of ``fancyvrb`` LaTeX package. Currently, Sphinx uses

sphinx/texinputs/sphinx.sty

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -462,14 +462,6 @@
462462
}
463463
\fi
464464

465-
% provide \sphinxprintindex as variant of \printindex designed to workaround
466-
% rtfd/readthedocs.org#2857 regarding "Index" entry in PDF bookmarks
467-
\newcommand*{\sphinxprintindex}{%
468-
\IfFileExists{\jobname.ind}
469-
{\printindex}
470-
{\begin{sphinxtheindex}\end{sphinxtheindex}}%
471-
}%
472-
473465
% make commands known to non-Sphinx document classes
474466
\providecommand*{\sphinxtableofcontents}{\tableofcontents}
475467
\ltx@ifundefined{sphinxthebibliography}

sphinx/writers/latex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
'maketitle': '\\maketitle',
125125
'tableofcontents': '\\sphinxtableofcontents',
126126
'atendofbody': '',
127-
'printindex': '\\sphinxprintindex',
127+
'printindex': '\\printindex',
128128
'transition': '\n\n\\bigskip\\hrule\\bigskip\n\n',
129129
'figure_align': 'htbp',
130130
'tocdepth': '',

0 commit comments

Comments
 (0)