[Tex/LaTex] SIrange with leading plus

siunitx

When using siunitx, by default, \SIrange{-4}{+6}{\percent} will render

-4% to 6%.

Is there any general way to change rendering of the positive values with a leading "+" for the positive values?

-4% to +6%

Best Answer

This is controlled by option retain-explicit-plus:

\documentclass{article}
\usepackage{siunitx}
\begin{document}
  \SIrange[retain-explicit-plus]{-4}{+6}{\percent}
\end{document}

Result

The option can also be set via \sisetup.

Fonts

There are many options that control the fonts that are used. Examples:

\documentclass{article}
\usepackage{siunitx}
\begin{document}
  \SIrange[retain-explicit-plus]{-4}{+6}{\percent}

  \textbf{%
    \SIrange[
      detect-weight,% or detect-all
      retain-explicit-plus,
    ]{-4}{+6}{\percent}%
  }%

  \textit{%
    \SIrange[
      mode=text,
      detect-shape,% or detect-all
      retain-explicit-plus,
    ]{-4}{+6}{\percent}%
  }%

\end{document}

Result