### Bug description

The `monofont` setting is ignored when rendering the following with quarto 1.1.251 (on Pop!_OS 22.04):

    ---
    monofont: Iosevka
    format:
        beamer:
            theme: metropolis
            keep-tex: true
    ---
    
    # Title
    
    ```
    Some code
    ```

The setting works when rendering to pdf (`--to pdf`) instead of Beamer slides. It also works when rendering Beamer slides without `theme: metropolis`.

I think the problem is in this part of the template:

```
\ifPDFTeX
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
  \usepackage{unicode-math}
  \defaultfontfeatures{Scale=MatchLowercase}
  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
  \setmonofont[]{Iosevka}
\fi
\usetheme[]{metropolis}
```

Here the `\setmonofont[]{Iosevka}` line has no effect because the metropolis theme later calls `\setmonofont` again.

I can work around this problem by adding the following in the YAML header:

```
        include-in-header:
            text: \setmonofont{Iosevka}
```

The meteropolis theme also calls `\setsansfont` so probably the `sansfont` setting is similarly ignored.

Looking at the other beamer themes in my texlive installation, I found one other that also overwrites font settings: the "Saint Petersburg" theme. This one also calls `\setmainfont`, so I guess the `mainfont` setting would also not work with this theme.

Minor side issue: the `theme` setting is not documented on https://quarto.org/docs/reference/formats/presentations/beamer.html (it is documented on https://quarto.org/docs/presentations/beamer.html however).

### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
dragonstyle
2022-09-22T09:34:53Z
knuesel
bug third-party
v1.3
closed
monofont ignored with metropolis beamer theme
https://github.com/quarto-dev/quarto-cli/issues/2545