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.

Why won't this compile? I suspect the math inside the []s are preventing compilation. If so how do I make this work? Thanks.

\documentclass[12pt]{article}
\usepackage[version=3]{mhchem}
\begin{document}
\ce{E + S <=> [$k_1$][$k_{-1}$] ES <=>[$k_2$] E + P}
\end{document}

Error:

! Missing $ inserted. $ l.34 ...k_1$}][\ce{$k_{-1}$}] ES <=>[$k_2$] E + P} ?

share|improve this question
2  
set it without using math mode: \ce{E + S <=> [k_1][k_{-1}] ES <=>[k_2] E + P} –  Herbert Jun 17 '11 at 15:00
    
Very good, I also discovered the space between <=> and [k_1][... is not allowed. :| Thanks! –  ptrcao Jun 17 '11 at 15:09
1  
@Herbert: since you answered first, post your comment as an answer, and I'll delete mine. –  Gonzalo Medina Jun 17 '11 at 15:09
    
A gentleman huh? ;) –  ptrcao Jun 17 '11 at 15:11
1  
It also works with \ensuremath{k_1}, if you wish to have math mode for the common italic math font. –  Stefan Kottwitz Jun 17 '11 at 15:30
show 5 more comments

2 Answers

set it without using math mode:

\ce{E + S <=> [k_1][k_{-1}] ES <=>[k_2] E + P}
share|improve this answer
add comment

The arguments of mhchem's arrows already are in math mode. So wrapping them in $...$ must go wrong.

\ce{A ->[\Delta] B} % default: math mode

If you would want or need text mode you'd have to use \text{} or mhchem's shortcut:

\ce{A ->T[text mode] B} = \ce{A ->[\text{text mode}] B}

Also there is a second shortcut for "chemistry mode", i.e. using the \ce macro:

\ce{A ->C[H2O] B} = \ce{A ->[\ce{H2O}] B}
share|improve this answer
add comment

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.