答案1
与 TikZ 进行比较
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\def\a{1.5} \def\b{2}
\path
(-\a,0) node (A) {$A$}
(\a,0) node (B) {$B$}
(0,-\b) node[align=center] (C) {$C$\\[-1mm]\rotatebox{90}{=}\\[-1mm]$D$};
\begin{scope}[nodes={midway,scale=.75}]
\draw[->] (A)--(B) node[above]{$f$};
\draw[->] (A)--(C.120) node[left]{$g$};
\draw[->] (C.60)--(B) node[right]{$h$};
\end{scope}
\end{tikzpicture}
\end{document}
... 和 Asymptote (与上图几乎相同)
real a=1.5cm, b=2cm; // need to specify the unit (cm)
pair A=(-a,0), B=(a,0), C=(0,-b);
object
oA=draw("",ellipse,A,xmargin=3mm,Draw(white)), /// box or roundbox is ok!
oB=draw("",ellipse,B,xmargin=3mm,Draw(white)),
oC=draw("",ellipse,C,xmargin=3mm,Draw(white));
label("$A$",A); label("$B$",B); label("$C$",C);
label(rotate(90)*"$=$",point(oC,S));
label("$D$",point(oC,S)+(0,-.4cm));
pair
A1=point(oA,E), A2=point(oA,dir(-60)),
B1=point(oB,W), B2=point(oB,dir(-120)),
C1=point(oC,dir(135)), C2=point(oC,dir(45))
;
DefaultHead=TeXHead;
draw(Label(scale(.75)*"$f$",align=N),A1--B1,Arrow());
draw(scale(.75)*"$g$",A2--C1,Arrow());
draw(scale(.75)*"$h$",C2--B2,Arrow());
更新我们可以用普通的 TikZ 控制几乎任何东西。要更改箭头、箭头长度、距离 C、D:
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
[>={Classical TikZ Rightarrow[length=1.2mm]}]
\def\a{1.5} \def\b{2}
\path[nodes={inner sep=1pt}]
(-\a,0) node (A) {$A$}
(\a,0) node (B) {$B$}
(0,-\b) node[align=center] (C) {$C$\\[-1.3mm]\rotatebox{90}{=}\\[-1.5mm]$D$};
\begin{scope}[nodes={midway,scale=.75}]
\draw[->] (A)--(B) node[above]{$f$};
\draw[->] (A)--(C.120) node[left]{$g$};
\draw[->] (C.60)--(B) node[right]{$h$};
\end{scope}
\end{tikzpicture}
\end{document}
答案2
答案3
我还补充我的建议:
\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[row sep= 1cm, column sep=.6cm]
A \arrow[rd, "g"'] \arrow[rr, "f"] & & B \arrow[ld, "h"] \\
& \underset{\textstyle{D}}{\overset{\textstyle{C}}{\shortparallel}} &
\end{tikzcd}
\end{document}