AndyClifton / accessibility

A CTAN-compliant version of the LaTeX `accessibility` package
39 stars 6 forks source link

amsart and itemize leads to infinite loop #17

Open teepeemm opened 5 years ago

teepeemm commented 5 years ago

In TeX Live 2017 on Windows 10, the following tex file

\documentclass{amsart}
\makeatletter
\providecommand{\@opargbegintheorem}{} % not defined in amsart?
\makeatother
\usepackage[tagged]{strucPDF}
\begin{document}
\begin{itemize}
\item some item
\end{itemize}
\end{document} % line 10

Leads to an infinite loop. The log file gets stuck repeating Package strucPDF Warning: empty \PopStack? on input line 10. infinitely often. It's ok with the article class.

AndyClifton commented 5 years ago

Thanks for reporting this. Could you try this:

  1. Removing the command definition at the start, and then
  2. Adding some text between the \begin{document} and \begin{itemize}

.... and then compile? Could you confirm you still see the same bug?

If you do, could you also try with a more complete article? I've seen problems with shorter articles for some reason that I don't understand.

teepeemm commented 5 years ago

If I remove the \providecommand, then I get ! LaTeX Error: \@opargbegintheorem undefined. at line 1176.

If I insert \lipsum before and/or after the itemize environment, I still get into an infinite loop of Package strucPDF Warning: empty \PopStack? on the \end{document} line.

If I insert \section{Section Title} between \begin{document} and \begin{itemize}, then it compiles without error.

Thanks for following up.

AndyClifton commented 5 years ago

Welllll it appears something isn't right.

But, I think if it compiles with a realistic document I'm inclined to mark this as a bug that won't be fixed deliberately.

Did you get chance to look at the PDF structure at all to see if the tags are correct?

teepeemm commented 5 years ago

Unfortunately, I don't have convenient access to Acrobat Pro (and don't know how to check the tags there anyway). The main reason tagging has come up for me is that my institution is starting to use http://ally.ac/ with its learning management system to rate the accessibility of documents, and Ally complains bitterly if a pdf isn't tagged.

I did run across this problem with a realistic document that had maketitle, a line of text, and then a four item list. But if including a section title gets it to compile, then that does seem good enough.