获取上方带有弯曲箭头的双头箭头

获取上方带有弯曲箭头的双头箭头

我正在寻找一种方法来绘制一个双头箭头,上面有一个弯曲的箭头,以描述添加另一种试剂的可逆化学反应。

我目前正在使用的脚本如下:

\documentclass[11pt]{article}
\usepackage{mychemistry}
\begin{document}
\setarrowlength{3em}
\large
\begin{rxn}
\reactant[,a]{E}
\chemand
\reactant[,a]{\ch{S1}}
\arrow[0,<=>]{}{}
\reactant[,a]{\ch{ES1}}
\arrow[0,<=>]{}{}
\reactant[,a]{\ch{E'P1}}
\arrow[0,<=>]{}{\arrow{P1}}
\reactant{\ch{E'}}
\arrow[0,-+>]{\ch{S2}}{}
\reactant[,a]{\ch{E'S2}}
\arrow[0,-+>]{}{\ch{P2}}
\reactant[,a]{\ch{E}}
\end{rxn}
\end{document}

给出以下输出: 反应

理想情况下,我想修改这一点,以便右侧的两个箭头是双面箭头,同时仍然保留上面的卷曲箭头。

答案1

使用 并不容易mychemistry。我建议使用chemfig(由 加载mychemistry)。它更加灵活,而且我相信输入也更方便。chemfig允许您定义可在此处使用的自己的箭头类型。在纺织世界针对这种箭头,我建议采用以下解决方案chemfig

在此处输入图片描述

代码如下。代码可能看起来有点复杂,但它基本上是 中现有箭头定义的副本chemfig。我添加了一些注释以作解释。它定义了一个<y>带有几个可选参数的箭头类型:

% define new arrow `<y>' with 7 optional arguments:
% syntax:
% \arrow{-y>[<label arc begin>]%
%           [<label arc end>]%
%           [<label below>]%
%           [<ratio equilibrium arrows>]%
%           [<offset>]%
%           [<ratio arc radius/arrow length>]% default: 0.333
%           [<half angle of arc>]% default: 60
% }

该方案本身的创建相当容易:

\schemestart
 \ch{E}
 \arrow{<=>}
 \ch{S1}
 \arrow{<=>}
 \ch{ES1}
 \arrow{<=>}
 \ch{E'P1}
 \arrow{<=>[][\ch{P1}]}
 \ch{E'}
 \arrow{<y>[\ch{S2}]}
 \ch{E'S2}
 \arrow{<y>[][\ch{P2}]}
 \ch{E}
\schemestop

完整示例

\documentclass[11pt]{article}
\usepackage{chemfig,chemformula}

\makeatletter
% define new arrow `<y>' with 7 optional arguments:
% syntax:
% \arrow{-y>[<label arc begin>]%
%           [<label arc end>]%
%           [<label below>]%
%           [<ratio equilibrium arrows>]%
%           [<offset>]%
%           [<ratio arc radius/arrow length>]% default: 0.333
%           [<half angle of arc>]% default: 60
% }
% this code is a combination of chemfig's arrow types `<=>' and `-U>'
%
\definearrow{7}{<y>}{%
    % offset:
    \CF@arrow@shift@nodes{#5}%
    % coordinates for equilibrium arrows:
    \ifx\@empty#4\@empty
    \else
      \pgfmathsetmacro\CF@tmp@stra{(1-#4)/2}%
      \pgfmathsetmacro\CF@tmp@strb{(1-#4)/2+#4}%
    \fi
    \edef\CF@tmp@str{%
      \noexpand\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=\ifx\@empty#4\@empty0\else\CF@tmp@stra\fi,sloped,yshift=-1pt]
          (\CF@arrow@start@node @d0){}
        node[pos=1,sloped,yshift=1pt](\CF@arrow@start@node @u1){}
        node[pos=\ifx\@empty#4\@empty1\else\CF@tmp@strb\fi,sloped,yshift=-1pt]
        (\CF@arrow@start@node @d1){};%
    }\CF@tmp@str
    % draw main arrows:
    \expandafter\draw\expandafter[\CF@arrow@current@style,-CF@half]
      (\CF@arrow@start@node @u0)--(\CF@arrow@start@node @u1)node[midway](yarrow@arctangent){};%
    \expandafter\draw\expandafter[\CF@arrow@current@style,CF@half-]
      (\CF@arrow@start@node @d0)--(\CF@arrow@start@node @d1);% is there label #1?
    \edef\CF@tmp@str{\ifx\@empty#1\@empty[draw=none]\fi}%
    % if yes draw left half of arc:
    \expandafter\draw\CF@tmp@str (yarrow@arctangent)%
        arc[
          radius=\CF@compound@sep*\CF@current@arrow@length*\ifx\@empty#6\@empty0.333\else#6\fi,
          start angle=\CF@arrow@current@angle-90,
          delta angle=-\ifx\@empty#7\@empty60\else#7\fi
        ]
        node(yarrow@start){};
    % is there label #2?
    \edef\CF@tmp@str{[\ifx\@empty#2\@empty draw=none,\fi-CF@full]}%
    % if yes draw secon half of arc:
    \expandafter\draw\CF@tmp@str (yarrow@arctangent)%
        arc[
          radius=\CF@compound@sep*\CF@current@arrow@length*\ifx\@empty#6\@empty0.333\else#6\fi,
          start angle=\CF@arrow@current@angle-90,
          delta angle=\ifx\@empty#7\@empty60\else#7\fi
        ]
        node(yarrow@end){};
    % place the labels - we need to no the sign of the offset here:
    \edef\CF@tmp@str{\if\string-\expandafter\@car\detokenize{#5.}\@nil-\else+\fi}%
    % place the labels #1 and #2:
    \CF@arrow@display@label{#1}{0}{\CF@tmp@str}{yarrow@start}{#2}{1}{\CF@tmp@str}{yarrow@end}%
    % place label #3:
    \CF@arrow@display@label{#3}{0.5}{-}{\CF@arrow@start@node}{}{}{}{\CF@arrow@end@node}%
}
\makeatother

\begin{document}

\schemestart
 \ch{E}
 \arrow{<=>}
 \ch{S1}
 \arrow{<=>}
 \ch{ES1}
 \arrow{<=>}
 \ch{E'P1}
 \arrow{<=>[][\ch{P1}]}
 \ch{E'}
 \arrow{<y>[\ch{S2}]}
 \ch{E'S2}
 \arrow{<y>[][\ch{P2}]}
 \ch{E}
\schemestop

\end{document}

相关内容