New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #9305 LaTeX: backslash in sphinxupquote error with Japanese #9335
Conversation
@@ -765,7 +765,8 @@ | |||
% break at . , ; ? ! / | |||
\sphinxbreaksviaactive | |||
% break also at \ | |||
\let\sphinx@textbackslash\textbackslash | |||
\setbox8=\hbox{\textbackslash}% | |||
\def\sphinx@textbackslash{\copy8}% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should perhaps use a proper scratch box but the contents of \sphinxupquote
should be a text string hence it seems legit to use say \box8
as here (as this is enclosed in braces).
The \textbackslash
is a complex command which checks the current font encoding and triggers a fall-back font encoding (OMS, math character) for example if character not available. So the former method with \let
did not have expected effect and the \textbackslash
was trying to redefine itself in a \discretionary
context where only boxes are allowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I mentioned OMS from my pure latex testing, but in Sphinx context this will be T1 encoding)
I used this test file from a former issue with backslash and line-wrapping in literal environments. Welcome to FOO's documentation!
===============================
:file:`a\\b`
:file:`\\C\\a{}a{}a{}\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa`
::
\aaa
``\aaa``
:file:`\\C\\aaa`
::
\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\
AAA
.. parsed-literal::
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