是什么原因导致反应箭头(chemfig)出现此问题?

是什么原因导致反应箭头(chemfig)出现此问题?

我正在尝试根据一篇论文重现催化循环,但遇到了一个问题。我使用的箭头之一似乎与指向同一节点的其他箭头指向不同的点。此外,箭头的头部被旋转,因此它指向箭头主体的背面,而不是指向它应该指向的地方。

MWE 将是:

\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([email protected]){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}

反应循环如预期

问题是,这很好用。箭头完全符合预期。只有当我开始将实际内容放入方案中时,事情才会出错:

\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([email protected]){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);}

现在事情出错了 我不明白这里出了什么问题。箭头是一样的,只是它们指向的东西不同。我尝试重新排列代码,以便以不同的顺序绘制结构,但这只会改变哪个箭头被弄乱。这里发生了什么?

答案1

只需将箭头的偏移量设置得更长一些。我在下面的代码中用注释箭头标记了变化。

\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([email protected]){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}

在此处输入图片描述

您可能需要自己稍微调整一下值以使其更加对称。

相关内容