0

Using the chemformula package, the reaction arrows appear too thick, and the tips do not have the shape I want. Is there any way to use arrows similar to those from the mhchem package (especially -> and <=>) while using chemformula? I have tried adding

\DeclareChemArrow{->}{
   \draw[chemarrow,->] (cf_arrow_start) -- (cf_arrow_end) ;
}

to the preamble, and while it is closer to what I want, the arrow still appears slightly too thick when zoomed out. Additionally, the two parts of the equilibrium arrow are slightly too close together:

enter image description here

3
  • Welcome to the TeX.SE. What is your minimal tex code?
    – Sebastiano
    Commented Jun 22, 2023 at 9:11
  • Since it's about shape of arrow tips: share an image of what you want to achieve.
    – alchemist
    Commented Jun 22, 2023 at 9:52
  • 1
    Take a look at section 9.4 of the chemformula manual and especially the example given on page 27. In that example the arrow tip is presented in the same way as in mhchem using the default TikZ options for drawing arrows.
    – alchemist
    Commented Jun 22, 2023 at 10:04

1 Answer 1

3
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usepackage[version=4]{mhchem}
\usepackage{chemformula}
\setchemformula{
    arrow-min-length=18.4pt,
    compound-sep = {0.36em},
    arrow-style = {line cap=round}
}
\RenewChemArrow{->}{\draw[chemarrow, ->]
    (cf_arrow_start) -- (cf_arrow_end);}
\NewChemArrow{<-->}{
    \draw [chemarrow, -Computer Modern Rightarrow]
        ([yshift=1pt]cf_arrow_start) -- ([yshift=1pt]cf_arrow_end);
    \draw [chemarrow, Computer Modern Rightarrow-]
        ([yshift=-2.5pt]cf_arrow_start) -- ([yshift=-2.5pt]cf_arrow_end);
}
\RenewChemArrow{<=>}{
    \draw [chemarrow, -{Computer Modern Rightarrow[left]}]
        ([yshift=1pt]cf_arrow_start) -- ([yshift=1pt]cf_arrow_end);
    \draw [chemarrow, {Computer Modern Rightarrow[left]}-]
        ([yshift=-1pt]cf_arrow_start) -- ([yshift=-1pt]cf_arrow_end);
}
\begin{document}
    \ce{A -> B} \ce{A <--> B} \ce{A <=> B}
    
    \ch{A -> B} \ch{A <--> B} \ch{A <=> B}
\end{document}

enter image description here

5
  • ⇆ isn't the same of ⇋ -- IUPAC Green Book: "Different symbols are used to connect the reactants and products with the following meanings: = for a stoichiometric relation; → for a net forward reaction; ⇆ for a reaction in both directions; ⇋ for equilibrium."
    – CrocoDuck
    Commented Jun 22, 2023 at 17:39
  • @CrocoDuck I showed how the symbols change with two examples. The rest change in the same way. I edited my answer.
    – polyn
    Commented Jun 22, 2023 at 18:28
  • The new arrow type <--> corresponds to chemformula's existing arrow type <>.
    – cgnieder
    Commented Jun 22, 2023 at 20:15
  • Is there any way to prevent the arrow from appearing thicker when the document is zoomed out? The mhchem arrow looks fine, but these new arrows do not work as well when zoomed out.
    – qianqian07
    Commented Jun 23, 2023 at 3:48
  • 1
    @qianqian07 that is an artefact from the PDF viewer and can happen with any TikZ line...
    – cgnieder
    Commented Jun 23, 2023 at 7:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .