3

Is it somehow possible to change the default length of arrows in chemical reactions using mhchem? In particular I would need to reduce its length, both for single and for double (equilibrium) arrows. I ask, if possible, coherent solutions, in the sense of commands designed for this package, if they exist. I tried something like \ce{a + b ->[-5pt] c}, it seems to not work

TFra6
  • 179

1 Answers1

3

The package doesn't provide a way to set the minimum arrow width, but it's possible to add it.

\documentclass{article}
\usepackage[version=4]{mhchem}

\ExplSyntaxOn
\keys_define:nn { mhchem }
 {
  arrow-min-length .code:n =
   \cs_set:Npn \__mhchem_arrow_options_minLength:n { {#1} } % default is 2em
 }
\ExplSyntaxOff

\begin{document}

\ce{A + B -> C}

\ce{A + B <-> C}

\ce{A + B <=> C}

\mhchemoptions{arrow-min-length=1em}

\ce{A + B -> C}

\ce{A + B <-> C}

\ce{A + B <=> C}

\end{document}

enter image description here

You can use \mhchemoptions{arrow-min-length=1em} in the preamble to set the length globally, or locally in some environment.

egreg
  • 1,121,712