GeneralLuaLaTeX fails to process simple file

LaTeX specific issues not fitting into one of the other forums of this category.
Haines
Posts: 13
Joined: Sun Sep 16, 2018 5:04 pm

LuaLaTeX fails to process simple file

Post by Haines »

I newly installed Debian and TeXLive. I also used ELPA to install AUXTeX.

I have a small test file

Code: Select all

\documentclass{article}
\usepackage{polyglossia}
\begin{document}
\end{document}
I get the error:
ERROR: Font \TU/lmr/m/n/10=[lmroman10-regular]:+tlig; at 10pt not loadable: metric data not found or bad.

--- TeX said ---
<to be read again>
relax
l.112 ...lt\familydefault\seriesdefault\shapedefault

--- HELP ---
You requested a family/series/shape/size combination that is totally unknown

I get same error with this file:

Code: Select all

\documentclass{article}
\usepackage{fontspec}
\begin{document}
\end{document}
The command $ fc-list shows that the font is present.

Code: Select all

$ fc-list | grep lmroman10-regular
/usr/share/texmf/fonts/opentype/public/lm/lmroman10-regular.otf: Latin Modern Roman,LM Roman 10:style=10 Regular,Regular

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: LuaLaTeX fails to process simple file

Post by Stefan Kottwitz »

I would install the texlive-luatex package:

sudo apt-get install texlive-luatex

or, if you don't need to use sudo,

apt-get install texlive-luatex

If you installed TeX Live not from Debian repositories but from tug.org, then use

sudo tlmgr install luaotfload
luaotfload-tool --update


Stefan
LaTeX.org admin
Haines
Posts: 13
Joined: Sun Sep 16, 2018 5:04 pm

Re: LuaLaTeX fails to process simple file

Post by Haines »

Stefan, your suggestion appreciated, but did not have much luck with it.

# tlmgr install texlive-luatex
(running on Debian, switching to user mode!)
(see /usr/share/doc/texlive-base/README.tlmgr-on-Debian.md)
TLPDB: not a directory, not loading: /root/texmf
tlmgr: user mode not initialized, please read the documentation!

I installed the CTAN TeXLive as user and so tried the command as user, but with same result.

I took a look at the README, and it says tlmgr cannot be used on Debian because it automatically switches to user mode. If you want the full power of TeX Live Manager, we recommend installing TeX Live from upstream https://tug.org/texlive/quickinstall.html. But the installer it points is the CTAN installer I used. I don't understand. Is there a TeXLive installer different from the CTAN installer?

It also says: See also "Integrating vanilla TeX Live with Debian" here https://tug.org/texlive/debian.html. But those are the instructions I used.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: LuaLaTeX fails to process simple file

Post by Stefan Kottwitz »

Haines wrote: Thu Dec 26, 2024 3:42 pmI installed the CTAN TeXLive as user
It should be installed with the root account (or sudo).
Haines wrote: Thu Dec 26, 2024 3:42 pmIs there a TeXLive installer different from the CTAN installer?
It's the same; TeX Live uses CTAN as a repository and mirror.

Perhaps try the commands with sudo:

sudo tlmgr install luaotfload
sudo luaotfload-tool --update


Stefan
LaTeX.org admin
Haines
Posts: 13
Joined: Sun Sep 16, 2018 5:04 pm

Re: LuaLaTeX fails to process simple file

Post by Haines »

Debian wiki recommended installing as user and so I did so

# tlmgr install luaotfload
(running on Debian, switching to user mode!)
(see /usr/share/doc/texlive-base/README.tlmgr-on-Debian.md)
TLPDB: not a directory, not loading: /root/texmf
tlmgr: user mode not initialized, please read the documentation!

Since I installed as user I run as user

$ tlmgr install luaotfload
(running on Debian, switching to user mode!)
(see /usr/share/doc/texlive-base/README.tlmgr-on-Debian.md)
TLPDB: not a directory, not loading: /home/haines/texmf
tlmgr: user mode not initialized, please read the documentation!

$ sudo luaotfload-tool --update
bash: luaotfload-tool: command not found

ELPA does not list it. I see lua-mode, but it does not look like something I need. In LuaLaTeX it is supposed to be loaded by default.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: LuaLaTeX fails to process simple file

Post by Stefan Kottwitz »

https://wiki.debian.org/TeXLive says:
Integrating vanilla TeX Live with Debian

To install vanilla TeX Live so that it replaces the Debian packages, perform the following steps:
Install vanilla TeX Live as root, system-wide.
...
If it's your PC and there are no other users, I don't see a reason to not install it as root, to not run into a permission issue.

I cannot tell you much more, as I always install it as root, so I don't have user restrictions, such as the user-running stuff is not permitted to change the system environment.

Stefan
LaTeX.org admin
Haines
Posts: 13
Joined: Sun Sep 16, 2018 5:04 pm

Re: LuaLaTeX fails to process simple file

Post by Haines »

Stefan, you have been very patient. I suspect I made a misstep in my installation and so will how reinstall. In the past, installation instructions said that if you are installing over a broken installation, you should remove files such as /usr/local/texlive/2024 and ~/.texlive2024. But that instruction seems now gone. is it no longer necessary?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: LuaLaTeX fails to process simple file

Post by Stefan Kottwitz »

When the same version is installed, it overwrites the old files, so that can be ok. I would delete the old folders though, to ensure that nothing from the old installation remains, such as generated files like the ls-R files and old config settings.

Stefan
LaTeX.org admin
Haines
Posts: 13
Joined: Sun Sep 16, 2018 5:04 pm

Re: LuaLaTeX fails to process simple file

Post by Haines »

An important piece of information If failed to include is that neither the pdflatex nor the lualatex command
produce the error when run on this primitive file:

Code: Select all

\documentclass{article}
\begin{document}
test 
\end{document}


But when I add the use of the polyglossia or fontspec package I get this error:

Code: Select all

(	/fontenc.sty
! Font \TU/lmr/m/n/10=[lmroman10-regular]:+tlig; at 10pt not loadable: metric d
ata not found or bad.
<to be read again>
relax
l.112 ...lt\familydefault\seriesdefault\shapedefault
The lualatex run on this code command returns the error:
...
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
! Font \TU/lmr/m/n/10=[lmroman10-regular]:+tlig; at 10pt not loadable: metric
data not found or bad.
<to be read again>
relax
l.112 ...lt\familydefault\seriesdefault\shapedefault
Lines 11 and 12 in that sty filie are

Code: Select all

\ProcessOptions*
\usefont\encodingdefault\familydefault\seriesdefault\shapedefault
The drefai;t font is computer modern. Surely 10 regular is accessible. How can
its metric data be bad or missing? How would I to about to reinstall that font?
Haines
Posts: 13
Joined: Sun Sep 16, 2018 5:04 pm

Re: LuaLaTeX fails to process simple file

Post by Haines »

I need to elaborate my prior message. This .tex file:

Code: Select all

\documentclass{article}
\usepackage{libertine} 
\begin{document}
test
\end{document}
Produces the same error when compiled with lualatex as when \usepackage{fontspec| or \usepackage{polyglossia} is instead included. I get sense that my installation from TUG was somehow flawed (I installed as user to ~/texlive).

The log says
...
LaTeX2e <2022-11-01> patch level 1
[\directlua]:1: module 'luaotfload-main' not found:
no field package.preload['luaotfload-main']
[kpse lua searcher] file not found: 'luaotfload-main'
Error in luaotfload: reverting to OT1 L3 programming layer <2023-01-16>
I tried to use tlmgr to install luaotfload. This I gather this brings in luaotfload-main and can fix the problem:

Code: Select all

        $ tlmgr install luaotfload
        (running on Debian, switching to user mode!)
        (see /usr/share/doc/texlive-base/README.tlmgr-on-Debian.md)
        TLPDB: not a directory, not loading: /root/texmf
        tlmgr: user mode not initialized, please read the documentation!
[\code]

But this was a mistake.   The document says that tlmgr interferes with apt and so automatically
switches to uses User Mode.  We strongly recommend **not** to user the TeX Live Manager user mode on
Debian. If you are using it despite the warnings, be prepared to fix your
own TeX system. It then says to run in user mode install from TUG.
Post Reply