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

Feature Request: Ability to Reorder Tags Independently of Content Order #732

Open
baskar-67 opened this issue Oct 15, 2024 · 1 comment
Open

Comments

@baskar-67
Copy link

Dear tagpdf Development Team,

I hope this message finds you well. I am writing to request a feature enhancement for the tagpdf package. Specifically, I would like to request the ability to reorder tags independently of the content order in the generated PDF.

Currently, the tagpdf package allows for the creation of tagged PDFs, which is incredibly useful for accessibility and document structuring. However, there are scenarios where the logical reading order of tags needs to differ from the visual content order. For example, in a document where the content order is (2, 1, 3), it would be beneficial to have the tags ordered as (1, 2, 3) without altering the actual content sequence.

This feature would greatly enhance the flexibility and usability of the tagpdf package, especially for complex documents that require precise control over tag ordering for accessibility purposes.

Thank you for considering this request. I appreciate all the hard work and dedication that goes into maintaining and improving the tagpdf package. I look forward to any updates or feedback you might have regarding this feature request.

\DocumentMetadata{testphase=phase-III}
\documentclass{article}
\usepackage{tagpdf}
\tagpdfsetup{activate-all,uncompress}
\begin{document}
\tagstructbegin{tag=P}
\tagmcbegin{tag=P}
First child: This is the first paragraph in the document.
\tagmcend
\tagstructend
\tagstructbegin{tag=P}
\tagmcbegin{tag=P}
Second child: This is the second paragraph in the document.
\tagmcend
\tagstructend
\tagstructbegin{tag=P}
\tagmcbegin{tag=P}
Third child: This is the third paragraph in the document.
\tagmcend
\tagstructend
\end{document}
Best regards,
Baskaran NK

@u-fischer
Copy link
Member

your code doesn't produce a valid tagged PDF. It clashes with the automatic tagging of paragraphs and you should see lots of warnings in the log, e.g.

Package tagpdf Warning: Parent-Child 'P/' --> 'text-unit/user'.
(tagpdf)                Relation is not allowed (struct 5, /P --> struct 6) on
(tagpdf)                line 16

Apart from this: there are already various options to move structure around. E.g. we use them to put captions at the begin of float structures.

\DocumentMetadata{uncompress,testphase=phase-III,pdfversion=2.0}
\documentclass{article}
\begin{document}

\tagstructbegin{tag=Div,stash,label=first}
First child: This is the first paragraph in the document.
\tagstructend

Second child: This is the second paragraph in the document.

\tagstructbegin{tag=Title,firstkid}
Title
\tagstructend

Third child: This is the third paragraph in the document.

\tagstructuse{first}
\end{document}

gives

image

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

No branches or pull requests

3 participants