4

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}
7
\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}
  • 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{\mhchem@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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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