1
  • I puzzled today for an hour to get the unit sans-serif.
  • I found that \usefonttheme[onlymath]{serif} helps but I am not sure if this is the correct way.
  • Question: Is it logical that I need \usefonttheme[onlymath]{serif} in order to have the units sans-serif?

enter image description here

% Based on https://tex.stackexchange.com/questions/66713/
\documentclass{beamer}

\usepackage{noto}
\usepackage{arevmath}
%\usefonttheme[onlymath]{serif} % <-- Un/Comment to see change

\usepackage{xfrac}
\usepackage{siunitx}
\sisetup{%
    per-mode = fraction,
    fraction-function = \sfrac,
    }

\begin{document}
 \begin{frame}
  Text appears in \textbf{sans-serif} font

  $x,2y,3z$ appears in \textbf{sans-serif} font

  $\SI{1}{\metre\per\second}$ units appears in \textbf{serif} font, would like it to be sans-serif
 \end{frame}
\end{document}

Edit: I now believe my question is a duplicate of sans serif font with siunitx.

4
  • Add detect-all in sisetup will do. Commented Mar 25, 2022 at 0:48
  • @TeddyvanJerry Thanks for the reply. Will test tomorrow. If memory serves me well then I tried that already but I will try again to be sure. Commented Mar 25, 2022 at 5:48
  • 1
    Here is my test result with Ubuntu + texlive 2021. Commented Mar 25, 2022 at 6:05
  • @TeddyvanJerry It worked, not sure why I did not solve it on my own (maybe the day was too long at work). You can convert your comment into an answer and I will accept. Commented Mar 25, 2022 at 16:07

1 Answer 1

1

As is discussed in sans serif font with siunitx, detect-all in sisetup will make the unit in sans serif font as is the text in the document.

Here is the test result. Test Result

2
  • The confusing part was that in beamer the other math stuff already was sans-serif. Commented Mar 25, 2022 at 18:55
  • 1
    Indeed, maybe there are many logics behind how siunitx detects and decides which font family to use. Commented Mar 26, 2022 at 0:59

You must log in to answer this question.

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