Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

siunitx and the per=reciprocal option

44 views
Skip to first unread message

Christophe Jorssen

unread,
Sep 7, 2008, 1:42:32 PM9/7/08
to
Hello all,

Let's consider the fellowing piece of code.

\documentclass{article}
\usepackage{siunitx}
\sisetup{per=reciprocal}
\begin{document}
$\SI{1}{mol\per L}
\end{document}

As far as I understand the documentation, I should get something like

1 mol.L^{-1}

but I get

1 mol/L

Did I miss something ?

Thanks in advance

--
Christophe

Joseph Wright

unread,
Sep 7, 2008, 4:29:09 PM9/7/08
to
I'm afraid so, yes. To see what is happening, try:

\documentclass{article}
\usepackage{siunitx}
\sisetup{per=reciprocal}
\begin{document}

$\SI[debug]{1}{mol\per L}$
\end{document}

Amongst other things, you will see:

Package siunitx Info: Literal items found in unit argument:
(siunitx) outputting without further processing on input line 5.

in the log.

The various options for controlling how units come out work with macro
units only. If you use *any* literal input, the package switched to
"literal" mode. The literal mode result of \per is "/", as the package
cannot tell how things should look otherwise.

I think you want:

\documentclass{article}
\usepackage{siunitx}
\sisetup{per=reciprocal}
\begin{document}

$\SI{1}{\mole\per\liter}$
\end{document}

Perhaps I should add something more to the documentation about this.
--
Joseph Wright

Christophe Jorssen

unread,
Sep 7, 2008, 4:51:24 PM9/7/08
to
Le Sun, 07 Sep 2008 21:29:09 +0100, Joseph Wright a écrit/wrote :

[...]


> Amongst other things, you will see:
>
> Package siunitx Info: Literal items found in unit argument: (siunitx)
> outputting without further processing on input line 5.
>
> in the log.
>
> The various options for controlling how units come out work with macro
> units only. If you use *any* literal input, the package switched to
> "literal" mode. The literal mode result of \per is "/", as the package
> cannot tell how things should look otherwise.
>

Thank you for your answer. I did not notice that in the doc, sorry.



> I think you want:
>
> \documentclass{article}
> \usepackage{siunitx}
> \sisetup{per=reciprocal}
> \begin{document}
> $\SI{1}{\mole\per\liter}$
> \end{document}

Yes, that's what I want! Thanks.

--
Christophe

Joseph Wright

unread,
Sep 7, 2008, 5:00:07 PM9/7/08
to
Christophe Jorssen wrote:
> Le Sun, 07 Sep 2008 21:29:09 +0100, Joseph Wright a écrit/wrote :
>
> [...]
>> Amongst other things, you will see:
>>
>> Package siunitx Info: Literal items found in unit argument: (siunitx)
>> outputting without further processing on input line 5.
>>
>> in the log.
>>
>> The various options for controlling how units come out work with macro
>> units only. If you use *any* literal input, the package switched to
>> "literal" mode. The literal mode result of \per is "/", as the package
>> cannot tell how things should look otherwise.
>>
>
> Thank you for your answer. I did not notice that in the doc, sorry.

I'll check exactly how I've phrased this and perhaps alter it. I need
to do v1.0m in any case (see the bug report about seperr).
--
Joseph Wright

0 new messages