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?

  • 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}. – Marco Daniel Mar 8 '13 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. – clemens Mar 8 '13 at 14:49
  • Or use the option input-decimal-markers – Marco Daniel Mar 8 '13 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. – Miguel de Val-Borro Mar 8 '13 at 16:57
  • @MigueldeVal-Borro 3\textsubscript{1} is not a number, so siunitx can't do its job. – egreg Mar 8 '13 at 21:54
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
    Probably with output-decimal-marker = {\text{--}} to get an en-dash rather than two minus signs. – Joseph Wright Mar 9 '13 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.