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

warning mentions Em/pdf2 even though pdfversion is set at 1.7 #93

Open
jfbu opened this issue Jan 7, 2024 · 2 comments
Open

warning mentions Em/pdf2 even though pdfversion is set at 1.7 #93

jfbu opened this issue Jan 7, 2024 · 2 comments

Comments

@jfbu
Copy link

jfbu commented Jan 7, 2024

Artificial document (deliberately attempting illegal nesting)

\DocumentMetadata{
 uncompress,
 pdfversion=1.7,
 lang=en-US,
 testphase=phase-III
}
\documentclass{article}

\begin{document}

\emph{hallo!\ShowTagging{struct-stack}}

\ExplSyntaxOn
\__tag_toc_starttoc_init:n{toc}
\__tag_toc_contentsline_begin:nnn{section}{dummy}{dummydest}
\ShowTagging{struct-stack}\emph{dummy section}\par
\__tag_toc_contentsline_end:n{section}{dummy}{dummydest}
\__tag_toc_starttoc_finalize:
\ExplSyntaxOff
\end{document}

generates on first pdflatex run:

Package tagpdf Warning: Parent-Child 'TOCI/' --> 'Em/pdf2'.
(tagpdf)                Relation is not allowed (struct 5, /TOCI --> struct 6)
(tagpdf)                on line 16

but the pdfversion is 1.7. Does this mean that Em/pdf2 is used internally (I see also /Em in the pdf if using 2.0 so not saying at all here perhaps mark-up not pdf 1.7 one, clearly that can't be the case), or is this artifact (sic) from warning process?

I have not yet assimilated docs.

@u-fischer
Copy link
Member

Em can also be used with pdfversion 1.7, there it is role mapped to Span which isn't allowed directly inside TOCI. So the warning is correct only a bit unclear if you don't know the inner working. (It is a bit of a struggle to get in the relevant info without getting too verbose, and quite probably the messages will continue to change based on feed back and experience). If you increase the log-level things gets a bit clearer:

\DocumentMetadata{pdfversion=1.7,testphase={phase-III},debug={log=v}}
\documentclass{article}
\begin{document}
\tagstructbegin{tag=TOCI}\tagstructbegin{tag=Em}\tagstructend\tagstructend

blub
\end{document}

this then gives:

Package tagpdf Info: Parent-Child 'TOCI' --> 'Span'.
(tagpdf)             Relation is -1 (='∅')
(tagpdf)             Rolemapped from: 'TOCI' --> 'Em' on line 106

Package tagpdf Warning: Parent-Child 'TOCI/' --> 'Em/pdf2'.
(tagpdf)                Relation is not allowed (struct 4, /TOCI --> struct 5)
(tagpdf)                on line 106

With pdf 2.0 this would change to:

Package tagpdf Info: Parent-Child 'TOCI' --> 'Em'.
(tagpdf)             Relation is -1 (='∅')
(tagpdf)             Rolemapped from 'TOCI/pdf' --> 'Em/pdf2' on line 106


Package tagpdf Warning: Parent-Child 'TOCI/pdf' --> 'Em/pdf2'.
(tagpdf)                Relation is not allowed (struct 4, /TOCI --> struct 5)
(tagpdf)                on line 106

@jfbu
Copy link
Author

jfbu commented Jan 7, 2024

I had not tested the increased verbosity. Would you consider adding an option to treat warnings as errors? I added this manually in my test files, was happy to find quickly how to from l3msg.pdf:

\ExplSyntaxOn
 \msg_redirect_module:nnn { tag } { warning } { error }
\ExplSyntaxOff

It works!

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