1

Why do I get an error (Misplaced sign token) for the negative sign in the second parenthesized number? Executing without the negative sign works!

\documentclass{article}
\usepackage{booktabs,siunitx}
\sisetup{input-symbols = ()} 
\newcommand{\twoS}{\ensuremath{{}^{\textstyle **}}}
\begin{document}
\begin{table}[ht!]
\caption{caption here} \label{tab:tab1}
\centering
\begin{tabular}{ l S[table-format=-1.4e-2] } 
\toprule
{some title} & {some results} \\
\midrule
A   &   1.0845e-09\twoS  \\
        &   (2.14) \\
B   &   -2.2445e-09 \\
        &   (-4.45) \\ %remove '-' sign to make compilable!!!!!
\bottomrule
\end{tabular}
\end{table}
\end{document}

EDIT: Or is it alternatively possible to use the S command only for every other row? That would solve my problem too!

1 Answer 1

4

Here is a work-around: declaring ( as table-text-sep-pre and bracketting it in the table where required. I took the opportunity to declare ** as table-text-sep-post, so no need defining a \twoS command. Finally I added the caption package to have proper vertical spacing between caption in ‘above’ position and table.

\documentclass{article}

\usepackage{booktabs,siunitx, caption}
\sisetup{input-symbols = (),table-sign-mantissa, table-space-text-pre = (, table-space-text-post =**}

\begin{document}

\begin{table}[ht!]
\caption{caption here} \label{tab:tab1}
\centering
\begin{tabular}{ l S[table-format=-1.4e-2] }
\toprule
{some title} & {some results} \\
\midrule
A & 1.0845e-09** \\
        & (2.14) \\
\addlinespace
B & -2.2445e-09 \\
        & {(}-4.45) \\ 
\bottomrule
\end{tabular}
\end{table}

\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 .