I am trying to typeset this table, but I keep running into the following error:
! Missing $ inserted.
<inserted text> $
l.34 ...{Global data expressed in \qty{e10}{\gram}
.\\%
My minimum working example is given below:
\documentclass[a4paper]{article}
\usepackage[sfdefault]{atkinson}
\usepackage{hyperref}
\usepackage{siunitx}
\sisetup{mode=text}
\sisetup{range-phrase=--}
\sisetup{range-units=single}
\sisetup{separate-uncertainty=true}
\sisetup{detect-all}
\sisetup{inter-unit-product=\ensuremath{{\cdot}}}
\sisetup{open-bracket=\, ,
close-bracket=\,}
\sisetup{tight-spacing=true}
\DeclareSIUnit[number-unit-product = ]\percent{\%}
\usepackage{threeparttable}
\usepackage{booktabs}
\begin{document}
\begin{table}[h!]
\begin{threeparttable}
\caption{Estimated biomass.}
\begin{tabular}{l c c }
\toprule
\textbf{Family}&\textbf{Global}&\textbf{Local}\\
\midrule
Family1&8.8&4.5\\
Family2&10.7&3.4\\
Family3&10.7&2.6\\
Family4&11.8&3.2\\
Family5&15.4&5.1\\
Family6&17.4&3.9\\
Family7&31.2&7.4\\
\bottomrule
\end{tabular}
\footnotesize{Global data expressed in \qty{e10}{\gram}.\\%
Local data expressed in \qty{e8}{\gram}.%
}
\end{threeparttable}
\end{table}
\end{document}
When I comment out the siunitx parts of the text, things work fine. Is there a setting I am missing?
Best Answer
This was caused by an ordering bug in
siunitx
: exactly how one deals with tight spacing and text mode is tricky. I've logged as https://github.com/josephwright/siunitx/issues/553. A temporary fix until that reaches CTAN: