答案1
因为您可以\chemfig
在环境中使用tikzpicture
,所以您可以将三个化合物(如果这不是正确的名称,请原谅我)放在\node
s 里面,然后用它\draw
来绘制箭头:
\documentclass{article}
\usepackage{chemfig}
\usetikzlibrary{positioning,calc}
\begin{document}
\definesubmol\Me[H_3C]{CH_3}
\begin{tikzpicture}[node distance=0cm and 2cm]
\node (A)
{\chemfig{R-C-[::-60]O-[::-60]C-[::-60]R}};
\node[above right=of A] (B)
{\chemfig{*6((-!\Me)=(-!\Me)-(-!\Me)=(-!\Me)-(-!\Me)=(-!\Me)-)}
};
\node[below right=of A] (C)
{\chemfig{CH_3CH_2-[:-60,,3]C(-[:-120]H_3C)=C(-[:-60]H)-[:60]C{(}CH_3{)}_3}};
\draw[-stealth] (A) -- ( $ (A.0)!0.5!(B.west|-A.0) $ ) |- (B.west) node[auto,pos=0.7] {i,j};
\draw[-stealth] (A) -- ( $ (A.0)!0.5!(C.west|-A.0) $ ) |- (C.west) node[auto,pos=0.7] {j};
\end{tikzpicture}
\end{document}
答案2
你说“从语义上讲,它与\merge
命令完全相反”,那么让我们定义一个\fork
命令是相反\merge
。为此,我使用etoolbox
的\patchcmd
。这个想法很简单:定义一个布尔开关\iffork
并根据状态添加箭头。然后定义\merge
它以相同的方式设置和,但\forkfalse
使用。\fork
\forktrue
开始了:
\documentclass{article}
\usepackage{chemfig}
\usepackage{etoolbox}
\makeatletter
\newif\iffork
\patchcmd\CF@merge@ii{-CF@full}{\iffork\else -CF@full\fi}{}{}%
% \CF@merge@iii needs to be patched twice:
\patchcmd\CF@merge@iii{>=0]}{>=0,\iffork CF@full-\fi]}{}{}%
\patchcmd\CF@merge@iii{>=0]}{>=0,\iffork CF@full-\fi]}{}{}%
\patchcmd\CF@schemestart@i
{\let\merge\CF@merge}
{%
\def\merge{\forkfalse\CF@merge}%
\def\fork{\forktrue\CF@merge}%
}
{}{}
\patchcmd\CF@schemestart@v{\merge}{\merge\fork}{}{}
\makeatother
\begin{document}
\schemestart
a \arrow{0} b \arrow{0} c
\merge{v}(c1)(c2)(c3)--() d
\schemestop
\bigskip
\schemestart
a \arrow{0} b \arrow{0} c
\fork{v}(c1)(c2)(c3)--() d
\schemestop
\end{document}