Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MW for -X> arrow
\documentclass{article}
\usepackage{chemfig}
\makeatletter
\definearrow9{-X>}{%
\CF@arrow@shift@nodes{#7}%
\expandafter\draw\expandafter[\CF@arrow@current@style,-CF@full](\CF@arrow@start@node)--(\CF@arrow@end@node)node[midway](Xarrow@arctangent){};%
\edef\CF@tmp@str{\ifx\@empty#1\@empty[draw=none]\fi}%
\expandafter\draw\CF@tmp@str (Xarrow@arctangent)%
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@full]}%
\expandafter\draw\CF@tmp@str (Xarrow@arctangent)%
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}%
\expandafter\draw\CF@tmp@str (Xarrow@arctangent)%
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@full]}%
\expandafter\draw\CF@tmp@str (Xarrow@arctangent)%
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}
\schemestart
A
\arrow{-X>[1][2][3][4][5][6][0.5em][0.1][90]}[12,1.8]
B
\schemestop
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment