TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 9 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 '14 at 16:34
    
Thanks, it was quite bewildering that siunitx insisted to use a roman font ;-). – Ulrike Fischer Mar 7 '14 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.