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

item patches clash with paragraph tagging #8

Closed
u-fischer opened this issue Jan 7, 2022 · 2 comments
Closed

item patches clash with paragraph tagging #8

u-fischer opened this issue Jan 7, 2022 · 2 comments
Assignees

Comments

@u-fischer
Copy link

Description

As has been reported in the tagpdf issue tracker latex3/tagpdf#49 the patches microtype adds to \item clash with the automatic paragraph tagging of tagpdf.

The problem is that the paragraph hooks are executed twice at the item as microtype stores something in a box and issues a \noindent in the box which triggers the hooks. Imho the right fix is to use \RawNoindent instead. The difference can be shown also without tagpdf:

\documentclass{article}
\usepackage{microtype}
\makeatletter
%\patchcmd{\MT@get@prot}{\noindent}{\RawNoindent}{}{\fail}
\AddToHook{para/begin}{\show\blub}
\makeatletter
\begin{document}
\begin{quotation}
Hello world
\end{quotation}

\end{document}

Without the patch \show\blub is shown twice, with the patch only once.

@schlcht
Copy link
Owner

schlcht commented Jan 7, 2022

Thanks, I can change that.

However, it seems to me that the problem is a bit more general with tagpdf (or the new hook management?), because it will fail in the same way with other packages that do some "test typesetting". Just off the top of my head, think of tabularx and csquotes's \blockquote.

@u-fischer
Copy link
Author

Yes test typesetting is also a problem and I'm already pondering about it too. One probably will have to unify the amsmath if@measuring and other "trial" booleans. Then tagging could simply pause in such contexts.

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

2 participants