alexpovel / latex-cookbook

A comprehensive LaTeX template with examples for theses, books and more, employing the 'latest and greatest' (UTF8, glossaries, fonts, ...). The PDF artifact is built using CI/CD, with a Python testing framework.
MIT License
223 stars 20 forks source link

longtblr numbering incorrect in listoftables #7

Closed alexpovel closed 2 years ago

alexpovel commented 2 years ago

Original issue (2021-10-26): https://collaborating.tuhh.de/alex/latex-cookbook/-/issues/14

See this upstream issue of the tabularray package. This is currently bugged here as well. The author has not upstreamed their fix into a new package release yet, so simply updating (that is, rebuilding the Docker image) TeXLive won't do.

A manual patch is:

# use existing, not yet updated base image
FROM alexpovel/latex

# `root` or `0`
USER root

# Apply this patch manually until upstream fix is published on TexLive:
# https://github.com/lvjr/tabularray/commit/8782222cd6586dd46ae63a8f41d1523fb8ac2081
# The initial `grep` will eventually fail the build, hence notifying us once the upstream is patched
# and the monkey patch here can be removed.
RUN grep '{ \\protect\\numberline { \\arabic { table } } { \\l__tblr_caption_short_tl } }' $(kpsewhich tabularray.sty) && \
        sed --in-place 's/arabic { table }/thetable/' $(kpsewhich tabularray.sty)

# back to regular user
USER tex

I would like to introduce that (at the proper position so USER switching isn't needed) into the existing Dockerfile.

However, rebuilding the image right now seems to have changed something about siunitx and/or glossaries-extra. It errors out:

Package glossaries-extra Warning: Glossary entry `sym.moisture_content' has not
 been defined on input line 1164.

! LaTeX Error: \symupallowed only in math mode.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.1164     }

? 

Therefore, the above patch isn't upstreamed into alexpovel/latex yet. I'm working on it, but it's hard to debug so far.

alexpovel commented 2 years ago

See also here.

alexpovel commented 2 years ago

This is now (2021-12-15) fixed through an updated (just ran build to fetch latest TeXLive packages) Docker image.