Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignored leftmargin by verbatim contents after first line if nested in a list item #79

Closed
jfbu opened this issue May 16, 2023 · 6 comments

Comments

@jfbu
Copy link

jfbu commented May 16, 2023

\DocumentMetadata{testphase={phase-III}}
\documentclass{article}
\begin{document}
\begin{itemize}
\item
\begin{verbatim}
    \MTactiveasterisk
    \MTprimedoesskip
\end{verbatim}
\item Test
\begin{verbatim}
    \MTactiveasterisk
    \MTprimedoesskip
\end{verbatim}
\end{itemize}
OK if out of list item:
\begin{verbatim}
    \MTactiveasterisk
    \MTprimedoesskip
\end{verbatim}
\end{document}

produces

Capture d’écran 2023-05-16 à 11 08 14

test_tagging_verbatim2.log

@jfbu jfbu changed the title Unexpected indent in first line of a verbatim in a list item Disappearing initial spaces in a verbatim in a list item May 16, 2023
@jfbu
Copy link
Author

jfbu commented May 16, 2023

Sorry my initial title was wrong as one shows with output without activated tagging:
Capture d’écran 2023-05-16 à 11 07 11

Update: perhaps my title is off the mark as it may rather be list leftmargin which is not obeyed rather than spaces from source. I did not look more closely.

@jfbu jfbu changed the title Disappearing initial spaces in a verbatim in a list item Ignored leftmargin by verbatim contents after first line if nested in a list item May 16, 2023
@jfbu
Copy link
Author

jfbu commented May 16, 2023

I edited the title to better match the problem:

\DocumentMetadata{testphase={phase-III}}
\documentclass{article}
\begin{document}
\begin{itemize}
\item
\begin{verbatim}
    \MTactiveasterisk
    \MTprimedoesskip
\end{verbatim}
\item Text
\begin{verbatim}
    \MTactiveasterisk
    \MTprimedoesskip
\end{verbatim}
\item Some sub list
  \begin{itemize}
  \item Some text before verbatim
\begin{verbatim}
\MTactiveasterisk
\MTprimedoesskip
  \MTprimedoesskip
    \MTprimedoesskip
\end{verbatim}
  \end{itemize}
\end{itemize}
OK if out of list item:
\begin{verbatim}
    \MTactiveasterisk
    \MTprimedoesskip
\end{verbatim}
\end{document}
% https://github.com/u-fischer/tagpdf/issues/79

Capture d’écran 2023-05-16 à 11 25 42

@FrankMittelbach
Copy link
Member

LaTeX2e used a trivlist for verbatim and inside changed \leftskip to mimic the outer indentation. We now do not used a list anymore but this means that we need to preserve any \parshape setting from an outer list (which the code failed to do). This has been corrected in latex-lab.

@jfbu
Copy link
Author

jfbu commented May 17, 2023

Will vertical spacing relative to surrounding context be faithfully obeyed by the new code not using a list?

@FrankMittelbach
Copy link
Member

Will vertical spacing relative to surrounding context be faithfully obeyed by the new code not using a list?

define faithfully :-) yes it should that was the plan. It is implemented as a displayblock template which handles the vertical spacing to be (by default) th same as in other display blocks, eg lists or quote etc. By using its own instance, however, a class file can decide to use special spacing around the verbatim different from, say, quote or lists which gives more choices than with the 2e implementation, but by default it should come out as before.

@jfbu
Copy link
Author

jfbu commented May 17, 2023

ok since I discovered latex2e/required/latex-lab and the magic incantation l3build doc so I have some reading to do...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants