答案1
两种解决方案:一种基于pstricks
,另一种基于tikz-cd
。对于 pstricks 解决方案,pdflatex
如果您使用选项--enable-write18
(MiKTeX) 或-shell-escape
(TeX Live, MacTeX) 启动它,则可以使用 进行编译。或者,您可以使用 进行编译xelatex
:
\documentclass{article}
\usepackage{fourier}
\usepackage{pst-node, auto-pst-pdf}
\usepackage{tikz-cd}
\begin{document}
$ \psset{arrows=->, arrowinset=0.15, nodesep=4pt, colsep=0.8cm, rowsep=0.9cm, linewidth=0.5pt, linejoin=1}
\begin{psmatrix}
%%% nodes
& β& & α\\
b & & a & & c
%%%arrows
\ncline{1,2}{2,1} \ncline{1,2}{2,3}%
\ncline{2,3}{2,1}\ncline{2,3}{2,5}%
\ncline{2,3}{1,4}\ncline{2,5}{1,4}
\end{psmatrix}
$
\vskip 1cm
%\tikzcdset{column sep/normal=0.5cm}
\begin{tikzcd}[column sep=0.5cm, row sep=0.7cm]
& β\dlar \drar & & α\\
b & & a\arrow[ll]\urar\arrow[rr]& & c \ular
\end{tikzcd}
\end{document}
答案2
答案3
这是 Tikz 的基础,我认为你应该先试一下再提问。以下是回复
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{positioning,calc}
\begin{document}
\begin{tikzpicture}
\node (a) at (0,0){a};
\node[left=2cm of a] (b){b};
\node[right=2cm of a] (c){c};
\node[above right=1cm of a] (alpha){$\alpha$};
\node[above left=1cm of a] (beta){$\beta$};
\draw[->] (a) -- (b);
\draw[->] (a) -- (c);
\draw[->] (beta) -- (a);
\draw[->] (beta) -- (b);
\draw (a) -- (alpha);
\draw (c) -- (alpha);
\end{tikzpicture}
\end{document}
答案4
不使用任何包的另一种解决方案:
\documentclass{article}
\begin{document}
\[\begin{array}{c@{}c@{}c@{}c@{}c@{}c@{}c@{}c@{}c}
& & \beta & & & & \alpha\\[-2pt]
& \swarrow & & \searrow & & \nearrow & & \nwarrow\\[-2pt]
b & & \makebox[0pt]{\overleftarrow{~~~~~~~}} & & a & & \makebox[0pt]{\overrightarrow{~~~~~~~}} & & c
\end{array}\]
\end{document}
而且,旧的图片环境仍然存在:
\documentclass{article}
\begin{document}
\setlength{\unitlength}{.5mm}
\begin{picture}(100,25)(2,0)
\put(10,0){$b$}
\put(50,0){$a$}
\put(90,0){$c$}
\put(30,20){$\alpha$}
\put(70,20){$\beta$}
\put(48,1){\vector(-1,0){32}}
\put(57,1){\vector(1,0){32}}
\put(30,18){\vector(-1,-1){14}}
\put(35,18){\vector(1,-1){14}}
\put(70,17){\vector(-1,-1){14}}
\put(75,17){\vector(1,-1){14}}
\end{picture}
\end{document}