Modular TexLive "Insufficient extension fonts" and duplicate fonts

OpenSubmitted by Jelle Licht.
Details
3 participants
  • elaexuotee
  • Jelle Licht
  • Ricardo Wurmus
Owner
unassigned
Severity
normal
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 describemy journey in finding this bug, as I still do not have clear pictureon the why/when/what is going on. I think I also saw several otherpeople running into this issue the last few months, so either way I amhappy to have found something reproducible that at least demonstratesthat 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 topdf using latex, by default you will generate an intermediate .tex filethat uses the ulem package. Using this package leads to theaforementioned 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-hyperreftexlive-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 `stracepdflatex 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) = 0stat("/home/jlicht/.guix-profile/share/texmf-dist/fonts/tfm/public/amsfonts/cmex7.tfm", {st_mode=S_IFREG|0444, st_size=940, ...}) = 0openat(AT_FDCWD, "/home/jlicht/.guix-profile/share/texmf-dist/fonts/tfm/public/amsfonts/cmex7.tfm", O_RDONLY) = 6fstat(6, {st_mode=S_IFREG|0444, st_size=940, ...}) = 0read(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) = 940close(6) = 0openat(AT_FDCWD, "working.pdf", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 6write(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) = 0stat("/home/jlicht/.guix-profile/share/texmf-dist/fonts/tfm/public/amsfonts/euler/cmex7.tfm", {st_mode=S_IFREG|0444, st_size=1312, ...}) = 0openat(AT_FDCWD, "/home/jlicht/.guix-profile/share/texmf-dist/fonts/tfm/public/amsfonts/euler/cmex7.tfm", O_RDONLY) = 6fstat(6, {st_mode=S_IFREG|0444, st_size=1312, ...}) = 0read(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) = 1312close(6) = 0write(1, "\n", 1) = 1write(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 theother.

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 cmex7cmex7 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 aafm file in `guix build --source texlive-amsfonts'. The one 'built'using afm2tfm seems to be broken and/or not matching other metadatagenerated, as given by this example.
Thanks for reading along, I hope we will find a solution to this, asnon-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 nearlyenough 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, Ihave the following snippet:
Toggle snippet (15 lines)diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scmindex 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 systemfrom the comfort of Emacs + org. It could be that there are other 'ghostfonts' haunting up the place.
The following...
Toggle snippet (4 lines)guix refresh -l texlive-amsfontsBuilding 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 hurryto get this upstreamed, but if anyone could reproduce the problem (andmy 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 repository URL: https://git.savannah.gnu.org/git/guix.git 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 offon 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 arebitmap fonts. I found that adding texlive-cm-super to the union helpsin that the bitmap variants of the CM fonts will not be generated anymore. More font packages may be needed in the union to prevent TeX fromfalling 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 10:57 +0100
(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. Addingtexlive-cm-super doesn't help for the document I trying to typeset. In fact, Ieven grabbed all texlive packages with fonts and threw them in thetexlive-union to no effect. No matter what, pdflatex bails when trying to findthe font to set $~$.
The only way I have gotten it to typeset under a texlive-union so far is bymunging texlive-amsfonts as Jelle mentioned.
?
Your comment

Commenting via the web interface is currently disabled.

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