用户@runiq 和@clemens 出现在在 chemfig 中写下方箭头(\arrow{-U>})的简单方法?如何使用 chemfig 定义新的箭头类型,\definearrow
效果很好。我不是 tikz 专家,但有人能给我提示一下如何更改箭头尖端,以便我在下面有一个水平平衡箭头 (<=>) 和一个拱形双箭头 (<->)?提前感谢任何帮助。
答案1
感谢@Gregor-Perčič 为我指明了正确的方向。文件 chemfig.tex 中提到如何在 Chemfig 中设置默认箭头?是一个很好的资源,里面有很多\definearrow
命令,可以让你了解新箭头的定义是如何工作的。我扩展了-X>
@runiq 定义的箭头在 chemfig 中写下方箭头(\arrow{-U>})的简单方法?并将其命名为<X>
,您可以在下面看到结果。再次感谢您的帮助。
梅威瑟:
\documentclass{article}
\usepackage{geometry}
\usepackage{chemfig}
\makeatletter
\definearrow{9}{<X>}{%
\CF@arrow@shift@nodes{#7}%
%\expandafter\draw\expandafter[\CF@arrow@current@style,-CF](\CF@arrow@start@node)--(\CF@arrow@end@node)node[midway](Xarrow@arctangent){};%
\path[allow upside down](\CF@arrow@start@node)--(\CF@arrow@end@node)%
node[pos=0,sloped,yshift=1pt](\CF@arrow@start@node @u0){}%
node[pos=0,sloped,yshift=-1pt](\CF@arrow@start@node @d0){}%
node[pos=1,sloped,yshift=1pt](\CF@arrow@start@node @u1){}%
node[pos=1,sloped,yshift=-1pt](\CF@arrow@start@node @d1){}%
node[midway,yshift=1pt](Xarrow@arctangent@u){}%
node[midway,yshift=-1pt](Xarrow@arctangent@d){};%
\begingroup
\pgfarrowharpoontrue
\expandafter\draw\expandafter[\CF@arrow@current@style](\CF@arrow@start@node @u0)--(\CF@arrow@start@node @u1);%
\expandafter\draw\expandafter[\CF@arrow@current@style](\CF@arrow@start@node @d1)--(\CF@arrow@start@node @d0);%
\endgroup
\edef\CF@tmp@str{\ifx\@empty#1\@empty[draw=none]\fi}%
\expandafter\draw\CF@tmp@str (Xarrow@arctangent@u)%
arc[radius=\CF@compound@sep*\CF@current@arrow@length*\ifx\@empty#8\@empty0.333\else#8\fi,start angle=\CF@arrow@current@angle-90,%
delta angle=-\ifx\@empty#9\@empty60\else#9\fi]node(Xarrow1@start){};
\edef\CF@tmp@str{[\ifx\@empty#2\@empty draw=none,\fi-CF]}%
\expandafter\draw\CF@tmp@str (Xarrow@arctangent@u)%
arc[radius=\CF@compound@sep*\CF@current@arrow@length*\ifx\@empty#8\@empty0.333\else#8\fi,start angle=\CF@arrow@current@angle-90,%
delta angle=\ifx\@empty#9\@empty60\else#9\fi]node(Xarrow1@end){};
\edef\CF@tmp@str{[\ifx\@empty#4\@empty draw=none,\fi-CF]}%
\expandafter\draw\CF@tmp@str (Xarrow@arctangent@d)%
arc[radius=\CF@compound@sep*\CF@current@arrow@length*\ifx\@empty#8\@empty0.333\else#8\fi,start angle=\CF@arrow@current@angle+90,%
delta angle=\ifx\@empty#9\@empty60\else#9\fi]node(Xarrow2@start){};
\edef\CF@tmp@str{[\ifx\@empty#5\@empty draw=none,\fi-CF]}%
\expandafter\draw\CF@tmp@str (Xarrow@arctangent@d)%
arc[radius=\CF@compound@sep*\CF@current@arrow@length*\ifx\@empty#8\@empty0.333\else#8\fi,start angle=\CF@arrow@current@angle+90,%
delta angle=-\ifx\@empty#9\@empty60\else#9\fi]node(Xarrow2@end){};
\edef\CF@tmp@str{\if\string-\expandafter\@car\detokenize{#7.}\@nil-\else+\fi}%
\CF@arrow@display@label{#1}{0}\CF@tmp@str{Xarrow1@start}{#2}{1}\CF@tmp@str{Xarrow1@end}%
\CF@arrow@display@label{#3}{0.5}\CF@tmp@str\CF@arrow@start@node{}{}{}\CF@arrow@end@node%
\edef\CF@tmp@str{\if\string-\expandafter\@car\detokenize{#7.}\@nil+\else-\fi}%
\CF@arrow@display@label{#4}{0}\CF@tmp@str{Xarrow2@start}{#5}{1}\CF@tmp@str{Xarrow2@end}%
\CF@arrow@display@label{#6}{0.5}\CF@tmp@str\CF@arrow@start@node{}{}{}\CF@arrow@end@node%
}
\makeatother
\begin{document}
\begin{equation}
\setatomsep{1.3em}
\schemestart
\chemname{\chemfig*{CH_3-C(=[::90]O)-{\color{blue}^{13}C}OO^{-}}}{pyruvate}
\arrow(.mid east--.mid west){<X>[][][\footnotesize alanine transaminase (ALT)][\footnotesize glutamate][\footnotesize $\alpha$-ketoglutarate][]}[,2.7]
\chemname{\chemfig*{CH_3-CH(-[::90]NH_3)- {\color{blue}^{13}C}OO^{-}}}{alanine}
\schemestop
\end{equation}
\end{document}
结果如下: