2

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

  • This post says how to make double arrow longer? Have you seen this before? – Majid Abdolshah Mar 29 at 1:58
  • Yes, I saw it. But I need something in order to reduce it, not to make it longer – TFra6 Mar 29 at 10:27
  • The author of mhchem replied and said “I am quite busy at the moment, but I will eventually implement your suggestion.” – egreg Apr 2 at 8:56
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.

  • I was to the pag. 18 of mhchem package 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 at 23:19
  • 1
    @Sebastiano That's for changing the shape of the arrow tips. – egreg Mar 30 at 23:20
  • I thought that it was the key of the solution. – Sebastiano Mar 30 at 23:21

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.