diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index 7e8421aed..5d9adb5bb 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -1881,10 +1881,9 @@ \let\sphinxtermref \@firstofone }} -% For curly braces and vertical bar inside \index macro +% For curly braces inside \index macro \def\sphinxleftcurlybrace{\{} \def\sphinxrightcurlybrace{\}} -\def\sphinxverticalbar{|} % Declare Unicode characters used by linux tree command to pdflatex utf8/utf8x \def\spx@bd#1#2{% diff --git a/sphinx/texinputs/sphinx.xdy b/sphinx/texinputs/sphinx.xdy index 0efbdef2f..1c0794cd9 100644 --- a/sphinx/texinputs/sphinx.xdy +++ b/sphinx/texinputs/sphinx.xdy @@ -109,7 +109,6 @@ (merge-rule "\sphinxleftcurlybrace{}" "{" :string) (merge-rule "\sphinxrightcurlybrace{}" "}" :string) -(merge-rule "\sphinxverticalbar{}" "|" :string) (merge-rule "\_" "_" :string) (merge-rule "{[}" "[" :string) (merge-rule "{]}" "]" :string) @@ -127,6 +126,7 @@ (merge-rule "\(\rightarrow\)" "→" :string) (merge-rule "\(\checkmark\)" "✓" :string) (merge-rule "\textendash{}" "–" :string) +(merge-rule "\textbar{}" "|" :string) (merge-rule "\(\sp{\text{0}}\)" "⁰" :string) (merge-rule "\(\sp{\text{1}}\)" "¹" :string) (merge-rule "\(\sp{\text{2}}\)" "²" :string) diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 7e79385f1..7695b31a9 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -1816,7 +1816,7 @@ class LaTeXTranslator(SphinxTranslator): value = value.replace('"', '""') value = value.replace('@', '"@') value = value.replace('!', '"!') - value = value.replace('|', r'\sphinxverticalbar{}') + value = value.replace('|', r'\textbar{}') return value def style(string):