latex3 / tagpdf

Tagging support code for LaTeX
59 stars 7 forks source link

verbatim is more widely spaced if tagging (phase-III) is activated #74

Closed jfbu closed 8 months ago

jfbu commented 1 year ago
\DocumentMetadata{testphase={phase-III}}
\documentclass{article}
\begin{document}
\begin{verbatim}
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\Huge
$\mathit{f_i^i}$\par $\mathrm{f_i^i}$
\end{document}
\end{verbatim}
\end{document}

output from using lualatex-dev: Capture d’écran 2023-05-15 à 13 42 01

output if first line is commented out Capture d’écran 2023-05-15 à 13 42 33

Same issue using pdflatex-dev.

Log file with lualatex-dev attached. test_tagging_verbatim.log

u-fischer commented 1 year ago

That is an issue in the block-tagging code. \parskip is not zero @FrankMittelbach is legacyverbatimsetup the right place to add this?

\DocumentMetadata{testphase={block-tagging}} 
\documentclass{article}
\begin{document}

\begin{verbatim}
abc
abc
\end{verbatim}

\makeatletter
\AddToHook{cmd/legacyverbatimsetup/before}{\parskip\z@skip}

\begin{verbatim}
abc
abc
\end{verbatim}
\end{document}

image

FrankMittelbach commented 1 year ago

it would be possible to freeze \parskip to zero as suggested, but I think it is better to use a "verbatimblock" instance to set this value as this allows designs where the code blocks are deliberately spaced out or indented or ... This is what I have pushed in latex-lab.