Tikz 绘图的内容太复杂了,目前没有精力去仔细学习,只是简单记录一些可能用到的例子。

tikz-cd

交换图

绘制简易交换图也是一个常见的需求,可以使用 tikz-cd 宏包实现。

例如

1
2
3
4
5
6
7
8
9
10
\begin{tikzcd}
T
\arrow[drr, bend left, "x"]
\arrow[ddr, bend right, "y"]
\arrow[dr, dotted, "{(x,y)}" description] & & \\
& X \times_Z Y \arrow[r, "p"] \arrow[d, "q"]
& X \arrow[d, "f"] \\
& Y \arrow[r, "g"]
& Z
\end{tikzcd}

简易概念图

可以用 tikz-cd 绘制一些概念图。

例如

对应源码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz-cd}
\usepackage{amsmath}

\begin{document}

\begin{tikzcd}[row sep=huge, column sep=huge,
every label/.append style={font=\normalsize}]
X_{11} \arrow[d, dashed] \arrow[rr,"{\textsf{ABC}}"] & & X_{21} \arrow[d, dashed] \\
X_{21} \arrow[d,"{\textsf{UVW}}", dashed] \arrow[rr, "{\textsf{DEF}}"] & & X_{22}\arrow[d, dashed] \\
X_{31} \arrow[rr, "{\textsf{XYZ}}", red] & & X_{32}
\end{tikzcd}

\end{document}

例如

对应源码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz-cd}
\usepackage{amsmath}

\begin{document}

\begin{tikzcd}[row sep=huge, column sep=huge,
every label/.append style={font=\normalsize}]
\mathcal{P}{}_h^\varepsilon \arrow[dd,"{\textsf{$h \to 0$}}" swap, dashed] \arrow[rr, "{\textsf{$\varepsilon \to 0$}}"] & & \mathcal{P}{}_h^0 \arrow[dd,"{\textsf{$h \to 0$}}", dashed]
\\
\\
\mathcal{P}{}^\varepsilon \arrow[rr, "{\textsf{$\varepsilon \to 0$}}" swap] & & \mathcal{P}{}^0
\end{tikzcd}

\end{document}