Error when changing font in Quarto/tinytex

157 Views Asked by At

I have a Quarto document I would like to create a pdf with using tinytex. I would like to use two different fonts at different points in the document, and so I'm using \setmainfont{font-name} at various points in the document. All the fonts I'm trying to use have definitely been installed on my machine---in fact, I can verify this by running

systemfonts::system_fonts()

in R and I can see both the fonts I want in the data frame that's returned. I'm getting an error when I try to use one of the fonts but not the other. Any explanation for why?

Here's a more specific example. The two fonts I want to use are called "Alegreya" and "Domestic Manners." They have both been installed on my computer. The following document knits just fine:

---
format: pdf
---

This is in "normal" font.

\setmainfont{Alegreya}
This is in "Alegreya" font.

But this one gives me "Package fontspec Error: The font "Domestic Manners" cannot be found."

---
format: pdf
---

This is in "normal" font.

\setmainfont{Domestic Manners}
This is in "Domestic Manners" font.

Note that if I do it in HTML and use something like <span style="font-family: Domestic Manners"> it works! This makes me think it's a tinytex thing but I can't figure out how to convince tinytex to install this other font!

Thanks very much =)

0

There are 0 best solutions below