Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
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. –  cgnieder 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

1 Answer 1

up vote 3 down vote accepted

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}
share|improve this answer
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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