|
1 | 1 | %% LITERAL BLOCKS |
2 | 2 | % |
3 | 3 | % change this info string if making any custom modification |
4 | | -\ProvidesPackage{sphinxlatexliterals}[2024/07/01 v7.4.0 code-blocks and parsed literals] |
| 4 | +\ProvidesPackage{sphinxlatexliterals}[2025/08/06 v8.3.0 code-blocks and parsed literals] |
5 | 5 |
|
6 | 6 | % Provides support for this output mark-up from Sphinx latex writer: |
7 | 7 | % |
|
241 | 241 | % _, }, ^, &, >, -, ~, and \: stay at end of broken line. |
242 | 242 | % Use of \textquotesingle for straight quote. |
243 | 243 | % FIXME: convert this to package options ? |
| 244 | +% MEMO: "beforelist" and "afterlist" hold no relation with lists, |
| 245 | +% they are just "\do lists" in the inherited TeX sense. |
244 | 246 | \newcommand*\sphinxbreaksbeforelist {% |
245 | 247 | \do\PYGZob\{\do\PYGZlt\<\do\PYGZsh\#\do\PYGZpc\%% {, <, #, %, |
246 | 248 | \do\PYGZdl\$\do\PYGZdq\"% $, " |
|
278 | 280 | \catcode`##1\active}% |
279 | 281 | \sphinxbreaksafteractivelist |
280 | 282 | \lccode`\~`\~ |
| 283 | + % visit_desc_name will insert non TeX-escaped ~ in the source |
| 284 | + \let~\spx@verbatim@space |
281 | 285 | } |
282 | 286 |
|
283 | 287 | % If the linebreak is at a space, the latter will be displayed as visible |
|
962 | 966 | \let\sphinxhyphen\sphinxhyphenininlineliteral |
963 | 967 | \ifspx@opt@inlineliteralwraps |
964 | 968 | % break at . , ; ? ! / |
| 969 | + % and also at ~ which will be handled like are spaces in verbatim |
965 | 970 | \sphinxbreaksviaactive |
| 971 | + % but for this we need to set this box which is empty by default: |
| 972 | + % MEMO: it looks suboptimal to redo this each time but this is |
| 973 | + % to obey a \sphinxsetup via raw LaTeX to set verbatimvisiblespace, |
| 974 | + % a possibility which however will be used by 0% of Sphinx users... |
| 975 | + \sbox\sphinxvisiblespacebox {\spx@opt@verbatimvisiblespace}% |
966 | 976 | % break also at \ |
967 | 977 | \setbox8=\hbox{\textbackslash}% |
968 | 978 | \def\sphinx@textbackslash{\copy8}% |
|
0 commit comments