3

I'd like to use a certain font (Frutiger) in text and in math. However, in math mode I'd like to use the light series not medium. I tried the code below (using DeclareMathAlphabet and SetMathAlphabet) but it doesn't work. See screenshot below where the "e" and the digits "0", "1", "2", "3" are typeset in medium, not light Frutiger. ("lim" is in a different font but that's another problem I suspect.) One observation is that the same approach does work when I prepare an article instead of Beamer slides.

\documentclass[14pt]{beamer}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\newcommand{\e}{\mathsf e}

\usepackage[]{frutiger}
\DeclareMathAlphabet{\mathsf}{T1}{pfr}{l}{n}
\SetMathAlphabet{\mathsf}{bold}{T1}{pfr}{l}{n}

\begin{document}
\begin{frame}{This is a test}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

$$
\lim_{\varepsilon\rightarrow 0}\frac{\e^{3\varepsilon}-\e^\varepsilon}{\varepsilon} = \lim_{\varepsilon\rightarrow 0}\frac{\e^\varepsilon (\e^{2\varepsilon}-1)}{\varepsilon}
$$

\end{frame}
\end{document}

enter image description here

5
  • 1
    I can't test right now but beamer does a lot of font setting at \begin{document}. Try putting the two lines re-declaring \mathsf in \AtBeginDocument{...}.
    – campa
    Commented Dec 9, 2020 at 15:02
  • \AtBeginDocument solves the "e" but not the digits which are perhaps not in mathsf. I tried \DeclareMathAlphabet{\mathrm}{T1}{pfr}{l}{n} but that produces an error: Command mathrm already defined.
    – tmalsburg
    Commented Dec 9, 2020 at 15:07
  • This answer suggests using \renewcommand{\mddefault}{l} but it changes to light series everywhere not just in math mode.
    – tmalsburg
    Commented Dec 9, 2020 at 15:42
  • 1
    The professionalfonts font theme turns off some beamer font trickery, and might be what you need in order to specify the exact fonts yourself. However, I do not have the package to test.
    – Davislor
    Commented Dec 9, 2020 at 21:08
  • 1
    By the way, you don’t need \usepackage[utf8x]{inputenc} anymore.
    – Davislor
    Commented Dec 9, 2020 at 21:11

1 Answer 1

1

The following works:

\usepackage{frutiger}
\AtBeginDocument{\DeclareMathAlphabet{\mathsf}{T1}{pfr}{l}{n}
                 \SetMathAlphabet{\mathsf}{bold}{T1}{pfr}{l}{n}
                 \DeclareSymbolFont{operators}{OT1}{pfr}{l}{n}
                 \DeclareSymbolFont{letters}{OML}{pfr}{l}{it}
                 \DeclareSymbolFont{symbols}{OMS}{pfr}{l}{n}}
\renewcommand{\mddefault}{l}

Apparently the AtBeginDocument is necessary because Beamer will otherwise override your own settings. Thanks to @campa for the crucial pointer.

2
  • 1
    Why trigger atbegin 5 times when you can collect all five instructions in one
    – daleif
    Commented Dec 18, 2020 at 14:57
  • Thanks, changed it.
    – tmalsburg
    Commented Dec 18, 2020 at 21:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .