Skip to content

a11y - add support for tagpdf #13124

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

a11y - add support for tagpdf #13124

wants to merge 2 commits into from

Conversation

cscheid
Copy link
Collaborator

@cscheid cscheid commented Jul 24, 2025

This won't work until we pull Pandoc 3.7.0.2 as a binary dependency. But when we do, the test tests/docs/smoke-all/latex/tagpdf.qmd should pass.

@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Jul 24, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@cscheid
Copy link
Collaborator Author

cscheid commented Jul 24, 2025

We're still going to be missing math support: https://theaccessibilityguy.com/how-to-use-latex-for-accessible-math-in-pdfs/

Comment on lines +11 to +18
\DocumentMetadata{%
lang = en-us,
pdfversion = 2.0,
pdfstandard = ua-2,
tagging = on,
tagging-setup = {math/setup=mathml-SE}
}
\tagpdfsetup{activate, tabsorder=structure}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should be configurable for users who desire to configure the \DocumentMetadata. There are a few options with different values like lang or pdfstandard

Documented at https://mirrors.ctan.org/macros/latex/required/latex-lab/documentmetadata-support-code.pdf

I guess this is how Pandoc would add it in its template.

Otherwise, if we put it in its own partials (taggedpdf.tex for example), then this would be really easy for a user to pass its own version with modified options. Could be worth it if we are not sure yet what to expose as config

pdf:
  tagpdf:
    pdfstandard: ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like having a taggedpdf.tex partial.

@tarleb
Copy link
Collaborator

tarleb commented Jul 24, 2025

The docs suggest to use lualatex-dev to compile the document. Can we support that by setting pdf-engine?

@cderv
Copy link
Collaborator

cderv commented Jul 24, 2025

Yes it should, but is lualatex-dev ship with TeX Live ?

On my installation I don't see it

❯ ls C:\Users\chris\AppData\Roaming\TinyTeX\bin\windows\lua*

    Directory: C:\Users\chris\AppData\Roaming\TinyTeX\bin\windows

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          23/07/2025    17:19         215040 lua53w64.dll
-a---          23/07/2025    17:19        7132160 luahbtex.dll
-a---          23/07/2025    17:19           6656 luahbtex.exe
-a---          23/07/2025    17:19           6656 lualatex.exe
-a---          23/07/2025    17:19           6144 luaotfload-tool.exe
-a---          23/07/2025    17:19        6097408 luatex.dll
-a---          23/07/2025    17:19           6656 luatex.exe

@tarleb
Copy link
Collaborator

tarleb commented Jul 24, 2025

I found an old Dockerfile from last year that I had written to experiment with tagging. This is what I used:

FROM pandoc/latex
RUN tlmgr install \
        l3experimental \
        latex-base-dev \
        latex-bin-dev \
        pdfmanagement-testphase \
        tagpdf && \
    mv /opt/texlive/texdir/bin/default/lualatex \
        /opt/texlive/texdir/bin/default/lualatex-original && \
    ln -s /opt/texlive/texdir/bin/default/lualatex-dev \
          /opt/texlive/texdir/bin/default/lualatex

I think the linking was necessary because pandoc doesn't accept a program named lualatex-dev as the LaTeX compiler.

@cscheid
Copy link
Collaborator Author

cscheid commented Jul 24, 2025

For what's worth, I didn't need to call lualatex-dev in order for the document to be tagged. Locally for me at least, it worked with just lualatex.

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

Successfully merging this pull request may close these issues.

4 participants