Skip to content

Commit

Permalink
Make sure option names in xelatex pdf output do not split at dashes
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu committed Dec 9, 2021
1 parent 3dbcab2 commit 8ad4961
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sphinx/texinputs/sphinxlatexliterals.sty
@@ -1,7 +1,7 @@
%% LITERAL BLOCKS
%
% change this info string if making any custom modification
\ProvidesFile{sphinxlatexliterals.sty}[2021/01/27 code-blocks and parsed literals]
\ProvidesFile{sphinxlatexliterals.sty}[2021/12/06 code-blocks and parsed literals]

% Provides support for this output mark-up from Sphinx latex writer:
%
Expand Down Expand Up @@ -711,6 +711,9 @@
\ifspx@opt@parsedliteralwraps
\sbox\sphinxcontinuationbox {\spx@opt@verbatimcontinued}%
\sbox\sphinxvisiblespacebox {\spx@opt@verbatimvisiblespace}%
% this uses a monospace font and linebreaks at dashes will be inhibited with
% pdflatex; not so with xelatex (cf \defaultfontfeatures in latex writer) so:
\def\sphinxhyphen{\mbox{-}}%
\sphinxbreaksattexescapedchars
\sphinxbreaksviaactiveinparsedliteral
\sphinxbreaksatspaceinparsedliteral
Expand Down Expand Up @@ -762,6 +765,10 @@
\protected\def\sphinxupquote#1{{\def\@tempa{alltt}%
\ifx\@tempa\@currenvir\else
\ifspx@opt@inlineliteralwraps
% a priori, this is typeset using a monospace font (cf \sphinxcode in
% sphinxlatexstyletext.sty) so linebreaks at dashes are inhibited;
% but, for xelatex or in case of non-monospace font, let's do this:
\def\sphinxhyphen{\mbox{-}}%
% break at . , ; ? ! /
\sphinxbreaksviaactive
% break also at \
Expand Down

0 comments on commit 8ad4961

Please sign in to comment.