0

I wanted to use the unicode "π" symbol inside siunitx macros. As many other people, I ran into several issues and used TeX StackExchange to learn about and solve them one by one.

However, one issue remains: If I use group separators siunitx gets confused because, as "π" is considered a symbol similar to a regular digit, numbers aren't separated correctly.

The following MWE helps to visualize the situation:

Code

\documentclass[11pt,landscape]{standalone}
\usepackage{siunitx}
\usepackage{fontspec}
\usepackage[mathrm=sym]{unicode-math}
\setmainfont{Libertinus Serif}
\setmathfont{Libertinus Math}
\sisetup{
    group-separator = {.},
    input-symbols=π,
}
\begin{document}
    \SI{2000π}{\radian\per\second}
\end{document}

which leads to this output when compiled (with lualatex in my case):

Output

Wrong output

So, the numeric part it's displayed like "20.000", which is obviously wrong.

An obvious workaround is to type \num{2000}π \si{\radian\per\second}, but I wonder if there's a better solution.

1 Answer 1

1

You don't want to parse a number in the first argument.

\documentclass[11pt,border=4]{standalone}
\usepackage{siunitx}
\usepackage{fontspec}
\usepackage[mathrm=sym]{unicode-math}

\setmainfont{Libertinus Serif}
\setmathfont{Libertinus Math}

\sisetup{
    group-separator = {.},
}

\begin{document}

\SI[parse-numbers=false]{2000π}{\radian\per\second}

\end{document}

enter image description here

3
  • I see. However, I notice that disabling number parsing also disables the siunitx ability to recognise and group digits, or correctly typeset a comma as a decimal marker (as in 20000,34π, for instance). Is there any other known tradeoff? Feb 12, 2021 at 16:40
  • @OrestesMas I'm not sure that something like 20.23π is realy meaningful.
    – egreg
    Feb 12, 2021 at 16:55
  • You're right. Wrong example. I was just trying to figure out what's going on here... Feb 12, 2021 at 17:30

You must log in to answer this question.

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