7

I am trying to set my global options for the \num{} output so that it correspond to the same font style of the surrounding text. I am using the siunitx package. After reading the package documentation, I attempted the following, to no avail.

\usepackage[group-separator={,}]{siunitx}
\sisetup{detect-family}

What option should I use to obtain font-family uniformity?

0

1 Answer 1

9
\documentclass{article}
\usepackage[group-separator={,}]{siunitx}
\sisetup{
  detect-all,
  detect-inline-family=math,
  detect-inline-weight=math,
  detect-display-math=true
}

\begin{document}

{\sffamily\num{123}}

{\bfseries\num{123}}

{\itshape\num{123}}

{\ttfamily\num{123}}

$\boldmath{\num{123}}$

\[
\mathsf{\num{123}}
\]

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .