[Tex/LaTex] Including range is multi-part numbers

siunitx

How do I produce something like "4 x 5 x (10–15) mm^3" in siunitx?

Thanks!

Best Answer

Package siunitx also supports expressions with multiple parts for the number. However, a range as number is not supported then. The following example uses a quotient instead and locally reconfigures, how quotients are printed. The second expression also adds the brackets that are a bit trickier.

\documentclass{article}
\usepackage{siunitx}
\begin{document}
  \SI[
    product-units   = power,
    input-quotient  = :,
    output-quotient = \text{--},
    quotient-mode   = symbol,
  ]{4 x 5 x 10:15}{\mm}

  \newcommand*{\myrange}[2]{%
    (%
      \numrange[
        range-phrase  = \text{--},
        parse-numbers = false,% numbers are ready for printing
    ]{#1}{#2})%
  }
  \SI[
    product-units     =power,
    input-quotient    =:,
    quotient-mode     =fraction,
    fraction-function =\myrange,
  ]{4 x 5 x 10:15}{\mm}
\end{document}

Result

Related Question