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 need to write a chemical reaction. I use to make this with mhchem, but I discover chemformula. All it is right but no the arrows when I use the package babel in spanish.

There are a problem with spanish babel, because these two codes demonstrate there is a conflict. I need to use spanish babel and chemformula at the same time.

These are the codes:

The first one:

\documentclass[11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{chemformula}
\begin{document}
\ch {C6H12O6 (s)  +  6 O2 (g) <-> 6 CO2 (g)  +  6 H2O(l)}
\end{document}

and the second:

\documentclass[11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{chemformula}
\begin{document}
\ch {C6H12O6 (s)  +  6 O2 (g) <-> 6 CO2 (g)  +  6 H2O(l)}
\end{document}

Can somebody help me?

share|improve this question
    
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  Harish Kumar Feb 2 at 0:36
    
Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. And a suggestion: Do us a favour and change your username to something more telling than "user1234". In your user profile you can also add your settings. –  Speravir Feb 2 at 3:08
    
I'll add something to chemformula in order to handle this automatically –  cgnieder Feb 2 at 12:22
add comment

2 Answers

The problem is that the spanish module for babel changes the behaviour of < and > to implement some special quotation mechanism.

If you are not using the special quotation mechanism offered by the spanish module, add the es-noquoting option, so < and > recover their standard meaning:

\documentclass[11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[spanish,es-noquoting]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{chemformula}
\begin{document}
\ch {C6H12O6 (s)  +  6 O2 (g) <-> 6 CO2 (g)  +  6 H2O(l)}
\end{document}

Another option, still allowing you to use the quoting features implemented by the spanish module would be to deactivate the feature before the formula and then activate it again:

\documentclass[11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{chemformula}
\begin{document}
\deactivatequoting
\ch {C6H12O6 (s)  +  6 O2 (g) <-> 6 CO2 (g)  +  6 H2O(l)}
\activatequoting
\end{document}

enter image description here

share|improve this answer
    
Thank you, Gonzalo. It is a good solution. –  user45241 Feb 2 at 1:12
add comment

This is fixed in v4.5 (2014/04/08) of chemmacros/chemfomula:

\documentclass[11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}

\usepackage{chemmacros}[2014/04/08]

\begin{document}
\ch{C6H12O6\sld{} + 6 O2\gas{} <-> 6 CO2\gas{} + 6 H2O\lqd}
\end{document}

enter image description here

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.