15

Okay, I'm having the following issue that resembles an issue other people have reported. But, I haven't seen any problem that is as simple as mine or any solution that's for my operating system. I am trying to use LuaLaTeX to compile the following document on Windows (I use Miktex to manage my LaTeX packages):

\documentclass[10]{article}
\usepackage{bbold}
\begin{document}
Inserting some words here. 
\[
   \mathbb{1}
\]
\end{document}

The error I'm receiving is the following:

This is LuaTeX, Version beta-0.80.0 (MiKTeX 2.9 64-bit) (rev 5238)  (format=lualatex 2016.1.5)  12 JAN 2016 14:47
 file:line:error style messages enabled.
**test.tex
(./test.tex
LaTeX2e <2015/10/01> patch level 2
Babel <3.9m> and hyphenation patterns for 69 languages loaded.
(C:/Miktex64/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(C:/Miktex64/tex/latex/base/size10.clo
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
) (C:/Miktex64/tex/latex/bbold/bbold.sty
Package: bbold 1994/04/06 Bbold symbol package
)

LaTeX Warning: Unused global option(s):
    [10].

(./test.aux)
\openout1 = test.aux

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 16.
LaTeX Font Info:    ... okay on input line 16.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 16.
LaTeX Font Info:    ... okay on input line 16.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 16.
LaTeX Font Info:    ... okay on input line 16.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 16.
LaTeX Font Info:    ... okay on input line 16.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 16.
LaTeX Font Info:    ... okay on input line 16.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 16.
LaTeX Font Info:    ... okay on input line 16.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <7> on input line 18.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <5> on input line 18.
LaTeX Font Info:    Try loading font information for U+bbold on input line 19.
 (C:/Miktex64/tex/latex/jknappen/ubbold.fd
File: ubbold.fd 1996/01/01 Blackboard Bold Font Definition File (jk)
)
./test.tex:19: Font \U/bbold/m/n/10=bbold10 at 10pt not loadable: metric data no
t found or bad.
<to be read again> 
relax 
l.19    \mathbb{R}

I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.

./test.tex:19: Font \U/bbold/m/n/7=bbold7 at 7pt not loadable: metric data not f
ound or bad.
<to be read again> 
relax 
l.19    \mathbb{R}

I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.

./test.tex:19: Font \U/bbold/m/n/5=bbold5 at 5pt not loadable: metric data not f
ound or bad.
<to be read again> 
relax 
l.19    \mathbb{R}

I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.

./test.tex:20: \textfont4 is undefined (character 82).
\]  ->\relax \ifmmode \ifinner \@badmath \else $$
                                                 \fi \else \@badmath \fi \ig...
l.20 \]

Somewhere in the math formula just ended, you used the
stated character from an undefined font family. For example,
plain TeX doesn't allow \it or \sl in subscripts. Proceed,
and I'll try to forget that I needed that character.

[1

{C:/Users/John Rinehart/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]
(./test.aux))

Here is how much of LuaTeX's memory you used:
 265 strings out of 494933
 100000,89155 words of node,token memory allocated
 264 words of node memory still in use:
    nodes
   avail lists: 2:12,3:4,4:29,5:1,6:32,7:1,9:7,10:2
 3973 multiletter control sequences out of 65536+200000
 25 fonts using 995431 bytes
 23i,4n,17p,127b,110s stack positions out of 5000i,500n,10000p,200000b,50000s
<<C:/Miktex64/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on test.pdf (1 page, 13591 bytes).

