latex3 / tagging-project

Issues related to the tagging project
https://latex3.github.io/tagging-project/
LaTeX Project Public License v1.3c
23 stars 5 forks source link

mdframed does not work with tagging #73

Open IanThompson3 opened 2 months ago

IanThompson3 commented 2 months ago

I don't know if this is really a bug (as I don't know which packages are supported at present). Anyway, this produces an error.

\DocumentMetadata{testphase={phase-III}}
\documentclass{article}
\usepackage{mdframed}
\begin{document}
\begin{mdframed}
ABC
\end{mdframed}
\end{document}

The log file is below.

test.log

FrankMittelbach commented 2 months ago

mdframed is not supported and I'm not sure it will. Your log shows that it is low-level patching list environment, which of course fail badly if they have quite a different implementation in LaTeX (with tagging) and also at some point in LaTeX without tagging.

As far as I can tell the package is for a long time not maintained and it does have a number of problematical bugs. My recommendation is to go to, say, tcolorbox instead (but just to avoid a misunderstanding that package is not yet supported either, but most likely will eventually).

IanThompson3 commented 2 months ago

Thanks @FrankMittelbach . I think mdframed was cutting edge when I wrote the original code! Is there a list of supported packages somewhere?

FrankMittelbach commented 2 months ago

yes it probably was, back in the days.

Concerning your question about supported packages (for tagging), no there is no such list as such and in fact we don't know in many cases. Depending on the package code some will be working with tagging without any adjustments necessary, others may have to be moved to use new interfaces (rather than doing their own low-level patching, still others may need explicit tagging support because the define new structures that tagging has to learn about it.

Best place to get a grip on this (at the moment) is the special repo we have for this, which is https://github.com/latex3/tagging-project in case you don't know that. In the issue list there we keep track of which packages currently fail (through reports from users) and other topics of general interest with respect to tagging as a whole --- tagpdf is really only a part of the whole story.

Making a list of already working packages (and classes) -- and maintaining it -- would certainly be a big help, but we need help for that, i.e., somebody who would be willing to maintain such a list, because right now we don't have the bandwidth for it.

By the way, I'm going to move this issue over to that repo, because it fits better there.

u-fischer commented 2 months ago

I get a different error and your log shows that you are not using the newest tagpdf. Generally I would recommend to keep your system up-to-date if you want to use tagging. And also use lualatex-dev instead of lualatex.

But as Frank said it is quite improbable that mdframed will be support.

If you want to try tcolorbox you could start with something like the following. It is not fully correct (there is an empty text structure at the end), but it isn't wrong:

\DocumentMetadata{testphase={phase-III}}
\documentclass{article}

\usepackage{tcolorbox}
\AddToHook{env/tcolorbox/before}{\par\tagstructbegin{tag=Div}}
\AddToHook{env/tcolorbox/begin}{\tagpdfparaOff \tcbset{before upper=\tagpdfparaOn}}
\AddToHook{env/tcolorbox/after}{\par\tagstructend}

\begin{document}
\begin{tcolorbox}
ABC
\end{tcolorbox}
\end{document}
IanThompson3 commented 2 months ago

Thanks for your help @u-fischer .

@FrankMittelbach --- I'd be willing to help with the list of packages, but I suspect I'm not qualified for the task! I can hack together a decent document, but I'm nowhere near 'developer level'. I know nothing about the internal structure of pdf files and nothing about expl3. I wouldn't know what to look for in identifying a feature that might cause trouble.

u-fischer commented 2 months ago

I'd be willing to help with the list of packages, but I suspect I'm not qualified for the task!

Well you are able to produce a nice MWE and to read a log ;-) And as you are trying tagging I assume that you have some tools to check tags or to validate the PDF. So when you see some problem, report it like this one. We could also start a discussion where one could add package names and link to relevant issues.

FrankMittelbach commented 2 months ago

I would not worry about that. What is needed does not require programming. What would helpful is

As to where to maintain the status list, my suggestion would be to open a suitable discussion topic and maintain it by updating the list there.

I'm currently at an airport waiting for my flight to be called so will be out of communication soon.

FrankMittelbach commented 2 months ago

Just saw Ulrike said essentially the same with less words 😃

IanThompson3 commented 2 months ago

@u-fischer --- I'm good at writing MWEs because I have been breaking things for a long time! The virtual learning environment that we use at the University of Liverpool (Canvas) checks pdfs for accessibility. Mine are all flagged as low, so I decided to look in to the matter a few days ago.

@u-fischer @FrankMittelbach --- I'll start a list based on what I've read and issues I find here. I'm new to github, so I'll do it as a LaTeX document for now. I'll post it under a new discussion when I can...

FrankMittelbach commented 2 months ago

I would not use a LaTeX document in this case, but instead a simple markdown document that is directly understood by GitHub. Reason: this is much easier to update if several people are involved.

FrankMittelbach commented 2 weeks ago

@u-fischer @FrankMittelbach --- I'll start a list based on what I've read and issues I find here. I'm new to github, so I'll do it as a LaTeX document for now. I'll post it under a new discussion when I can...

Hi @IanThompson3 . I don't know if you had the time to actually start on that list but in any case I do think it would be good to have one, so I would go after it myself during the next days (either with anyhting you already started with or on my own). So if you started but don't have time to get further with it I would be grateful to get anything you did, just send it to my email account frank.mittelbach@latex-project.orgor if not please isgnal me that I should start from zero. Thanks

IanThompson3 commented 2 weeks ago

Hi @FrankMittelbach . Apologies for the prolonged 'radio silence'. I made a small start and was then hit with an avalanche of work. I'm back on top of things now (very famous last words). I'll get back to it over the weekend and then post what I have.