Fix: #5133 via `\sphinxsymbolsname, \sphinxnumbersname`

Also adds usage of \sphinxstyleindexletterhead in python.ist as a
customizable alias of original \bigletter.
This commit is contained in:
jfbu 2018-07-01 10:06:23 +02:00
parent 1140e81df7
commit 46bc56636e
4 changed files with 17 additions and 6 deletions

View File

@ -152,6 +152,7 @@ Bugs fixed
* #4945: i18n: fix lang_COUNTRY not fallback correctly for IndexBuilder. Thanks
to Shengjing Zhu.
* #4983: productionlist directive generates invalid IDs for the tokens
* #5133: latex: index headings "Symbols" and "Numbers" not internationalized
Testing
--------

View File

@ -3,11 +3,11 @@ headings_flag 1
heading_prefix " \\bigletter "
preamble "\\begin{sphinxtheindex}
\\def\\bigletter#1{{\\Large\\sffamily#1}\\nopagebreak\\vspace{1mm}}
\\let\\bigletter\\sphinxstyleindexletterhead
"
postamble "\n\n\\end{sphinxtheindex}\n"
symhead_positive "{Symbols}"
numhead_positive "{Numbers}"
symhead_positive "{\\sphinxsymbolsname}"
numhead_positive "{\\sphinxnumbersname}"

View File

@ -470,6 +470,9 @@
{\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}}%
{}% else clause of \ltx@ifundefined
% redefined in preamble, headings for makeindex produced index
\newcommand*{\sphinxsymbolsname}{Symbols}
\newcommand*{\sphinxnumbersname}{Numbers}
%% COLOR (general)
%
@ -1592,9 +1595,10 @@
% additional customizable styling
% FIXME: convert this to package options ?
\protected\def\sphinxstyleindexentry #1{\texttt{#1}}
\protected\def\sphinxstyleindexextra #1{ \emph{(#1)}}
\protected\def\sphinxstyleindexpageref #1{, \pageref{#1}}
\def\sphinxstyleindexentry #1{\texttt{#1}}
\def\sphinxstyleindexextra #1{ \emph{(#1)}}
\def\sphinxstyleindexpageref #1{, \pageref{#1}}
\def\sphinxstyleindexletterhead #1{{\Large\sffamily#1}\nopagebreak\vspace{1mm}}
\protected\def\sphinxstyletopictitle #1{\textbf{#1}\par\medskip}
\let\sphinxstylesidebartitle\sphinxstyletopictitle
\protected\def\sphinxstyleothertitle #1{\textbf{#1}}

View File

@ -673,6 +673,12 @@ class LaTeXTranslator(nodes.NodeVisitor):
) +
self.babel_renewcommand(
'\\literalblockcontinuesname', self.encode(_('continues on next page'))
) +
self.babel_renewcommand(
'\\sphinxsymbolsname', self.encode(_('Symbols'))
) +
self.babel_renewcommand(
'\\sphinxnumbersname', self.encode(_('Numbers'))
)
)
self.elements['pageautorefname'] = \