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}
2

1 Answer 1

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}
4
  • Wouldn't this break breqn?
    – egreg
    Jan 30, 2013 at 17:42
  • well not if you put it back again, I suppose I should show that Jan 30, 2013 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, 2013 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) Jan 30, 2013 at 19:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .