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
Asked
Active
Viewed 1,447 times
3
TFra6
- 179
1 Answers
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}
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
-
I was to the pag. 18 of
mhchempackage and I was not understood the code\mhchemoptions{arrows=% pgf{Kite[length=0pt 4,width’=0pt 1]}{0.15ex}} \ce{A <--> B}– Sebastiano Mar 30 '19 at 23:19 -
1
-
-
This has no effect for me - if I run your code, all the arrows come out the same, long, length. – N. Virgo Feb 08 '20 at 08:08
-
@Nathaniel I don't know what to say: I tried on a fresh document with everything updated and it works as advertised. – egreg Feb 08 '20 at 09:16

mhchemreplied and said “I am quite busy at the moment, but I will eventually implement your suggestion.” – egreg Apr 02 '19 at 08:56