2

I'm trying to reproduce a catalytic cycle from a paper, but I'm running into an problem. One of the arrows that I'm using seems to attach itself to a different point than the other arrows going to the same node. In addition, the head of the arrow is swirled around so it's pointing back along the body of the arrow, not at the thing it's supposed to.

The MWE would be:

\documentclass{article}
\usepackage{chemfig}
\makeatletter
\definearrow1{s>}{%
\ifx\@empty#1\@empty
\expandafter\draw\expandafter[\CF@arrow@current@style,-CF](\CF@arrow@start@node)--(\CF@arrow@end@node);%
\else
\def\curvedarrow@style{shorten <=\CF@arrow@offset,shorten >=\CF@arrow@offset,}%
\CF@expadd@tocs\curvedarrow@style\CF@arrow@current@style
\expandafter\draw\expandafter[\curvedarrow@style,-CF](\CF@arrow@start@name)..controls#1..(\CF@arrow@end@name);
\fi
}

\definearrow1{s<}{%
\ifx\@empty#1\@empty
\expandafter\draw\expandafter[\CF@arrow@current@style,-CF](\CF@arrow@start@node)--(\CF@arrow@end@node);%
\else
\def\curvedarrow@style{shorten <=\CF@arrow@offset,shorten >=\CF@arrow@offset,}%
\CF@expadd@tocs\curvedarrow@style\CF@arrow@current@style
\expandafter\draw\expandafter[\curvedarrow@style,-CF](\CF@arrow@end@name)..controls#1..(\CF@arrow@start@name);
\fi
}
\makeatother

\begin{document}

\schemestart
    F
\arrow(.0--.90){s<[+(90:1) and +(0:1)]}[-45,1.2]
    A
\arrow(a.90--b.180){s>[+(90:1) and +(180:1)]}[45,1.2]
    B
\arrow(.0--c.90){s>[+(0:1) and +(90:1)]}[-45,1.2]
    C
\arrow(.-90--d.0){s>[+(-90:1) and +(0:1)]}[-135,1.2]
    D
\arrow(.180--@a.-90){s>[+(180:1) and +(-90:1)]}[135,1.2]
\arrow(@c.90--g.180){s<[+(180:1) and +(90:1)]}[45,1.2]
    G
\schemestop

\end{document}

Reaction cycle, as expected

The thing is, this works fine. The arrows are exactly how they should be. It's only once I start putting actual stuff into the scheme that things go wrong:

\schemestart
    \chemname{\chemfig{R-[:240,0.6](-[:300,0.6]H)=[:180,0.6](-[:240,0.6]R)-[:120,0.6]Nu}}{\textbf{5}}
\arrow(.0--.90){s<[+(90:1) and +(0:1)]}[-45,1.2]
    \chemname{\chemleft[
        \subscheme{
            \chemfig{R-[:240,0.6](-[:300,0.6]AuL_n)=[:180,0.6](-[:240,0.6]R)-[:120,0.6]Nu}
        \arrow{0}[90,0.1]
            \+
        \arrow{0}[90,0.1]
            \chemfig{H^\oplus}
        }
    \chemright]}{\textbf{4}}
\arrow(a.90--b.180){s>[+(90:1) and +(180:1)]}[45,1.2]
    \chemname[-20pt]{\chemfig{-[:0,1.35,,,draw=none]AuL_n^\oplus-[:0,1.35,,,draw=none]}}{\textbf{1}}%\vspace{-20pt}
\arrow(.0--c.90){s>[+(0:1) and +(90:1)]}[-45,1.2]
    \chemname{\chemleft[
        \chemfig{R-[:180,0.6]~[:180,0.3](-[:60,1,,,draw=none]@{a2}NuH)(-[:-90,0.65,,,dash pattern=on 1pt off 1.5pt]AuL_n^\oplus)~[:180,0.3]@{a1}-[:180,0.6]R}
    \chemright]}{\textbf{2}}
\arrow(.-90--d.0){s>[+(-90:1) and +(0:1)]}[-135,1.2]
    \chemname{\chemleft[
        \chemfig{R-[:240,0.6](-[:300,0.6]AuL_n)=[:180,0.6](-[:240,0.6]R)-[:120,0.6]HNu^\oplus}
    \chemright]}{\textbf{3}}
\arrow(.180--@a.-90){s>[+(180:1) and +(-90:1)]}[135,1.2]
\arrow(@c.90--g.180){s<[+(180:1) and +(90:1)]}[45,1.2]
    \subscheme{
    \chemfig{NuH}
    \arrow{0}[-90,0.2]
    \+
    \arrow{0}[-90,0.2]
    \chemfig{R-[:180,0.6]~[:180,0.6]-[:180,0.6]R}
    }
