1

Do siunitx macros need special characters after them? The below code throws a 'runaway argument' error. But if I add a ; after [\$] the code does compile. And if I add a ., the code compiles, but the . disappears. What's the logic here?

\documentclass[]{memoir}  
\usepackage{siunitx}
\begin{document}

\LaTeX costs \SI{0}[\$]

\end{document}
1
  • 5
    You need the 2nd mandatory argument which is the unit (in this case blank) \SI{0}[\$]{}. The syntax is \SI[<options>]{<number>}[<pre-unit>]{<unit>} (see p.4 siunitx manual). Recall for LaTeX, brackets are optional arguments, braces are mandatory arguments. May 16, 2016 at 19:34

1 Answer 1

4

Converting my upvoted comment into an answer, at Torbjorn's request.

For this problem, you need the 2nd mandatory argument which is the unit (in this case blank)

\SI{0}[\$]{}

The syntax is \SI[<options>]{<number>}[<pre-unit>]{<unit>} (see p.4 siunitx manual). Recall for LaTeX, brackets are optional arguments, braces are mandatory arguments.

\documentclass[]{memoir}  
\usepackage{siunitx}
\begin{document}

\LaTeX{} costs \SI{0}[\$]{}

on special this week for \SI{6}[\$]{\!^{\scriptscriptstyle 99}}!

\end{document}

enter image description here

0

You must log in to answer this question.

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