usepackage loads .sty file from texmf-dist instead of texmfhome
Yann Salmon
contact at yannsalmon.fr
Mon Aug 26 14:17:34 CEST 2024
Hello,
I am forwarding here my question about the behaviour of lualatex from
texlive 2024 (see <https://tex.stackexchange.com/questions/725139>).
I have a custom piton.sty in my texmfhome, and kpsewhich sees it :
$ kpsewhich -a piton.sty
/home/yann/texmf/tex/latex/chato/piton.sty
/opt/yann/texlive/texmf-dist/tex/lualatex/piton/piton.sty
However \usepackage{piton} loads the file from texmf-dist (when run with
lualatex).
This does not happen with other packages, eg. tabularray (file gets
loaded from texmfhome if present). Of course if I rename the file, eg.
piton2.sty, \usepackage{piton2} gets it from texmfhome.
tlmgr conf says
=========================== kpathsea variables ===========================
ENCFONTS=.:{{}/home/yann/.texlive2024/texmf-config,/home/yann/.texlive2024/texmf-var,/home/yann/texmf,!!/opt/yann/texlive/texmf-local,!!/opt/yann/texlive/texmf-config,!!/opt/yann/texlive/texmf-var,!!/opt/yann/texlive/texmf-dist}/fonts/enc//
SYSTEXMF=/opt/yann/texlive/texmf-var:/opt/yann/texlive/texmf-local:/opt/yann/texlive/texmf-dist
TEXCONFIG={{}/home/yann/.texlive2024/texmf-config,/home/yann/.texlive2024/texmf-var,/home/yann/texmf,!!/opt/yann/texlive/texmf-local,!!/opt/yann/texlive/texmf-config,!!/opt/yann/texlive/texmf-var,!!/opt/yann/texlive/texmf-dist}/dvips//
TEXFONTMAPS=.:{{}/home/yann/.texlive2024/texmf-config,/home/yann/.texlive2024/texmf-var,/home/yann/texmf,!!/opt/yann/texlive/texmf-local,!!/opt/yann/texlive/texmf-config,!!/opt/yann/texlive/texmf-var,!!/opt/yann/texlive/texmf-dist}/fonts/map/{kpsewhich,pdftex,dvips,}//
TEXMF={{}/home/yann/.texlive2024/texmf-config,/home/yann/.texlive2024/texmf-var,/home/yann/texmf,!!/opt/yann/texlive/texmf-local,!!/opt/yann/texlive/texmf-config,!!/opt/yann/texlive/texmf-var,!!/opt/yann/texlive/texmf-dist}
TEXMFCONFIG=/home/yann/.texlive2024/texmf-config
TEXMFDBS={!!/opt/yann/texlive/texmf-local,!!/opt/yann/texlive/texmf-config,!!/opt/yann/texlive/texmf-var,!!/opt/yann/texlive/texmf-dist}
TEXMFDIST=/opt/yann/texlive/texmf-dist
TEXMFHOME=/home/yann/texmf
TEXMFLOCAL=/opt/yann/texlive/texmf-local
TEXMFMAIN=/opt/yann/texlive/texmf-dist
TEXMFSYSCONFIG=/opt/yann/texlive/texmf-config
TEXMFSYSVAR=/opt/yann/texlive/texmf-var
TEXMFVAR=/home/yann/.texlive2024/texmf-var
TEXPSHEADERS=.:{{}/home/yann/.texlive2024/texmf-config,/home/yann/.texlive2024/texmf-var,/home/yann/texmf,!!/opt/yann/texlive/texmf-local,!!/opt/yann/texlive/texmf-config,!!/opt/yann/texlive/texmf-var,!!/opt/yann/texlive/texmf-dist}/{dvips,fonts/{enc,type1,type42,type3}}//
VARTEXFONTS=/home/yann/.texlive2024/texmf-var/fonts
WEB2C={{}/home/yann/.texlive2024/texmf-config,/home/yann/.texlive2024/texmf-var,/home/yann/texmf,!!/opt/yann/texlive/texmf-local,!!/opt/yann/texlive/texmf-config,!!/opt/yann/texlive/texmf-var,!!/opt/yann/texlive/texmf-dist}/web2c
==== kpathsea variables from environment only (ok if no output here) ====
and kpsewhich --var-value TEXINPUTS says
.:{{}/home/yann/.texlive2024/texmf-config,/home/yann/.texlive2024/texmf-var,/home/yann/texmf,!!/opt/yann/texlive/texmf-local,!!/opt/yann/texlive/texmf-config,!!/opt/yann/texlive/texmf-var,!!/opt/yann/texlive/texmf-dist}/tex/{kpsewhich,generic,latex,}//
Note that the same discrepancy happens with lua's require : despite what
the documentation claims in section 4.2.2, require("piton") will load
piton.lua from /opt/yann/texlive/texmf-dist/tex/lualatex/piton/piton.lua
even though kpsewhich finds /home/yann/texmf/tex/latex/chato/piton.lua.
While there is an easy workaround (renaming the files), this behaviour
is still bizarre. Has anyone a clue ?
--
Cordialement,
Yann Salmon
More information about the tex-live
mailing list.