diff --git a/CHANGES b/CHANGES index 41263fc58..d869dbe26 100644 --- a/CHANGES +++ b/CHANGES @@ -45,6 +45,7 @@ Bugs fixed sorting * #5139: autodoc: Enum argument missing if it shares value with another * #4946: py domain: rtype field could not handle "None" as a type +* #5176: LaTeX: indexing of terms containing ``@``, ``!``, or ``"`` fails * #5161: html: crashes if copying static files are failed * #5167: autodoc: Fix formatting type annotations for tuples with more than two arguments diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index a763e7c15..f10b918bd 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -1963,6 +1963,9 @@ class LaTeXTranslator(nodes.NodeVisitor): value = self.encode(value) value = value.replace(r'\{', r'{\sphinxleftcurlybrace}') value = value.replace(r'\}', r'{\sphinxrightcurlybrace}') + value = value.replace('"', '""') + value = value.replace('@', '"@') + value = value.replace('!', '"!') return value if not node.get('inline', True):