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.

The use of breqn causes the subscript numbers in chemical expressions, formatted by mhchem, to be exlargened and perhaps moved slightly making it look ugly.

Is there a way to avoid this or should I stop using breqn?

Many thanks

MWE - comment out breqn to see the diference

\documentclass{article}
\usepackage{amsmath}
\usepackage{breqn}
\usepackage[version=3]{mhchem} 

\begin{document}
\ce{H2SO4}
\end{document}
share|improve this question
1  
Would you please present a minimal working example (MWE)? –  egreg Jan 30 '13 at 10:47
    
I think it is something to do with mhchem using the dmath environment. –  Darling Jan 30 '13 at 11:04

1 Answer 1

up vote 6 down vote accepted
\documentclass{article}
\usepackage{amsmath}
\let\xxmathchoice\mathchoice
\usepackage{breqn}
\let\yymathchoice\mathchoice

\usepackage[version=3]{mhchem} 

\begin{document}
\let\mathchoice\xxmathchoice
\ce{H2SO4}
 ...
\let\mathchoice\yymathchoice
\begin{dmath}...
\end{document}
share|improve this answer
    
Wouldn't this break breqn? –  egreg Jan 30 '13 at 17:42
    
well not if you put it back again, I suppose I should show that –  David Carlisle Jan 30 '13 at 17:46
    
So before each time you plan to use the dmath environment you also add your \let\mathchoice\... before and after? I'll have a go. :) –  Darling Jan 30 '13 at 18:11
2  
@Darling Or you patch the \ce macro itself: \makeatletter\renewcommand\ce[1]{\let\mathchoice\xxmathchoice\mhchem@ce@xiii{\m‌​hchem@ce@viii#1 \mhchem@END\mhchem@ENDEND}\let\mathchoice\yymathchoice}\makeatother (or use etoolbox’s \pretocmd and \apptocmd) –  Qrrbrbirlbel Jan 30 '13 at 19:22

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.