4
\documentclass{article}

\usepackage{mhchem}

\begin{document}  

\ce{H^+ (\textit{aq}) + HCO3^- <=> H2CO3 (\textit{aq}) <=> H2O (\textit{l}) + CO2 (\textit{g})}

\ce{2H2(\textit{g}) + O2(\textit{g}) <=> 2H2O(\textit{l})}

\end{document}

I am new to Latex and doing some chemistry reports and while MS equation editor is a pain, it decently works even by using mixed fractions to get ion charges with subscripts for atoms, but I digress. I cannot do the double harpoon-like symbol for chemical equilibrium "longer" as I like the arrows to be stretched out more than it is. Is this even possible?

Kola B.
  • 690

3 Answers3

2

Your original version didn't work for me, hence \expandafter's:

\documentclass{article}

\usepackage{mhchem}

\begin{document}

%\ce{H^+ (\textit{aq}) + HCO3^- <=> H2CO3 (\textit{aq}) <=> H2O (\textit{l}) + CO2 (\textit{g})}

\ce{2H2( \expandafter\textit{g}) + O2( \expandafter\textit{g}) <=> 2H2O( \expandafter\textit{l})}

\ce{2H2( \expandafter\textit{ g}) + O2( \expandafter\textit{g}) <=>[\hspace{1cm}][] 2H2O( \expandafter\textit{l})}


\end{document}

enter image description here

Kola B.
  • 690
2

First of all, please use mhchem with the version option. You should always read the warnings you get.

Second, why do you try to get the state in italic text? IUPAC recommendation is just normal roman (= upright) text.

You can make the arrows longer by writing some 'space' above them, e.g. \hspace{10ex}.

Are you looking for an option to make all arrows longer by the same value? That is not yet an option available for users, but I could put it on my todo list.

\documentclass{article}
\usepackage[version=3]{mhchem}
\begin{document}  
\ce{H^+(aq) + HCO3^- <=>[\hspace{10ex}] H2CO3(aq) <=> H2O(l) + CO2(g)}

\ce{2H2(g) + O2(g) <=> 2H2O(l)}
\end{document}

enter image description here

mhchem
  • 3,485
  • 12
  • 37
-2

Is this what you require?

enter image description here

Then use the following:

\documentclass[12pt]{article}  
\begin{document}  
\begin{eqnarray*}  
H^+ (aq) + HCO3^- &\Longleftrightarrow& H2CO3 (aq) \Longleftrightarrow     H2O (l) + CO2 (g)\\
2H2(g) + O2(g) &\Longleftrightarrow& 2H2O(l)
\end{eqnarray*}
\end{document}  
  • 1
    This isn't even close to proper chemical typography. Look at your H2O and compare with the other solutions. – mhchem Apr 23 '15 at 07:49
  • As @mhchem already noted this is wrong in quite a number of aspects: (1) chemically: usage of italic instead of upright font shape for atom symbols, missing subscripts, wrong kind of arrow (the arrow shapes have distinct meanings in chemistry) (2) typographically: missing spaces between stoichiometric factors and formulae, missing spaces between formulae and phase descriptors. (3) eqnarray is a bad choice: http://tex.stackexchange.com/q/196 (4) it doesn't actually answer the question (regarding mhchem's arrows) – cgnieder Apr 23 '15 at 10:20