latex3 / tagpdf

Tagging support code for LaTeX
59 stars 7 forks source link

It should be "heuristica", not "Heuristica" #59

Closed jfine2358 closed 1 year ago

jfine2358 commented 1 year ago

On Linux, which has case sensitive file names, "heuristica" works but "Heuristica" does not.

u-fischer commented 1 year ago

That is a font name, not a file name. The document is used with lualatex and luaotfload is case insensitive if font names are used. I also asked a linux user for confirmation and they said there is no problem.

zauguin commented 1 year ago

As @u-fischer said it doesn't matter since the name is case insensitive, but at least the font version included in TeX Live also uses the name "Heuristica" internally (and is stored in files starting with Heuristica-). Therefore if the lookup would be case sensitive then Heuristica would still work while heuristica would break.

jfine2358 commented 1 year ago

I'm running a very recent network install of TeX Live 2022, using Ubuntu 22.04 running in a podman container. The compilation below fails. It uses xelatex. It may be that there's a fault elsewhere. However the compilation below succeeds after I lowercase "Heuristica" (as in my pull request).

jfine@ub2204:~/tagpdf-explore/tagpdf/doc$ git status .
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

jfine@ub2204:~/tagpdf-explore/tagpdf/doc$ xelatex --interaction=batchmode tagpdf.tex 
This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex)

[snip]
kpathsea: Running mktextfm Heuristica
/usr/local/texlive/2022/texmf-dist/web2c/mktexnam: Could not map source abbreviation H for Heuristica.
/usr/local/texlive/2022/texmf-dist/web2c/mktexnam: Need to update /usr/local/texlive/2022/texmf-dist/fonts/map/fontname/special.map?

[snip]

^C! Interruption.
\__fontspec_primitive_font_set:NnnF ... #1{#2}{#3}
                                                  \__fontspec_primitive_font...
l.17 \usepackage
                [nopatch]{microtype}
? x

jfine@ub2204:~/tagpdf-explore/tagpdf/doc$ grep -i Heuristica tagpdf.log 
! Package fontspec Error: The font "Heuristica" cannot be found.
Package fontspec Info: Could not resolve font "Heuristica/BI" (it probably
Package fontspec Info: Could not resolve font "Heuristica/B" (it probably
Package fontspec Info: Could not resolve font "Heuristica/I" (it probably
! Package fontspec Error: The font "Heuristica" cannot be found.
u-fischer commented 1 year ago

The compilation below fails. It uses xelatex.

As you can guess from the comments (or by looking into the build.lua) the documentation should be typeset with lualatex. With xelatex it is not possible to insert real space chars, the engine is therefore not really suitable if you want to create a tagged pdf.

jfine2358 commented 1 year ago

The first mention of xelatex is on line 188 of tagpdf.tex. In particular, niether lua nor xelatex is not mentioned in the preamble of tagpdf.tex.

I've just run lualatex tagpdf.tex successfully on Ubuntu 22.04, with both 'Heuristica' and 'heuristica'. If my assumption about Windows is correct we now know

The above, if correct, would mean that the behaviour of xelatex is not consistent across platforms, when Heuristica is used. By the way, both of 'Heuristica' and 'heuristica' give

jfine@ub2204:~/tagpdf-explore/tagpdf/doc$ pdflatex tagpdf.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
[snip]
! Package unicode-math Error: Cannot be run with pdftex!
(unicode-math)                Use XeLaTeX or LuaLaTeX instead.

l.40 ...ror:nn {unicode-math} {unsupported-engine}

I followed this advice and ran $ xelatex tagpdf.tex. This led me to discover the behaviour that prompted this pull request.

u-fischer commented 1 year ago

package documentations often have special requirements and workflows and sometimes even can be compiled only on some systems. You should check the relevant makefiles or build.lua files if you want to reprocess a documentation.