TransWikia.com

Using mhchem with gfsneohellenic gives a weird looking arrow

TeX - LaTeX Asked by Damitr on October 30, 2020

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}

One Answer

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.

Correct answer by muzimuzhi Z on October 30, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP