|
1 | 1 | %% MODULE RELEASE DATA AND OBJECT DESCRIPTIONS |
2 | 2 | % |
3 | 3 | % change this info string if making any custom modification |
4 | | -\ProvidesPackage{sphinxlatexobjects}[2023/07/23 documentation environments] |
| 4 | +\ProvidesPackage{sphinxlatexobjects}[2025/02/11 documentation environments] |
5 | 5 |
|
6 | 6 | % Provides support for this output mark-up from Sphinx latex writer: |
7 | 7 | % |
|
279 | 279 | \newcommand{\pysigstopmultiline}{\sphinxsigismultilinefalse\itemsep\sphinxsignaturesep}% |
280 | 280 |
|
281 | 281 | % Production lists |
| 282 | +% This simply outputs the lines as is, in monospace font. Refers #13326. |
| 283 | +% (the left padding for multi-line alignment is from the nodes themselves, |
| 284 | +% and latex is configured below to obey such horizontal whitespace). |
| 285 | +% |
| 286 | +% - The legacy code used longtable and hardcoded the separator as ::= |
| 287 | +% via dedicated macros defined by the environment itself. |
| 288 | +% - Here the separator is part of the node. Any extra LaTeX mark-up would |
| 289 | +% have to originate from the writer itself to decorate it. |
| 290 | +% - The legacy code used strangely \parindent and \indent. Possibly |
| 291 | +% (unchecked) due to an earlier tabular usage, but a longtable does not |
| 292 | +% work in paragraph mode, so \parindent was without effect and |
| 293 | +% \indent only caused some extra blank line above display. |
| 294 | +% - The table had some whitespace on its left, which we imitate here via |
| 295 | +% \parindent usage (which works in our context...). |
282 | 296 | % |
283 | 297 | \newenvironment{productionlist}{% |
284 | | -% \def\sphinxoptional##1{{\Large[}##1{\Large]}} |
285 | | - \def\production##1##2{\\\sphinxcode{\sphinxupquote{##1}}&::=&\sphinxcode{\sphinxupquote{##2}}}% |
286 | | - \def\productioncont##1{\\& &\sphinxcode{\sphinxupquote{##1}}}% |
287 | | - \parindent=2em |
288 | | - \indent |
289 | | - \setlength{\LTpre}{0pt}% |
290 | | - \setlength{\LTpost}{0pt}% |
291 | | - \begin{longtable}[l]{lcl} |
| 298 | + \bigskip % imitate close enough legacy vertical whitespace, which was |
| 299 | + % visibly excessive |
| 300 | + \ttfamily % needed for space tokens to have same width as letters |
| 301 | + \parindent1em % width of a "quad", font-dependent, usually circa width of 2 |
| 302 | + % letters |
| 303 | + \obeylines % line in = line out |
| 304 | + \parskip\z@skip % prevent the parskip vertical whitespace between lines, |
| 305 | + % which are technically to LaTeX now each its own paragraph |
| 306 | + \@vobeyspaces % line in = line out, obey whitespace |
| 307 | + %\indent % avoid suppression of indent of first line, if it happens to |
| 308 | + % be located immediately after a sectioning division |
| 309 | + % now a technicality to, only locally to this environment, prevent the |
| 310 | + % suppression of indentation of first line, if it comes right after |
| 311 | + % \section. Cf package indentfirst from which the code is borrowed. |
| 312 | + \let\@afterindentfalse\@afterindenttrue\@afterindenttrue |
292 | 313 | }{% |
293 | | - \end{longtable} |
| 314 | + \par % does not hurt... |
294 | 315 | } |
295 | 316 |
|
296 | 317 | % Definition lists; requested by AMK for HOWTO documents. Probably useful |
|
0 commit comments