tectonic-typesetting / tectonic

A modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive.
https://tectonic-typesetting.github.io/
Other
3.98k stars 162 forks source link

When including a beamer theme, it looks like it's trying to recursively include every font on my system #1094

Open elken opened 1 year ago

elken commented 1 year ago

Issue

When using the following MRE; I get spammed with warnings for quite a while (I killed it after 2 minutes)

\documentclass{beamer}
\usetheme{metropolis}
\begin{document}
test
\end{document}

image

I'm a complete LaTeX novice, so I have no clue how to debug this. The specific line is \usetheme, removing it seems to work fine even in my massive example. Other themes also seem to be okay, just metropolis.

Versions

Tectonic 0.14.1 Fedora Sericea 39 (tectonic running in a regular Fedora 39 container)

elken commented 1 year ago

Seems to be resolved by installing Fira fonts; though there's an underlying issue here I think that it should report the missing font error on the package.

I'll leave this open for now, but I've worked around it somewhat for now. I still get the same warning printed, but I can at least compile documents now.

vlasakm commented 1 year ago

See here: https://github.com/tectonic-typesetting/tectonic/issues/8#issuecomment-1329332011.

I unfortunately don't have better news. The problem is in the metropolis package itself - as Tectonic is based on XeLaTeX, if metropolis doesn't work well with XeLaTeX it also doesn't work with Tectonic.

The ultimate issue is that metropolis is trying to load a font (which is bundled by Tectonic), but it loads it in such a way that is currently not able to resolve the font in the Tectonic bundle (#9), hence Tectonic tries to consult system fonts, which is not reproducible, thus the big amount of warnings (#8) for each font examined.

I hope I can get to solving the root issue. In the mean time, as long as using the system fonts works for you, you can ignore the warnings.

It should also work to have the patched file (which I link in the comment linked above) in the same directory as your document. But I don't recommend to actually use this in the long term (it's problematic with regards to eventual updates/fixes).

elken commented 1 year ago

Yeah even though my actual document doesn't use the fonts, installing them does reduce the warnings to a usable number at least.

ilyapopov commented 1 year ago

You can solve the issue by configuring fonts yourself instead of relying on Metropolis to do it.

Instead of using the whole Metropolis, use only outer, inner and color themes:

\useoutertheme{metropolis}
\useinnertheme{metropolis}
\usecolortheme{metropolis}

then configure fonts youself:

\usepackage{fontspec}
\usepackage{unicode-math}
    \setmainfont{...}
    \setsansfont{...}
    \setmonofont{...}
    \setmathfont{...}
elken commented 1 year ago

Indeed it can be worked around, but that doesn't resolve the underlying issue here :D

rm-dr commented 11 months ago

May be related to #1118. It seems that fontspec searches the system font cache when given a font by name.