2

I would like to use output-decimal-marker = {--} in siunitx to align a column with molecular transitions where the states are separated by --. However I get a Missing $ inserted error when the state includes a subscript.

\documentclass{article}
\usepackage{siunitx}

\begin{document}

\begin{table}
  \begin{tabular}{ S[output-decimal-marker = {--}] }
    3_1.2_1
  \end{tabular}
\end{table}

\end{document}

How could this work for numbers with subscripts?

8
  • Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Mar 8, 2013 at 13:13
  • 1
    You haven't specified the input decimal marker to be -- (I'm not sure it's even possible) and so siunitx chokes on the first - as a misplaced minus sign. Use 3.2 as input instead.
    – cgnieder
    Mar 8, 2013 at 14:49
  • Or use the option input-decimal-markers Mar 8, 2013 at 15:04
  • Thanks, using 3.2 as input worked. I could not define the input marker as -- because it looks that only single characters are accepted.
    – gypaetus
    Mar 8, 2013 at 16:57
  • @MigueldeVal-Borro 3\textsubscript{1} is not a number, so siunitx can't do its job.
    – egreg
    Mar 8, 2013 at 21:54

1 Answer 1

3

Do you want something like that?

\documentclass{article}
\usepackage{siunitx}

\begin{document}

\begin{table}
  \begin{tabular}{ S[output-decimal-marker={\text{--}},parse-numbers=false] }
    3_1.2_1
  \end{tabular}
\end{table}

\end{document}
1
  • 1
    Probably with output-decimal-marker = {\text{--}} to get an en-dash rather than two minus signs.
    – Joseph Wright
    Mar 9, 2013 at 9:37

You must log in to answer this question.

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