latex3 / tagging-project

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

epic package incompatibility #159

Open mbertucci47 opened 1 month ago

mbertucci47 commented 1 month ago

The epic package is not compatible with the tagging code and lualatex (it works with pdflatex). The following example

\DocumentMetadata
  {
    lang=en-US,
    pdfversion=2.0,
    pdfstandard=ua-2,
    testphase={phase-III,math,title,table,firstaid}
  }
\documentclass{article}
\usepackage{epic}

\begin{document}

\setlength{\unitlength}{1mm}
\begin{picture}(155,35)
\thicklines
\matrixput(0,0)(10,0){6}(0,10){3}{\circle{4}}
\matrixput(2,0)(10,0){5}(0,10){3}{\line(1,0){6}}
\matrixput(0,2)(10,0){6}(0,10){2}{\line(0,1){6}}
\end{picture}

\end{document}

errors with

c:/texlive/2024/texmf-dist/tex/latex/tagpdf/tagpdf.lua:496: attempt to index a
nil value (global 't')
stack traceback:
        c:/texlive/2024/texmf-dist/tex/latex/tagpdf/tagpdf.lua:496: in upvalue '__tag_
font_has_space'
        c:/texlive/2024/texmf-dist/tex/latex/tagpdf/tagpdf.lua:526: in upvalue '__tag_
space_chars_shipout'
        c:/texlive/2024/texmf-dist/tex/latex/tagpdf/tagpdf.lua:512: in upvalue '__tag_
space_chars_shipout'
        c:/texlive/2024/texmf-dist/tex/latex/tagpdf/tagpdf.lua:512: in upvalue '__tag_
space_chars_shipout'
        c:/texlive/2024/texmf-dist/tex/latex/tagpdf/tagpdf.lua:512: in upvalue '__tag_
space_chars_shipout'
        c:/texlive/2024/texmf-dist/tex/latex/tagpdf/tagpdf.lua:512: in upvalue '__tag_
space_chars_shipout'
        c:/texlive/2024/texmf-dist/tex/latex/tagpdf/tagpdf.lua:512: in upvalue '__tag_
space_chars_shipout'
        c:/texlive/2024/texmf-dist/tex/latex/tagpdf/tagpdf.lua:512: in upvalue '__tag_
space_chars_shipout'
        c:/texlive/2024/texmf-dist/tex/latex/tagpdf/tagpdf.lua:512: in upvalue '__tag_
space_chars_shipout'
        c:/texlive/2024/texmf-dist/tex/latex/tagpdf/tagpdf.lua:514: in upvalue '__tag_
space_chars_shipout'
        c:/texlive/2024/texmf-dist/tex/latex/tagpdf/tagpdf.lua:514: in upvalue '__tag_
space_chars_shipout'
        c:/texlive/2024/texmf-dist/tex/latex/tagpdf/tagpdf.lua:541: in field 'space_ch
ars_shipout'
        [\directlua]:1: in field 'func'
        c:/texlive/2024/texmf-dist/tex/latex/base/ltluatex.lua:465: in function <c:/te
xlive/2024/texmf-dist/tex/latex/base/ltluatex.lua:462>
        (...tail calls...)
        [\directlua]:1: in function <[\directlua]:1>.
<argument> ...}\hook_use:n {shipout}\__shipout_finalize_box:
                                                  \cs_set_eq:NN \protect \ex...

l.22 \end{document}

?
davidcarlisle commented 1 month ago

it works if tagpdf.lua has

local function __tag_font_has_space (fontid)
 t= fonts.hashes.identifiers[fontid]
 if luaotfload.aux.slot_of_name(fontid,"space")
    or t and t.characters and t.characters[32] and t.characters[32]["unicode"]==32
 then
    return true
 else
    return false
 end
end

ie add t and but I'm not sure if that's the right fix, @u-fischer ?