我正在尝试使用 Latex 创建这样的图表。(我正在尝试自学用 Latex 书写。)
我能做的最好的代码是这样的:
\documentclass{article}
\begin{document}
\usepackage[all]{xy}
$$
\xymatrix{
\overset{\supset ker(f)}{ker(w)\subset E} \ar[d]_f \ar[dr]_{\pi_f} \ar[r]^w &\mathbb{K} \\
F & E/ker(f) \simeq Im(f) \ar[u]_{w'} }
$$
\end{document}
得出的结果为:
但它并不相同,因为箭头必须从“E”开始而不是在中间ker(w) \subset E
,而且显然这不是我想要的\overset{}
适当的命令。\subset ker(f)
感谢您的关注,抱歉我的英语不好。
答案1
一个更简洁的tikz
替代方案:
\documentclass[tikz, border=3mm]{standalone}
\usepackage{amsmath, amssymb}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[inner sep=5pt, >=latex,
label/.style={auto, inner sep=1pt, circle}
]
\path (0,0) node (E) {$E$}
(120:1.5) node (kerf) {$\ker(f)$}
(180:1.5) node (kerw) {$\ker(w)$}
(4,0) node (K) {$\mathbb{K}$}
(0,-3) node (F) {$F$}
(2,-2) node (EE) {\phantom{$E$}}
(EE.west) node[anchor=west] {$E/\ker(f) \simeq Im(f)$};
\path (E) -- node[sloped] {$\subset$} (kerf);
\path (kerw) -- node[sloped] {$\supset$} (kerf);
\path (kerw) -- node {$\subset$} (E);
\draw[->] (E) -- node[label] {$w$} (K);
\draw[->] (E) -- node[label] {$f$} (F);
\draw[->] (E) -- node[label] {$\pi_f$} (EE);
\draw[->, dashed] (EE) -- node[label] {$w'$} (K);
\end{tikzpicture}
\end{document}
答案2
因为它看起来像一个交换图,那么使用怎么样tikz-cd
?
\documentclass{article}
\usepackage{tikz-cd}
\usepackage{amsmath, amssymb}
\begin{document}
\begin{tikzcd}%
&[-30pt] \ker(f) \arrow[dl, phantom, sloped, "\supset"] \arrow[dr, phantom, sloped, "\subset"]&[-30pt] & &[-75pt] \\[-4pt]
\ker(w) \arrow[rr, phantom, "\subset"]& & E \arrow[rr, "w"] \arrow[rd, end anchor={[xshift=.5em]north west}, "\pi_f"] \arrow[dd, swap, "f"] & & \mathbb{K}\\
& & & E/\ker(f) \simeq Im(f) \arrow[ru, dashrightarrow, start anchor={[xshift=1.1em]north west}, swap, "w'"]& \\
& & F & &
\end{tikzcd}%
\end{document}
答案3
TikZ 的替代品(它并不那么简洁pstricks
:
\documentclass[tikz, border=3mm]{standalone}
\usetikzlibrary{arrows.meta, positioning, quotes, shapes.multipart}
\usepackage{amsmath, amssymb}
\DeclareMathOperator{\ar}{ar}
\usepackage{graphicx}
\begin{document}
\begin{tikzpicture}[
node distance = 22mm and 24mm,
every label/.style = {label distance=0mm, inner sep=0mm,
xshift=1em, align=center},
RS/.style = {%Rectangle Split
rectangle split, rectangle split horizontal, rectangle split parts=2,
inner ysep=1mm, inner xsep=0mm}
]
\node (n1) [RS,label={$\ker(f)$\\
\rotatebox[origin=c]{240}{$\subset$}
\qquad
\rotatebox[origin=c]{300}{$\subset$}}]
{\nodepart{one} $\ker(w)\quad\subset\quad$
\nodepart{two} $E$
};
\node (n2) [right=of n1] {$\mathbb{K}$};
\node (n3) [below=of n1.two south] {$F$};
\node (n4) [RS,right=of n3]
{\nodepart{one} $E/$
\nodepart{two} $\ker(f) \simeq Im(f) \ar[u]_{w'}$
};
\draw[-Latex] (n1) edge ["$w$"] (n2)
(n1.two south) edge ["$f$"] (n3)
(n1.south east) edge ["$\pi_f$"] (n4.north west)
(n4.one north) to ["$w'$"] (n2);
\end{tikzpicture}
\end{document}
答案4
这是一种简单的方法pstricks
:
\documentclass[11pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}%
\usepackage{lmodern, amssymb}
\usepackage{mathtools}
\usepackage{pst-node, auto-pst-pdf}
\DeclareMathOperator{\Img}{Im}
\newpsobject{ncemptyline}{ncline}{linestyle=none, arrows=-}
\newcommand*\ncsubset[2]{\ncemptyline{#1}{#2}\ncput[nrot=:U]{\subset}}
\begin{document}
\psset{shortput=tab, arrows=->, linewidth=0.6pt, nodesep=3pt}
\def\pscolhookiv{\hskip0.5cm}
\everypsbox{\scriptstyle}
$ \begin{psmatrix}[rowsep=0.6, colsep=0.4]
& [name = Kf] \ker f \\
[name = Kom] \kerω& & [name = E] E & & [name =K] K\\
& & & [name = Cok] E/\ker f\mathrlap{\, ≃ \Img f} \\
& & [name = F] F%
%\nput{0}{Cok}{\!\!\!{} ≃ {}\Img f}
\ncline{E}{K}^{ω} \ncline{E}{F}_{f}%
\ncline{E}{Cok}\naput[labelsep=0pt]{\pi_f}%
\ncline[linestyle=dashed]{Cok}{K}\nbput[npos=0.6,labelsep=0pt]{\omega'}
\ncsubset{Kf}{Kom}\ncsubset{Kf}{E}
\end{psmatrix} $
\end{document}