我正在尝试使用以下绘制交换图xymatrix
:
\documentclass{article}
\usepackage[all]{xy}
\begin{document}
$\xymatrix{A \ar[rr] & & B \\ & C \ar[ul] \ar[ur] & }$
\end{document}
我怎样才能绘制集体行动的符号?
答案1
或者像这样:
% arara: pdflatex
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\[
\begin{tikzcd}
A \arrow{rr}\arrow[loop left, "G_1"] & & B \arrow[loop right, "G_2"] \\
& C \arrow{ul} \arrow{ur} \arrow[loop below, "G_3"] &
\end{tikzcd}
\]
\end{document}
答案2
这是使用 TiKZ 而不是 xypics 的解决方案。箭头被绘制为具有可修改参数的圆弧;组操作标签的位置和样式也可以变化。
关于代码的一些特别说明:
群体动作用接近完整的圆圈(省略 45° 的转弯)表示,其方向可以通过改变起始和终止角度来修改。
每支箭的末端都被拉长,以便更好地使箭头的方向与弧结束的角度相匹配。
源代码
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[-stealth]
% Position nodes symmetrically about a central point
\node (A) at ({cos(150)},{sin(150)}) {$A$};
\node (B) at ({cos(30)},{sin(30)}) {$B$};
\node (C) at ({cos(270)},{sin(270)}) {$C$};
% Draw arrows between nodes
\draw (A) to (B); \draw (C) to (A); \draw (C) to (B);
% Define co-ordinates for the arrows of the group actions
\coordinate (G1') at ($(A.west) + (-0.5em,0)$);
\coordinate (G2') at ($(B.east) + (0.5em,0)$);
\coordinate (G3') at ($(C.south west) + (0.5em,-2ex)$);
% Draw circular arcs of 1ex radius for the group actions
% (tips are slightly lengthened to optimise orientation of arrow head)
\draw [->, shorten >=-1.5pt] (G1') arc (245:-70:1ex);
\draw [->, shorten >=-1.5pt] (G2') arc (-65:250:1ex);
\draw [->, shorten >=-1.5pt] (G3') arc (315:0:1ex);
% Draw labels for the group actions, smaller than the main nodes
\node (G1) at ($(G1') + (-1em,0)$) {\footnotesize $G_1$};
\node (G2) at ($(G2') + (1em,0)$) {\footnotesize $G_2$};
\node (G3) at ($(G3') + (0,-2ex)$) {\footnotesize $G_3$};
\end{tikzpicture}
\end{document}
结果
答案3
像这样吗?(借助本文档,第 4 页,因为我不太熟练xy-pic
。)
\documentclass{article}
\usepackage[all,cmtip]{xy}
\begin{document}
\[
\xymatrix{ A \ar@(dl,ul)[]^{G_1} \ar[rr] & & B \ar@(dr,ur)[]_{G_2} \\
& C \ar@(dl,dr)[]_{G_3}\ar[ul] \ar[ur] & }
\]
\end{document}
编辑:按照 LaRiFari 的建议,现在cmtip
使用该选项。箭头看起来好多了!