mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
LaTeX: revert in index entries to \textbar{} not \sphinxtextbar{}
This is because of case of an index directive or role in a table cell. For the same reason tabulary is not compatible with code-cells, it affects index entries. The escaping of | char by a LaTeX macro needed to be by a "robus" or "protected" one, or by string like {"|}. This was not the choice of previous commit, by oversight. By reverting to \textbar{} (which is a "robust" command) we also maintain maximal backwards compatibility for the sorting in the index done by the makeindex program.
This commit is contained in:
parent
e720f0a1a2
commit
30c7af788c
@ -1881,10 +1881,9 @@
|
|||||||
\let\sphinxtermref \@firstofone
|
\let\sphinxtermref \@firstofone
|
||||||
}}
|
}}
|
||||||
|
|
||||||
% For curly braces and vertical bar inside \index macro
|
% For curly braces inside \index macro
|
||||||
\def\sphinxleftcurlybrace{\{}
|
\def\sphinxleftcurlybrace{\{}
|
||||||
\def\sphinxrightcurlybrace{\}}
|
\def\sphinxrightcurlybrace{\}}
|
||||||
\def\sphinxverticalbar{|}
|
|
||||||
|
|
||||||
% Declare Unicode characters used by linux tree command to pdflatex utf8/utf8x
|
% Declare Unicode characters used by linux tree command to pdflatex utf8/utf8x
|
||||||
\def\spx@bd#1#2{%
|
\def\spx@bd#1#2{%
|
||||||
|
@ -109,7 +109,6 @@
|
|||||||
|
|
||||||
(merge-rule "\sphinxleftcurlybrace{}" "{" :string)
|
(merge-rule "\sphinxleftcurlybrace{}" "{" :string)
|
||||||
(merge-rule "\sphinxrightcurlybrace{}" "}" :string)
|
(merge-rule "\sphinxrightcurlybrace{}" "}" :string)
|
||||||
(merge-rule "\sphinxverticalbar{}" "|" :string)
|
|
||||||
(merge-rule "\_" "_" :string)
|
(merge-rule "\_" "_" :string)
|
||||||
(merge-rule "{[}" "[" :string)
|
(merge-rule "{[}" "[" :string)
|
||||||
(merge-rule "{]}" "]" :string)
|
(merge-rule "{]}" "]" :string)
|
||||||
@ -127,6 +126,7 @@
|
|||||||
(merge-rule "\(\rightarrow\)" "→" :string)
|
(merge-rule "\(\rightarrow\)" "→" :string)
|
||||||
(merge-rule "\(\checkmark\)" "✓" :string)
|
(merge-rule "\(\checkmark\)" "✓" :string)
|
||||||
(merge-rule "\textendash{}" "–" :string)
|
(merge-rule "\textendash{}" "–" :string)
|
||||||
|
(merge-rule "\textbar{}" "|" :string)
|
||||||
(merge-rule "\(\sp{\text{0}}\)" "⁰" :string)
|
(merge-rule "\(\sp{\text{0}}\)" "⁰" :string)
|
||||||
(merge-rule "\(\sp{\text{1}}\)" "¹" :string)
|
(merge-rule "\(\sp{\text{1}}\)" "¹" :string)
|
||||||
(merge-rule "\(\sp{\text{2}}\)" "²" :string)
|
(merge-rule "\(\sp{\text{2}}\)" "²" :string)
|
||||||
|
@ -1816,7 +1816,7 @@ class LaTeXTranslator(SphinxTranslator):
|
|||||||
value = value.replace('"', '""')
|
value = value.replace('"', '""')
|
||||||
value = value.replace('@', '"@')
|
value = value.replace('@', '"@')
|
||||||
value = value.replace('!', '"!')
|
value = value.replace('!', '"!')
|
||||||
value = value.replace('|', r'\sphinxverticalbar{}')
|
value = value.replace('|', r'\textbar{}')
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def style(string):
|
def style(string):
|
||||||
|
Loading…
Reference in New Issue
Block a user