\schemestop
\chemmove{\draw[shorten >=4pt](a2).. controls +(180:5mm) and +(100:5mm).. (a1);}

Now things go wrong I don't understand what's going wrong here. It's the same arrows, it's just what they're pointing to that's different. I tried rearranging the code so that it draw the structures in a different order, but that just changes which arrow gets messed up. What's happening here?

  • It's from the chemfig v1.31 manual, section 10.2. – Noteless Scholar May 16 '18 at 17:24
  • OK, thanks! I didn't know that. – user121799 May 16 '18 at 17:37
4

Just set the offset for the arrow a little longer. I marked out the change with a commented arrow in the code below.

\documentclass{article}
\usepackage{chemfig}
\makeatletter
\definearrow1{s>}{%
\ifx\@empty#1\@empty
\expandafter\draw\expandafter[\CF@arrow@current@style,-CF](\CF@arrow@start@node)--(\CF@arrow@end@node);%
\else
\def\curvedarrow@style{shorten <=\CF@arrow@offset,shorten >=\CF@arrow@offset,}%
\CF@expadd@tocs\curvedarrow@style\CF@arrow@current@style
\expandafter\draw\expandafter[\curvedarrow@style,-CF](\CF@arrow@start@name)..controls#1..(\CF@arrow@end@name);
\fi
}

\definearrow1{s<}{%
\ifx\@empty#1\@empty
\expandafter\draw\expandafter[\CF@arrow@current@style,-CF](\CF@arrow@start@node)--(\CF@arrow@end@node);%
\else
\def\curvedarrow@style{shorten <=\CF@arrow@offset,shorten >=\CF@arrow@offset,}%
\CF@expadd@tocs\curvedarrow@style\CF@arrow@current@style
\expandafter\draw\expandafter[\curvedarrow@style,-CF](\CF@arrow@end@name)..controls#1..(\CF@arrow@start@name);
\fi
}
\makeatother

\begin{document}
%\setchemfig{scheme debug = true}
\schemestart
\chemname{\chemfig{R-[:240,0.6](-[:300,0.6]H)=[:180,0.6](-[:240,0.6]R)-[:120,0.6]Nu}}{\textbf{5}}
\arrow(.0--.90){s<[+(90:1) and +(0:1)]}[-45,1.2]
\chemname{\chemleft[
    \subscheme{
        \chemfig{R-[:240,0.6](-[:300,0.6]AuL_n)=[:180,0.6](-[:240,0.6]R)-[:120,0.6]Nu}
        \arrow{0}[90,0.1]
        \+
        \arrow{0}[90,0.1]
        \chemfig{H^\oplus}
    }
    \chemright]}{\textbf{4}}
\arrow(a.90--b.180){s>[+(90:1) and +(180:1)]}[45,1.2]
\chemname[-20pt]{\chemfig{-[:0,1.35,,,draw=none]AuL_n^\oplus-[:0,1.35,,,draw=none]}}{\textbf{1}}%\vspace{-20pt}
\arrow(.0--c.90){s>[+(0:1) and +(90:1)]}[-45,1.2]
\chemname{\chemleft[
    \chemfig{R-[:180,0.6]~[:180,0.3](-[:60,1,,,draw=none]@{a2}NuH)(-[:-90,0.65,,,dash pattern=on 1pt off 1.5pt]AuL_n^\oplus)~[:180,0.3]@{a1}-[:180,0.6]R}
    \chemright]}{\textbf{2}}
\arrow(.-90--d.0){s>[+(-90:1) and +(0:1)]}[-135,1.2]
\chemname{\chemleft[
    \chemfig{R-[:240,0.6](-[:300,0.6]AuL_n)=[:180,0.6](-[:240,0.6]R)-[:120,0.6]HNu^\oplus}
    \chemright]}{\textbf{3}}
\arrow(.180--@a.-90){s>[+(180:1) and +(-90:1)]}[135,1.2]
\arrow(@c.90--g.180){s<[+(180:1) and +(90:2.7)]}[45,1.2]% <------------
\subscheme{
    \chemfig{NuH}
    \arrow{0}[-90,0.2]
    \+
    \arrow{0}[-90,0.2]
    \chemfig{R-[:180,0.6]~[:180,0.6]-[:180,0.6]R}
}
\schemestop
\chemmove{\draw[shorten >=4pt](a2).. controls +(180:5mm) and +(100:5mm).. (a1);}

\end{document}

enter image description here

You may need to tweak the values a little yourself to make it more symmetrical.

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.