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).

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 ;-). – Ulrike Fischer Mar 7 '14 at 16:52
  • 1
    In version 3 \SI[reset-math-version=false]{1}{\meter} seems to work ;-) – Ulrike Fischer Nov 2 '19 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.