PDF statistics: 10 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 131072)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)
  • well tex can't find the font but do you have it it should be installed somewhere like C:/Miktex64/fonts/tfm/public/bbold/bbold10.tfm I would guess (I don't have miktex but that is the equivalent path in texlive) – David Carlisle Jan 12 '16 at 19:58
  • What would be the reason for Tex not being able to find the font? – fuzzybear3965 Jan 12 '16 at 20:17
  • MikTeX does not always update the map files correctly when it installs font packages. Then TeX cannot find things. – cfr Jan 12 '16 at 20:23
  • I have looked in C:/Miktex64/fonts/tfm/public/bbold/bbold10.tfm but it seems that I do not have the bbold subdirectory under public. But, I have found the bbold fonts installed to C:/Miktex64/fonts/source/public/bbold. Is there a way to "update the map files" so that tex can find the font? Thanks, @DavidCarlisle. – fuzzybear3965 Jan 12 '16 at 20:35
  • 1
    By the way, there is a warning you could awoid in your options, maybe just for this MWE. It should be 10pt and not 10. Look at your log LaTeX Warning: Unused global option(s): [10]. – sztruks Jan 12 '16 at 20:38
  • Thanks @sztruks, I didn't realize that that (errant) option had made its way into my minimum working example. I will note your suggestion for the future but I will elect not to edit my post in order to maintain a clear history for future readers. – fuzzybear3965 Jan 12 '16 at 20:54
  • What happens if you compile your example with pdflatex? (the map file is not relevant here, you are missing the tfm and normally miktex should create them from the source.) – Ulrike Fischer Jan 13 '16 at 08:18
  • @DavidCarlisle I now found time to try: lualatex doesn't trigger the tfm generation from a mf-source (it doesn't in texlive either, but there bbold10.tfm is in the main tree, miktex contains only the mf-sources). So one has to first call pdflatex to get the tfm and can then use them with lualatex. – Ulrike Fischer Jan 17 '16 at 13:22
  • 1
    @UlrikeFischer I guess that's an answer thanks. Although luatex could I suppose be configured to call maketextfm for missing tfms if we set up a suitable lua callback on the tfm font loader. – David Carlisle Jan 17 '16 at 14:10
  • @DavidCarlisle OK I will add my comment as answer so that it gets from the unanswered list ... – Ulrike Fischer Jan 17 '16 at 14:12
  • Thanks, @UlrikeFischer, for helping out. I seem to have neglected to follow up on this issue. I appreciate you taking the time to test this and provide a solution. – fuzzybear3965 Jan 08 '18 at 20:18
  • It should be precised that the issue is all the trickier to identify, that sometimes, there is just no error message at all. My question was closed but I do not delete it because it could help people to find the origin of the problem: https://tex.stackexchange.com/q/669396/262813. – Vincent Krebs Jan 29 '23 at 19:34
  • @UlrikeFischer What when you can't compile with pdftex because the font is loaded with fontspec? On my laptop I get "Font \TU/TimesNewRoman(0)/m/it/12=name:TimesNewRoman/I:mode=node;script=latn;language=dflt;+tlig; at 12pt not loadable: metric data not found or bad." but can't compile with pdftex. – Vincent Krebs Mar 06 '24 at 13:30
  • @VincentKrebs for fonts loaded with fontspec external tfm files are not needed and the question here doesn't apply. Your error means that the font is not found at all. – Ulrike Fischer Mar 06 '24 at 13:48
  • @UlrikeFischer The error is triggered by the tikz key "font=\footnotesize"; if i remove this, the error goes aways; so weird. – Vincent Krebs Mar 06 '24 at 14:04
  • @UlrikeFischer Believe me or not, it was package stmaryrd doing silently its harm again. Just compiled any blank doc with stmaryrd loaded and solved. Problem is the error messages gave no clue of that. – Vincent Krebs Mar 06 '24 at 14:27

2 Answers2

22

Unlike pdflatex lualatex doesn't trigger the tfm generation from a mf-source if it can't find the tfm (this is not miktex specific: it doesn't do it in texlive either, but there bbold10.tfm exist in the main tree while miktex installs only the mf-sources).

So in miktex one has to first call pdflatex which triggers the creation of the tfm and can then use them with lualatex.

Ulrike Fischer
  • 327,261
  • Finally a correct answer! Much better than all the incorrect references to tlmgr which don't work with MikTex and (mostly) are not applicable anyway. – Johan Jan 19 '19 at 14:23
  • I had this issue installing phaistos. – DLyons Jun 01 '19 at 10:11
  • 2
    Is there a way to generate all of the .tfm files at once? I have a tex document that only compiles under lualatex, not pdflatex (which has insufficient main memory for my pgfplots), so I can't just run pdflatex to generate the tfm. – Jason Gross Jun 30 '20 at 14:11
  • 1
    Ulrike is the goddess of LaTeX. – Vincent Krebs Dec 23 '22 at 23:43
  • Also see my post here https://tex.stackexchange.com/questions/669396/symbols-from-stmaryrd-not-working-any-more-no-error-message – Vincent Krebs Mar 04 '24 at 12:38
2

I ran into the same error message when trying to compile a larger document with lualatex. I had initially written this document for pdflatex, so I was still using \usepackage[T1]{fontenc} in my preamble.

Switching to fontspec, i.e. something like

\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Linux Libertine O}
\setsansfont[Mapping=tex-text]{Source Sans Pro}
\setmonofont[Mapping=tex-text]{DejaVu Sans Mono}

fixed the issue for me.