1

Arrows' tips aren't in the accurate place, they are slightly shifted to the left. Does anyone have an idea how to fix it so that they could be in the middle?

    \documentclass{article}
    \usepackage{chemformula}
    \usepackage{chemfig}
\usepackage{chemmacros}
    \begin{document}
    \schemestart
        \chemfig{@{a1}Cl-[@{a2},.8]@{a3}\textcolor{red}{H}} 
        \+ 
        \chemfig{@{a4}\textcolor{blue}{\charge{0=\: , 180=\:}{O}}(-[:65,.6]H)-[:-65,.6]H} 
        \ch{<>} 
        \chemfig{\textcolor{blue}{\charge{0=\: , 125:3pt=\scriptsize $ \oplus $}{O}}(-[:65,.6]H)(-[:180,.6]\textcolor{red}{H})-[:-65,.6]H}
        \+
        \chemfig{\charge{25:3pt=\scriptsize $\ominus$}{Cl}}
    \schemestop
    \chemmove{
        \draw(a2)..controls +(85:4mm) and +(105:4mm)..(a1);
        \draw(a4.135)..controls +(100:4.5mm) and +(80:4.5mm)..(a3);}
    \end{document}

This is how it looks now.

2
  • Do you compile your code twice (at least)? With up-to-date MikTeX installation I can't reproduce your problem, Try to upgrade your LaTeX installation.
    – Zarko
    Commented Jul 1, 2023 at 11:55
  • You may also to consider to add \usepackage{textgreek} to your document preamble. BTW, it is not related to your problem, however i remove warnings during compilation.
    – Zarko
    Commented Jul 1, 2023 at 12:01

2 Answers 2

2

Your code wasn't bad when I compiled it in the latest version of latex (texlive 2023).

I adjusted some numbers on the arrows, and added some options.

\documentclass{article}
\usepackage{chemformula}
\usepackage{chemfig}
\usepackage{chemmacros}
\begin{document}
    \schemestart
    \chemfig{@{a1}Cl-[@{a2},.8]@{a3}\textcolor{red}{H}} 
    \+ 
    \chemfig{@{a4}\textcolor{blue}{\charge{0=\:,180=\:}{O}}(-[:65,.6]H)-[:-65,.6]H} 
    \ch{<>} 
    \chemfig{\textcolor{blue}{\charge{0=\: , 125:3pt=\scriptsize $ \oplus $}{O}}(-[:65,.6]H)(-[:180,.6]\textcolor{red}{H})-[:-65,.6]H}
    \+
    \chemfig{\charge{25:3pt=\scriptsize $\ominus$}{Cl}}
    \schemestop
    \chemmove{
        \draw[red,shorten <=1pt,shorten >=1pt](a2)..controls +(90:4mm) and +(80:6mm)..(a1);
        \draw[red,shorten <=3pt,shorten >=1pt](a4.180)..controls +(90:8mm) and +(80:5mm)..(a3);}
\end{document}

enter image description here

2
  • Thank you very much. I compiled it in Overleaf Latex and indeed when I entered it into TexMaker it looked fine. I'm curious why this happened, is there an older version on Overleaf? Commented Jul 2, 2023 at 12:49
  • @MichałSzymankiewicz Overleaf does not yet have the current texlive versions. You can see the available versions in the sidebar. The newest one currently available there is texlive 2022, so more than a year old. Commented Jul 2, 2023 at 18:09
1

As a slight variation of @CrocoDuck's nice answer: you could use a to path operation instead of Bézier curves to get arrows which look a bit more symmetric:

\documentclass{article}
\usepackage{chemformula}
\usepackage{chemfig}
\usepackage{chemmacros}
\begin{document}
    \schemestart
    \chemfig{@{a1}Cl-[@{a2},.8]@{a3}\textcolor{red}{H}} 
    \+ 
    \chemfig{@{a4}\textcolor{blue}{\charge{0=\:,180=\:}{O}}(-[:65,.6]H)-[:-65,.6]H} 
    \ch{<>} 
    \chemfig{\textcolor{blue}{\charge{0=\: , 125:3pt=\scriptsize $ \oplus $}{O}}(-[:65,.6]H)(-[:180,.6]\textcolor{red}{H})-[:-65,.6]H}
    \+
    \chemfig{\charge{25:3pt=\scriptsize $\ominus$}{Cl}}
    \schemestop
    \chemmove{
        \draw[red,shorten <=1pt,shorten >=1pt](a2) to [out=90,in=80,looseness=2.5] (a1);
        \draw[red,shorten <=3pt,shorten >=1pt](a4.180) to [out=100,in=80,looseness=1.5] (a3);}
\end{document}

enter image description here

You must log in to answer this question.

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