3

I use the following preamble to get a sans serif font in my docs:

\usepackage{lmodern}
\renewcommand*\familydefault{\sfdefault}
\usepackage[T1]{fontenc}

The siunitx package works well with this, producing all its output in the same sans serif font as the surrounding text.

But when I try to make the maths sans serif as well:

\usepackage{sansmath}
\sansmath

The maths outputs in sans serif, but anything from siunitx eg \num{2.3e-5} now outputs in the standard serif font!

Is there a way to get everything in sans serif font?

  • 3
    Try with \usepackage[detect-all]{siunitx} – user11232 May 10 '15 at 8:16
  • @HarishKumar ^^^^^ – Johannes_B May 10 '15 at 9:37
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – user11232 May 10 '15 at 11:23
  • 1
    It didn't work for me though. – Zack Fair May 23 '17 at 8:22
  • Can you please add your working code? because for me \usepackage[detect-all]{siunitx} doesn't work. – gvgramazio May 6 '18 at 14:36

Your Answer

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

Browse other questions tagged or ask your own question.