9

Is there a way to tell siunitx to use the \mathversion{sans} font in the following example?

\documentclass{scrartcl}
 \usepackage[T1]{fontenc}
 \usepackage{helvet}
 \renewcommand\familydefault{\sfdefault}
 \usepackage{sansmath}
 \usepackage{siunitx}
 \begin{document}
 \mathversion{sans} 
  $1=1 \SI{1}{\meter}$

\end{document}

(\sisetup{mode=text} is cheating).

1 Answer 1

10

Not a 'detection' issue here: the problem is some code siunitx uses to try to avoid 'accidentally' making things bold. Try for example

\documentclass{scrartcl}
 \usepackage[T1]{fontenc}
 \usepackage{helvet}
 \renewcommand\familydefault{\sfdefault}
 \usepackage{sansmath}
 \usepackage{siunitx}
 \makeatletter
 \newcommand{\mymathversion}[1]{%
   \mathversion{#1}%
   \def\unboldmath{%
     \@nomath\unboldmath
     \mathversion{#1}%
   }%
 }
 \makeatother
 \begin{document}
 \mymathversion{sans}
  $1=1 \SI{1}{\meter}$

\end{document}
2
  • Thanks, it was quite bewildering that siunitx insisted to use a roman font ;-). Mar 7, 2014 at 16:52
  • 1
    In version 3 \SI[reset-math-version=false]{1}{\meter} seems to work ;-) Nov 2, 2019 at 17:30

You must log in to answer this question.

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