I'm trying to use an otf file that is in the TEXMF tree, but another file with the same name is used instead.
I run lualatex from a locally installed TexLive 2019 on this file:
\documentclass{article}
\usepackage{fontspec}
\setmainfont [
ItalicFont = LinLibertine_RI.otf,
BoldFont = LinLibertine_RB.otf,
]{LinLibertine_R.otf}
\begin{document}
foo
\end{document}
and get the output
This is LuaTeX, Version 1.10.0 (TeX Live 2019)
restricted system commands enabled.
(./whichfont.tex
LaTeX2e <2018-12-01>
luaotfload | main : initialization completed in 0.076 seconds
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2019/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/l3pdfmode.def)))
(/usr/local/texlive/2019/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/tuenc.def))
(/usr/local/texlive/2019/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
No file whichfont.aux.
[1{/usr/local/texlive/2019/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./whichfont.aux))
410 words of node memory still in use:
3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 5 attribute, 48 glue_spec
, 5 attribute_list, 1 write nodes
avail lists: 2:15,3:4,4:1,5:22,6:1,7:16,9:7
</usr/share/texlive/texmf-dist/fonts/opentype/public/libertine/LinLibertine_R.o
tf>
Output written on whichfont.pdf (1 page, 2910 bytes).
Transcript written on whichfont.log.
As you can see files that are part of the Texlive 2019 installation are used, except that the file LinLibertine_R.otf
is from another location. I would like to instead use the version that is in /usr/local/texlive/2019/texmf-dist/fonts/opentype/public/libertine
(or rather the version that is in the TEXMF tree I use when TeXing the file).
I though this would do it:
$ luaotfload-tool --cache=erase
$ luaotfload-tool --update --prefer-texmf
but even after repeating lualatex after those commands it uses the same otf file. What can I do? (A kpsewhich LinLibertine_R.otf
finds /usr/local/texlive/2019/texmf-dist/fonts/opentype/public/libertine/LinLibertine_R.otf
as expected.)
I thought a workaround could be to use an explicit path, but actually, when adding
Path = /usr/local/texlive/2019/texmf-dist/fonts/opentype/public/libertine/
it still chooses the other file! (It matters what path I write though, because it complains it can't find the file if I give another directory!)
texlive
in an own directory and also atexlive
with the package manager of your Linux distribution. You should delete the files installed by the package manager.Path
option in the\setmainfont
directive help?texmf-dist/fonts/opentype/public/libertine/LinLibertine_R.otf
shows that the fonts used are from the texlive texmf tree.