如何在 chemfig 中剪切“U”形箭头的左侧?

如何在 chemfig 中剪切“U”形箭头的左侧?

我想减少 chemfig 中“U”箭头的左侧。

\arrow{-U>[][\chemfig{ROH}][][.25]}[0,2]

在此处输入图片描述

使用“缩短”命令会导致变形。

\arrow{-U>[][\chemfig{ROH}][][.25]}[0,2,shorten <=20pt]

在此处输入图片描述

有什么建议吗?

答案1

在此处输入图片描述

我复制了类型箭头的定义-lU>,将其重命名为,-lU>并改变了标有的行<--------

\documentclass{article}
\usepackage{chemfig}

\catcode`\_=11
\definearrow5{-lU>}{%
    \CF_arrowshiftnodes{#3}%
    \CF_expafter{\draw[}\CF_arrowcurrentstyle](\CF_arrowstartnode)--(\CF_arrowendnode)node[near start](Uarrow@arctangent){};% <-------- replaced [midway] with [near start]. Alternatively, use [pos=0.25] or any other value of your choice to fine tune the arrow position.
    \CF_ifempty{#4}
        {\def\CF_Uarrowradius{0.333}}
        {\def\CF_Uarrowradius{#4}}%
    \CF_ifempty{#5}%
        {\def\CF_Uarrowabsangle{60}}
        {\pgfmathsetmacro\CF_Uarrowabsangle{abs(#5)}}% ne prendre en compte que la valeur absolue de l'angle
    \expandafter\draw\expanded{[\CF_ifempty{#1}{draw=none}{\unexpanded\expandafter{\CF_arrowcurrentstyle}},-]}(Uarrow@arctangent)%
        arc[radius=\CF_compoundsep*\CF_currentarrowlength*\CF_Uarrowradius,start angle=\CF_arrowcurrentangle-90,delta angle=-\CF_Uarrowabsangle]node(Uarrow@start){};
    \expandafter\draw\expanded{[\CF_ifempty{#2}{draw=none}{\unexpanded\expandafter{\CF_arrowcurrentstyle}}]}(Uarrow@arctangent)%
        arc[radius=\CF_compoundsep*\CF_currentarrowlength*\CF_Uarrowradius,start angle=\CF_arrowcurrentangle-90,delta angle=\CF_Uarrowabsangle]node(Uarrow@end){};
    \pgfmathsetmacro\CF_temp{\CF_Uarrowradius*cos(\CF_arrowcurrentangle)<0?"-":"+"}%
    \ifdim\CF_Uarrowradius pt>0pt
        \CF_arrowdisplaylabel{#1}{0}\CF_temp{Uarrow@start}{#2}{1}\CF_temp{Uarrow@end}%
    \else
        \CF_arrowdisplaylabel{#2}{0}\CF_temp{Uarrow@start}{#1}{1}\CF_temp{Uarrow@end}%
    \fi
}
\catcode`\_=8


\begin{document}
\schemestart
A
\arrow{-U>[][\chemfig{ROH}][][.25]}[0,2]
original
\schemestop

\schemestart
A
\arrow{-lU>[][\chemfig{ROH}][][.25]}[0,2]
modified
\schemestop
\end{document}

相关内容