Modular TexLive "Insufficient extension fonts" and duplicate fonts

  • Done
  • quality assurance status badge
Details
4 participants
  • elaexuotee
  • Jelle Licht
  • Ricardo Wurmus
  • zimoun
Owner
unassigned
Submitted by
Jelle Licht
Severity
normal
Merged with
J
J
Jelle Licht wrote on 11 Apr 2020 18:15
(address . bug-guix@gnu.org)
874ktqxalv.fsf@jlicht.xyz
I think I found a bug in our amsfonts texlive package. I will describe
my journey in finding this bug, as I still do not have clear picture
on the why/when/what is going on. I think I also saw several other
people running into this issue the last few months, so either way I am
happy to have found something reproducible that at least demonstrates
that I am sane :).

The eror message is:
" ! Math formula deleted: Insufficient extension fonts."

If you, like me, want to use Emacs' org-mode capabilities and export to
pdf using latex, by default you will generate an intermediate .tex file
that uses the ulem package. Using this package leads to the
aforementioned error message.

(Skip everything after this if you do not care about my descent into madness)

I used a profile containing the following (relevant) texlive packages:
Toggle snippet (23 lines)
texlive-base
texlive-latex-preview
texlive-latex-base
texlive-latexconfig
texlive-fonts-ec
texlive-latex-oberdiek
texlive-latex-wrapfig
texlive-generic-ulem
texlive-latex-capt-of
texlive-latex-hyperref
texlive-amsfonts
texlive-fontinst
texlive-metafont-base
texlive-unicode-data
texlive-pstool
texlive-cm
texlive-cm-super
texlive-latex-amscls
texlive-fonts-latex
texlive-latex-amsmath


I ran both `strace pdflatex working 2> working-strace.log' and `strace
pdflatex broken 2> broken-strace.log' See the attached `working.tex'
and `broken.tex' for tiny examples that demonstrate this.

The relevant part of the diff between straces:

* Working:
Toggle snippet (10 lines)
access("/home/jlicht/.guix-profile/share/texmf-dist/fonts/tfm/public/amsfonts/cmex7.tfm", R_OK) = 0
stat("/home/jlicht/.guix-profile/share/texmf-dist/fonts/tfm/public/amsfonts/cmex7.tfm", {st_mode=S_IFREG|0444, st_size=940, ...}) = 0
openat(AT_FDCWD, "/home/jlicht/.guix-profile/share/texmf-dist/fonts/tfm/public/amsfonts/cmex7.tfm", O_RDONLY) = 6
fstat(6, {st_mode=S_IFREG|0444, st_size=940, ...}) = 0
read(6, "\0\353\0\2\0\0\0\177\0#\0\6\0\16\0\3\0\0\0\0\0\34\0\r\27#\260\255\0p\0\0"..., 4096) = 940
close(6) = 0
openat(AT_FDCWD, "working.pdf", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 6
write(1, " [1", 3) = 3

* Broken:
Toggle snippet (10 lines)
access("/home/jlicht/.guix-profile/share/texmf-dist/fonts/tfm/public/amsfonts/euler/cmex7.tfm", R_OK) = 0
stat("/home/jlicht/.guix-profile/share/texmf-dist/fonts/tfm/public/amsfonts/euler/cmex7.tfm", {st_mode=S_IFREG|0444, st_size=1312, ...}) = 0
openat(AT_FDCWD, "/home/jlicht/.guix-profile/share/texmf-dist/fonts/tfm/public/amsfonts/euler/cmex7.tfm", O_RDONLY) = 6
fstat(6, {st_mode=S_IFREG|0444, st_size=1312, ...}) = 0
read(6, "\1H\0\21\0\0\0\332\0*\0\20\0\20\0\6\0\0\0\0\0\0\0\6d\235jM\0\240\0\0"..., 4096) = 1312
close(6) = 0
write(1, "\n", 1) = 1
write(1, "! Math formula deleted: Insuffic"..., 54) = 54

We see that a different file is used when resolving the same font!
Furthermore, one of these fonts is a totally different size than the
other.


If we run: `guix build --check texlive-amsfonts | grep cmex7', we see:
Toggle snippet (10 lines)
Font metrics written on /tmp/guix-build-texlive-amsfonts-49435.drv-0/source/build-fonts/cmex7.tfm.
Output written on /tmp/guix-build-texlive-amsfonts-49435.drv-0/source/build-fonts/cmex7.600gf (128 characters, 30684 bytes).
Transcript written on /tmp/guix-build-texlive-amsfonts-49435.drv-0/source/build-fonts/cmex7.log.
converting afm font cmex7
cmex7 CMEX7
`build-fonts/cmex7.600gf' -> `/gnu/store/hrxlw7s1d8q0z5kipizjr7ib49bw4hjp-texlive-amsfonts-49435/share/texmf-dist/fonts/tfm/public/amsfonts/cmex7.600gf'
`build-fonts/cmex7.tfm' -> `/gnu/store/hrxlw7s1d8q0z5kipizjr7ib49bw4hjp-texlive-amsfonts-49435/share/texmf-dist/fonts/tfm/public/amsfonts/cmex7.tfm'
`build-fonts/euler/cmex7.tfm' -> `/gnu/store/hrxlw7s1d8q0z5kipizjr7ib49bw4hjp-texlive-amsfonts-49435/share/texmf-dist/fonts/tfm/public/amsfonts/euler/cmex7.tfm'

AFAIK, and from looking at the full (and correctly working)
texlive-texmf build, the cmex7.tfm in `euler' is not correctly build.
My best guess is that this happens because cmex has both a mf file and a
afm file in `guix build --source texlive-amsfonts'. The one 'built'
using afm2tfm seems to be broken and/or not matching other metadata
generated, as given by this example.

Thanks for reading along, I hope we will find a solution to this, as
non-modular texlive is simply the worst :).
Attachment: working.tex
Attachment: broken.tex
- Jelle
J
J
Jelle Licht wrote on 20 Apr 2020 21:31
(address . 40558@debbugs.gnu.org)
87h7xenect.fsf@jlicht.xyz
Jelle Licht <jlicht@fsfe.org> writes:

Toggle quote (2 lines)
> The eror message is:
> " ! Math formula deleted: Insufficient extension fonts."
[snip]
Toggle quote (8 lines)
> AFAIK, and from looking at the full (and correctly working)
> texlive-texmf build, the cmex7.tfm in `euler' is not correctly build.
> My best guess is that this happens because cmex has both a mf file and a
> afm file in `guix build --source texlive-amsfonts'. The one 'built'
> using afm2tfm seems to be broken and/or not matching other metadata
> generated, as given by this example.


I have found a workaround for my immediate problem, but I'm not nearly
enough of a tex guru to foresee any issues my changes might cause.

After some trial and error that took longer than I'm willing to admit, I
have the following snippet:
Toggle snippet (15 lines)
diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index cd461314b5..363c7a318c 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -1108,7 +1108,7 @@ Taco Hoekwater.")
;; convert the afm files instead.
(let ((build (string-append (getcwd) "/build-fonts/euler")))
(mkdir build)
- (with-directory-excursion "fonts/afm/public/amsfonts/"
+ (with-directory-excursion "fonts/afm/public/amsfonts/euler"
(for-each (lambda (font)
(format #t "converting afm font ~a\n" (basename font ".afm"))
(invoke "afm2tfm" font

With this patch applied, I can make use of the modular texlive system
from the comfort of Emacs + org. It could be that there are other 'ghost
fonts' haunting up the place.

The following...
Toggle snippet (4 lines)
guix refresh -l texlive-amsfonts
Building the following 1438 packages would ensure 3202 dependent packages are rebuilt

makes me think this is very much a disruptive change. I'm not in a hurry
to get this upstreamed, but if anyone could reproduce the problem (and
my fix...), I would be more confident in pushing it.

- Jelle
E
E
elaexuotee wrote on 9 May 2020 12:47
(no subject)
(address . 40558@debbugs.gnu.org)
27M6ZG86RAW9I.2JWF3V3MICGED@wilsonb.com
I encountered a similar issue while trying to package something with a texlive-union input. Tracking down the issue has killed way too many hours.

FWIW, the `working.tex' minimal example is also giving me similar problems:

$ guix describe
Generation 28 5? 07 2020 01:10:02 (current)
guix bed695a
branch: master
commit: bed695aa94cd85800ec2c6296fb2d13e7ac29133
$ guix environment --pure -e '((@ (gnu packages tex) texlive-union) `(,(@ (gnu packages tex) texlive-amsfonts)))'
$ pdflatex working
...
! Math formula deleted: Insufficient symbol fonts.
\) ->\relax \ifmmode \ifinner $
\else \@badmath \fi \else \@badmath \fi
l.4 Hello! \(y = x^2\)
...

With the patch to texlive-amsfonts the above typesets just fine; however, metafont ends up generating cmmi10.657pk and cmr10.657pk font files. Is this expected? Typsetting it from the texlive installation of my foreign distro doesn't call out to metafont at all.
Attachment: signature.asc
J
J
Jelle Licht wrote on 12 May 2020 14:36
87zhade3dk.fsf@jlicht.xyz
elaexuotee@wilsonb.com writes:

Toggle quote (2 lines)
> With the patch to texlive-amsfonts the above typesets just fine; however, metafont ends up generating cmmi10.657pk and cmr10.657pk font files. Is this expected? Typsetting it from the texlive installation of my foreign distro doesn't call out to metafont at all.

As I mentioned earlier, I am not a tex expert at all. I have no clue,
but if my patch makes spooky things happen, we should probably hold off
on applying it.

- Jelle
R
R
Ricardo Wurmus wrote on 26 Oct 2020 23:10
(address . elaexuotee@wilsonb.com)(address . 40558@debbugs.gnu.org)
8736203agz.fsf@elephly.net
elaexuotee@wilsonb.com writes:

Toggle quote (5 lines)
> With the patch to texlive-amsfonts the above typesets just fine;
> however, metafont ends up generating cmmi10.657pk and cmr10.657pk font
> files. Is this expected? Typsetting it from the texlive installation
> of my foreign distro doesn't call out to metafont at all.

This is a problem with the modular TeX Live packages. The pk files are
bitmap fonts. I found that adding texlive-cm-super to the union helps
in that the bitmap variants of the CM fonts will not be generated any
more. More font packages may be needed in the union to prevent TeX from
falling back to bitmap fonts in other cases.

In any case, that’s unrelated to Jelle’s patch, which looks fine to me.

--
Ricardo
E
E
elaexuotee wrote on 3 Feb 2021 10:57
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 40558@debbugs.gnu.org)
2O0C65TN1X0RC.2X8CEIYC1SBBG@wilsonb.com
Ricardo Wurmus <rekado@elephly.net> wrote:
Toggle quote (8 lines)
> This is a problem with the modular TeX Live packages. The pk files are
> bitmap fonts. I found that adding texlive-cm-super to the union helps
> in that the bitmap variants of the CM fonts will not be generated any
> more. More font packages may be needed in the union to prevent TeX from
> falling back to bitmap fonts in other cases.
>
> In any case, that’s unrelated to Jelle’s patch, which looks fine to me.

Thank you, Ricardo, for looking into this.

I have lost signficant amounts of hair trying to find a solution. Adding
texlive-cm-super doesn't help for the document I trying to typeset. In fact, I
even grabbed all texlive packages with fonts and threw them in the
texlive-union to no effect. No matter what, pdflatex bails when trying to find
the font to set $~$.

The only way I have gotten it to typeset under a texlive-union so far is by
munging texlive-amsfonts as Jelle mentioned.
R
R
Ricardo Wurmus wrote on 21 Jan 2022 18:21
Re: bug#40558: Modular TexLive "Insufficient extension fonts" and duplicate fonts
(address . elaexuotee@wilsonb.com)(address . 40558@debbugs.gnu.org)
87sfthovg2.fsf@elephly.net
elaexuotee@wilsonb.com writes:

Toggle quote (20 lines)
> Ricardo Wurmus <rekado@elephly.net> wrote:
>> This is a problem with the modular TeX Live packages. The pk files are
>> bitmap fonts. I found that adding texlive-cm-super to the union helps
>> in that the bitmap variants of the CM fonts will not be generated any
>> more. More font packages may be needed in the union to prevent TeX from
>> falling back to bitmap fonts in other cases.
>>
>> In any case, that’s unrelated to Jelle’s patch, which looks fine to me.
>
> Thank you, Ricardo, for looking into this.
>
> I have lost signficant amounts of hair trying to find a solution. Adding
> texlive-cm-super doesn't help for the document I trying to typeset. In fact, I
> even grabbed all texlive packages with fonts and threw them in the
> texlive-union to no effect. No matter what, pdflatex bails when trying to find
> the font to set $~$.
>
> The only way I have gotten it to typeset under a texlive-union so far is by
> munging texlive-amsfonts as Jelle mentioned.

I have since added texlive-amsfonts/fixed, which installs all the files
it is supposed to (according do the tlpdb). I’ve also since fixed font
search.

Can this issue be closed?

--
Ricardo
E
E
elaexuotee wrote on 22 Jan 2022 00:42
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 40558@debbugs.gnu.org)
321HNQCQ83DRR.3A7ZBRV3CBQ8S@wilsonb.com
Ricardo Wurmus <rekado@elephly.net> wrote:
Toggle quote (29 lines)
>
> elaexuotee@wilsonb.com writes:
>
> > Ricardo Wurmus <rekado@elephly.net> wrote:
> >> This is a problem with the modular TeX Live packages. The pk files are
> >> bitmap fonts. I found that adding texlive-cm-super to the union helps
> >> in that the bitmap variants of the CM fonts will not be generated any
> >> more. More font packages may be needed in the union to prevent TeX from
> >> falling back to bitmap fonts in other cases.
> >>
> >> In any case, that’s unrelated to Jelle’s patch, which looks fine to me.
> >
> > Thank you, Ricardo, for looking into this.
> >
> > I have lost signficant amounts of hair trying to find a solution. Adding
> > texlive-cm-super doesn't help for the document I trying to typeset. In fact, I
> > even grabbed all texlive packages with fonts and threw them in the
> > texlive-union to no effect. No matter what, pdflatex bails when trying to find
> > the font to set $~$.
> >
> > The only way I have gotten it to typeset under a texlive-union so far is by
> > munging texlive-amsfonts as Jelle mentioned.
>
> I have since added texlive-amsfonts/fixed, which installs all the files
> it is supposed to (according do the tlpdb). I’ve also since fixed font
> search.
>
> Can this issue be closed?

Are we sure this is fixed? The issue where you added texlive-amsfonts/fixed is
still seeing the original missing fonts error for eufm10:

R
R
Ricardo Wurmus wrote on 22 Jan 2022 08:50
(address . elaexuotee@wilsonb.com)(address . 40558@debbugs.gnu.org)
87o844p5sj.fsf@elephly.net
elaexuotee@wilsonb.com writes:

Toggle quote (35 lines)
> Ricardo Wurmus <rekado@elephly.net> wrote:
>>
>> elaexuotee@wilsonb.com writes:
>>
>> > Ricardo Wurmus <rekado@elephly.net> wrote:
>> >> This is a problem with the modular TeX Live packages. The pk files are
>> >> bitmap fonts. I found that adding texlive-cm-super to the union helps
>> >> in that the bitmap variants of the CM fonts will not be generated any
>> >> more. More font packages may be needed in the union to prevent TeX from
>> >> falling back to bitmap fonts in other cases.
>> >>
>> >> In any case, that’s unrelated to Jelle’s patch, which looks fine to me.
>> >
>> > Thank you, Ricardo, for looking into this.
>> >
>> > I have lost signficant amounts of hair trying to find a solution. Adding
>> > texlive-cm-super doesn't help for the document I trying to typeset. In fact, I
>> > even grabbed all texlive packages with fonts and threw them in the
>> > texlive-union to no effect. No matter what, pdflatex bails when trying to find
>> > the font to set $~$.
>> >
>> > The only way I have gotten it to typeset under a texlive-union so far is by
>> > munging texlive-amsfonts as Jelle mentioned.
>>
>> I have since added texlive-amsfonts/fixed, which installs all the files
>> it is supposed to (according do the tlpdb). I’ve also since fixed font
>> search.
>>
>> Can this issue be closed?
>
> Are we sure this is fixed? The issue where you added texlive-amsfonts/fixed is
> still seeing the original missing fonts error for eufm10:
>
> https://issues.guix.gnu.org/53339#3-lineno36

At least the question “is texlive-amsfonts broken” is definitively
answered. This was what this issue was about, no? I’d rather keep the
other issue separate.

--
Ricardo
E
E
elaexuotee wrote on 23 Jan 2022 03:53
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 40558@debbugs.gnu.org)
2JED6QHA0S33Q.3I79W95FRDN8Q@wilsonb.com
Toggle quote (4 lines)
> At least the question “is texlive-amsfonts broken” is definitively
> answered. This was what this issue was about, no? I’d rather keep the
> other issue separate.

Well, it's still broken in the sense that we're not able to typeset with
eufm10, no? That said, I guess it could make sense to define this issue as
"tlpdb non-conformance problems" and close as fixed.
R
R
Ricardo Wurmus wrote on 23 Jan 2022 11:55
(address . elaexuotee@wilsonb.com)(address . 40558-done@debbugs.gnu.org)
87y236ogu1.fsf@elephly.net
elaexuotee@wilsonb.com writes:

Toggle quote (7 lines)
>> At least the question “is texlive-amsfonts broken” is definitively
>> answered. This was what this issue was about, no? I’d rather keep the
>> other issue separate.
>
> Well, it's still broken in the sense that we're not able to typeset with
> eufm10, no?

Something might be broken, but it’s not texlive-amsfonts.

Going back to the first message in this bug report here I can no longer
reproduce the problem. I used this manifest:
(specifications->manifest (list "texlive-amscls" "texlive-amsfonts" "texlive-base" "texlive-cm" "texlive-cm-super" "texlive-fontinst" "texlive-fonts-ec" "texlive-fonts-latex" "texlive-generic-ulem" "texlive-hyperref" "texlive-latex-amsmath" "texlive-latex-base" "texlive-latex-capt-of" "texlive-latex-preview" "texlive-latex-wrapfig" "texlive-latexconfig" "texlive-metafont" "texlive-oberdiek" "texlive-pstool" "texlive-unicode-data"))
And this TeX file:
Attachment: broken.tex
Running pdflatex on the file throws no errors and it produces a PDF file
as expected.

So I’ll close this issue. I suggest we keep investigating the problem
with eufm10 in issue 53339.

--
Ricardo
Closed
Z
Z
zimoun wrote on 11 Feb 2022 15:58
(name . Ricardo Wurmus)(address . rekado@elephly.net)
87fsop8n7i.fsf@gmail.com
Hi Ricardo,

On Fri, 21 Jan 2022 at 18:21, Ricardo Wurmus <rekado@elephly.net> wrote:

Toggle quote (9 lines)
>> The only way I have gotten it to typeset under a texlive-union so far is by
>> munging texlive-amsfonts as Jelle mentioned.
>
> I have since added texlive-amsfonts/fixed, which installs all the files
> it is supposed to (according do the tlpdb). I’ve also since fixed font
> search.
>
> Can this issue be closed?

I reopen the issue because it appears to be broken for beamer.

Toggle snippet (10 lines)
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{tabular}{c|c}
foo & bar
\end{tabular}
\end{frame}
\end{document}

leads to the error:

Toggle snippet (11 lines)
! Math formula deleted: Insufficient extension fonts.
\endtabular ->\crcr \egroup \egroup $
\egroup
l.7 \end{frame}

? --8<---------------cut here---------------end--------------->8---

Weird, isn't? That's because 'tabular' uses some math stuff for
aligning, IIUC. Otherwise, this example:

\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{equation}
x
\end{equation}
\end{frame}
\end{document}
Toggle snippet (9 lines)

Using Guix 4dffece, the invokation is:

guix shell -C -m manifest.scm -- pdflatex foo.tex

where 'manifest.scm' reads:

(specifications->manifest
(list
"rubber"

"texlive-base"
"texlive-fonts-ec"
"texlive-kpfonts"
"texlive-cm-super"
"texlive-amsfonts-fixed"

"texlive-beamer"
"texlive-translator"
"texlive-ulem"
"texlive-capt-of"
"texlive-hyperref"
"texlive-carlisle"

"texlive-latex-geometry"
"texlive-latex-wrapfig"
"texlive-latex-amsmath"
"texlive-babel-french"
"texlive-latex-listings"
))
Toggle snippet (9 lines)
(Maybe I miss a package in the manifest?)


Last, note it works using the BIG 'texlive' package.

Cheers,
simon
R
R
Ricardo Wurmus wrote on 11 Feb 2022 20:39
(address . 40558@debbugs.gnu.org)(name . zimoun)(address . zimon.toutoune@gmail.com)
87h795tcl1.fsf@elephly.net
I can reproduce this with a simpler document:

Toggle snippet (9 lines)
\documentclass{article}
\usepackage{amsfonts}
\begin{document}
\begin{equation}
x
\end{equation}
\end{document}

and this manifest

Toggle snippet (9 lines)
(specifications->manifest
(list
"texlive-base"
"texlive-amsfonts-fixed"
;; "texlive-latex-amsmath"
))


--
Ricardo
R
R
Ricardo Wurmus wrote on 13 Feb 2022 10:31
merge bugs
(address . control@debbugs.gnu.org)
871r07ru01.fsf@elephly.net
merge 53339 40558
thanks

--
Ricardo
R
R
Ricardo Wurmus wrote on 15 Feb 2022 17:34
Modular TexLive "Insufficient extension fonts" and duplicate fonts
(address . 40558-done@debbugs.gnu.org)
871r04ozns.fsf@elephly.net
This is now fixed with commit 64fcf9508af318cc2d71811815cfbe99063867b1.

The cause: we generated the tfm files from afm and pl files in a
misguided attempt to build as many things from “source” as possible.
Turns out that this results in bad tfm files. These files mere meant to
be installed just as they are included in the upstream bundle.

That’s what we’re doing now.

--
Ricardo
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 40558@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 40558
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch