我在 xy pics 中制作了一个相当复杂的化学反应系统图,但为了使所有反应速率可见,我必须改变它们在箭头上的位置,要么让它们更靠近箭头,要么让它们远离箭头,或者改变它们沿箭头长度的出现位置。到目前为止,我还没有成功使文档中的任何命令对此有所帮助。
有人可以告诉我它是怎么做的吗?
\documentclass{article}
\usepackage{color}
\usepackage[color,matrix,arrow]{xy}
\begin{document}
\[
\xymatrix{
&&A_1+A_2+L+L \ar@<-.5ex>[ddl]_{k_{a2}}
\ar@<+.5ex>[ddr]^{k_{a1}}&&\\
&&&&\\
&A_1+A_2L+L\ar@<-.5ex>[ddl]_{k_{a22}}
\ar@<-.5ex>[uur]_{k_{d2}}
\ar@<+.5ex>[rdd]^{k_{a1}}
\ar@<+.5ex>@[lightgray][rddd]^{\textcolor{lightgray}{k_{a21}}}& & A_1L+A_2+L \ar@<.5ex>@[lightgray][lddd]^{\textcolor{lightgray}{k_{a12}}}
\ar@<.5ex>[ddl]^{k_{a2}}
\ar@<+.5ex>[luu]^{k_{d1}}
\ar@<+.5ex>[rdd]^{k_{a11}}&\\
&&&&\\
A_1+LA_2L\ar@<-.5ex>[uur]_{k_{d22}}
\ar@<+.5ex>[ddr]^{k_{a221}} && A_1L+A_2L\ar@<.5ex>[uur]^{k_{d2}}
\ar@<.5ex>[ddl]^{k_{a212}}
\ar@<+.5ex>[uul]^{k_{d1}}
\ar@<+.5ex>[ddr]^{k_{a121}} & & LA_1L+A_2 \ar@<+.5ex>[ddl]^{k_{a112}}
\ar@<+.5ex>[uul]^{k_{d11}} \\
&&\textcolor{lightgray}{A_1LA_2+L}\ar@<.5ex>@[lightgray][uuur]^{\textcolor{lightgray}{k_{d12}}}
\ar@<+.5ex>@[lightgray][uuul]^{\textcolor{lightgray}{k_{d21}}}
\ar@<+.5ex>@[lightgray][dr]^{\textcolor{lightgray}{k_{a121}}}
\ar@<.5ex>@[lightgray][dl]^{\textcolor{lightgray}{k_{a212}}} &&\\
&LA_2LA_1\ar@<.5ex>@[lightgray][ur]^{\textcolor{lightgray}{k_{d212}}}
\ar@<.5ex>[uur]^{k_{d212}}
\ar@<+.5ex>[uul]^{k_{d221}}
\ar@<+.5ex>[ddr]^{k_{a2211}} & & LA_1LA_2\ar@<.5ex>[uur]^{k_{d112}}
\ar@<.5ex>[ddl]^{k_{a1122}}
\ar@<+.5ex>[uul]^{k_{d121}}
\ar@<+.5ex>@[lightgray][ul]^{\textcolor{lightgray}{k_{d121}}} &\\
&&&&\\
& & (LA_1LA_2)_r,\ar@<.5ex>[uur]^{k_{d1122}}
\ar@<+.5ex>[uul]^{k_{d2211}}& & \\
}
\]
答案1
你确定你看过手册了吗?你的问题在 CTAN 网站上提到的论文中已经明确解决了(Using XY-pic
在https://ctan.org/pkg/xypic)。
我以前从未使用过这个包——代码看起来像猫走过了键盘:)。我想我会使用手册中的代码片段来设置我的下一个网上银行密码:)。
\documentclass{article}
\usepackage[all]{xy}
%
\begin{document}
% \frame{} is just for illustration purposes.
% Taken from the Paper: Using XY-pic on https://ctan.org/pkg/xypic
\frame{\begin{xy}
(0,0)*+{A}; (20,0)*+{B} **\dir{-}%
?>*\dir{>} ?*!/_2mm/{\alpha}
\end{xy}}
\frame{\begin{xy}
(0,0)*+{A}; (20,0)*+{B} **\dir{-}%
?>*\dir{>} ?*!/_4mm/{\alpha}
\end{xy}}
% ?<
\frame{\begin{xy}
(0,0)*+{A}; (20,0)*+{B} **\dir{-}%
?>*\dir{>} ?<*!/_2mm/{\alpha}
\end{xy}}
% ?>
\frame{\begin{xy}
(0,0)*+{A}; (20,0)*+{B} **\dir{-}%
?>*\dir{>} ?>*!/_2mm/{\alpha}
\end{xy}}
% ?(0.5)
\frame{\begin{xy}
(0,0)*+{A}; (20,0)*+{B} **\dir{-}%
?>*\dir{>} ?(0.5)*!/_2mm/{\alpha}
\end{xy}}
% ?(0.8)
\frame{\begin{xy}
(0,0)*+{A}; (20,0)*+{B} **\dir{-}%
?>*\dir{>} ?(0.8)*!/_2mm/{\alpha}
\end{xy}}
\end{document}
答案2
我决定将其作为 xymatrix 的代码:
\xymatrix{
&&A_1+A_2+L+L \ar@<-.5ex>[dl]_{k_{a2}}
\ar@<+.5ex>[dr]^{k_{a1}}&&\\
&A_1+A_2L+L\ar@<-.5ex>[dl]_{k_{a22}}
\ar@<-.5ex>[ur]_{k_{d2}}
\ar@<+.5ex>[rd]^{k_{a1}}
\ar@<+.5ex>@[lightgray][rddd]^{\textcolor{lightgray}{k_{a21}}}& & A_1L+A_2+L \ar@<.5ex>@[lightgray][lddd]^</2cm/{\textcolor{lightgray}{k_{a12}}}
\ar@<.5ex>[dl]^{k_{a2}}
\ar@<+.5ex>[lu]^{k_{d1}}
\ar@<+.5ex>[rd]^{k_{a11}}&\\
A_1+LA_2L\ar@<-.5ex>[ur]_{k_{d22}}
\ar@<+.5ex>[ddr]^{k_{a221}} && A_1L+A_2L\ar@<.5ex>[ur]^{k_{d2}}
\ar@<.5ex>[ddl]^{k_{a212}}
\ar@<+.5ex>[ul]^{k_{d1}}
\ar@<+.5ex>[ddr]^{k_{a121}} & & LA_1L+A_2 \ar@<+.5ex>[ddl]^{k_{a112}}
\ar@<+.5ex>[ul]^{k_{d11}} \\
&&&&\\
&LA_2LA_1\ar@<.5ex>@[lightgray][r]^{\textcolor{lightgray}{k_{d212}}}
\ar@<.5ex>[uur]^{k_{d212}}
\ar@<+.5ex>[uul]^{k_{d221}}
\ar@<+.5ex>[ddr]^{k_{a2211}} &\textcolor{lightgray}{A_1LA_2+L}\ar@<.5ex>@[lightgray][uuur]^{\textcolor{lightgray}{k_{d12}}}
\ar@<+.5ex>@[lightgray][uuul]^</3cm/{\textcolor{lightgray}{k_{d21}}}
\ar@<+.5ex>@[lightgray][r]^{\textcolor{lightgray}{k_{a121}}}
\ar@<.5ex>@[lightgray][l]^{\textcolor{lightgray}{k_{a212}}} & LA_1LA_2\ar@<.5ex>[uur]^{k_{d112}}
\ar@<.5ex>[ddl]^{k_{a1122}}
\ar@<+.5ex>[uul]^{k_{d121}}
\ar@<+.5ex>@[lightgray][l]^{\textcolor{lightgray}{k_{d121}}} &\\
&&&&\\
& & (LA_1LA_2)_r,\ar@<.5ex>[uur]^{k_{d1122}}
\ar@<+.5ex>[uul]^</1cm/{k_{d2211}}& & \\
}
带有移位标签的各个箭头的代码编码为:
\ar@<+.5ex>[uul]^</1cm/{k_{d2211}}