14

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%

1
  • Welcome to TeX.SX! You can have a look on our our starter page to familiarize yourself further with our format. Commented Aug 21, 2013 at 12:40

1 Answer 1

22

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

1
  • perfect, thank you! Ist it possible to format thist text? I want to use it in a table. \bfseries{...} or \mathbf{...} didn't work.
    – user35484
    Commented Aug 22, 2013 at 5:19

You must log in to answer this question.

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