5

When using mhchem package with gfsneohellenic font the resulting arrow in chemical reactions is weird. Is there anyway to resolve this? enter image description here

enter image description here

MWE

\documentclass{article}

\usepackage{gfsneohellenicot}
\usepackage{mhchem}

\begin{document}

\begin{equation*}%
\ce{H2 + 1/2O2 -> H2O} 
\end{equation*}

\end{document}
2
  • 1
    It isn't just mhchem \xrightarrow{test} from amsmath also looks bad.
    – daleif
    Aug 7, 2020 at 10:14
  • 2
    @daleif Also \longrightarrow, for simplicity.
    – egreg
    Aug 7, 2020 at 10:33

1 Answer 1

11

By default, mhchem's arrows are composed by characters from current math font. This requires the corresponding glyphs being able to pieced together, and gfsneohellenicot seems to be not capable to do this. Extendable math arrows like \xleftarrow and \xrightarrow will give similar broken output. (In fact, mhchem re-used \xrightarrow's code, from the amsmathpackage.)

For mhchem, you can config it to draw the arrow using tikz. For example,

\documentclass{article}

\usepackage{gfsneohellenicot}
\usepackage[version=4, arrows=pgf{To[length=3pt]}{.15ex}]{mhchem}

\begin{document}

\begin{equation*}
  \ce{H2 + 1/2O2 -> H2O}
\end{equation*}

\end{document}

gives

enter image description here

  • The full document of package option pgf={<arrow tip>}{<line width>} can be found in documentation of mhchem, subsection "Arrows" (page 18 for v4.08).
  • You can also use things like \ce{->} to substitute broken extendable arrow commands, as well.
1
  • This arrow looks good with the font!
    – Damitr
    Aug 7, 2020 at 11:39

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.