Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 8 down vote accepted

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}
share|improve this answer
    
Note: I'm currently working on some code which may become siunitx version 3. Things like the treatment of bold math mode are important questions to think about: this is a useful case to consider! –  Joseph Wright Mar 7 at 16:34
    
Thanks, it was quite bewildering that siunitx insisted to use a roman font ;-). –  Ulrike Fischer Mar 7 at 16:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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