Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ Bugs fixed
to improve `semantic HTML structure
<https://html.spec.whatwg.org/multipage/text-level-semantics.html>`__.
Patch by Mark Ostroth.
* #13812 (discussion): LaTeX: long :rst:dir:`confval` value does not wrap at
spaces in PDF.
Patch by Jean-François B.
* #10785: Autodoc: Allow type aliases defined in the project to be properly
cross-referenced when used as type annotations. This makes it possible
for objects documented as ``:py:data:`` to be hyperlinked in function signatures.
Expand Down
12 changes: 11 additions & 1 deletion sphinx/texinputs/sphinxlatexliterals.sty
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%% LITERAL BLOCKS
%
% change this info string if making any custom modification
\ProvidesPackage{sphinxlatexliterals}[2024/07/01 v7.4.0 code-blocks and parsed literals]
\ProvidesPackage{sphinxlatexliterals}[2025/08/06 v8.3.0 code-blocks and parsed literals]

% Provides support for this output mark-up from Sphinx latex writer:
%
Expand Down Expand Up @@ -241,6 +241,8 @@
% _, }, ^, &, >, -, ~, and \: stay at end of broken line.
% Use of \textquotesingle for straight quote.
% FIXME: convert this to package options ?
% MEMO: "beforelist" and "afterlist" hold no relation with lists,
% they are just "\do lists" in the inherited TeX sense.
\newcommand*\sphinxbreaksbeforelist {%
\do\PYGZob\{\do\PYGZlt\<\do\PYGZsh\#\do\PYGZpc\%% {, <, #, %,
\do\PYGZdl\$\do\PYGZdq\"% $, "
Expand Down Expand Up @@ -278,6 +280,8 @@
\catcode`##1\active}%
\sphinxbreaksafteractivelist
\lccode`\~`\~
% visit_desc_name will insert non TeX-escaped ~ in the source
\let~\spx@verbatim@space
}

% If the linebreak is at a space, the latter will be displayed as visible
Expand Down Expand Up @@ -962,7 +966,13 @@
\let\sphinxhyphen\sphinxhyphenininlineliteral
\ifspx@opt@inlineliteralwraps
% break at . , ; ? ! /
% and also at ~ which will be handled like are spaces in verbatim
\sphinxbreaksviaactive
% but for this we need to set this box which is empty by default:
% MEMO: it looks suboptimal to redo this each time but this is
% to obey a \sphinxsetup via raw LaTeX to set verbatimvisiblespace,
% a possibility which however will be used by 0% of Sphinx users...
\sbox\sphinxvisiblespacebox {\spx@opt@verbatimvisiblespace}%
% break also at \
\setbox8=\hbox{\textbackslash}%
\def\sphinx@textbackslash{\copy8}%
Expand Down
Loading