Tips From The Blog XIII: siunitx, Helvetica and LaTeX

I searched several times in vain to solve this problem. After finding a solution, I thought i’d put it up here.

The problem

Formatting of units using siunitx in LaTeX does not match the typeface of the body text.

We like to use the helvet package to get a close approximation to Helvetica in LaTeX. With the formatting of SI units taken care of with the package siunitx, the units themselves were in a sans serif typeface (sf-default) but not in Helvetica.

By default, numbers and units are not Helvetica

The solution

It was hiding in the documentation (of course)! Add the option to set detect-all to true.

\RequirePackage[detect-all=true]{siunitx}
Beautiful Helvetica

This line can be added to the preamble or to the .cls file as I’ve done here.

This post is part of a series of tips.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.