我希望有一个\subseteq
符号,而不是从一个地方到另一个地方的箭头。更具体地说,\subseteq
旋转符号,我相信可以渲染\rotatebox{90}{$\subseteq$}
。
\documentclass[10pt]{amsart}
\usepackage{tikz}
\usetikzlibrary{matrix, arrows, decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}
\matrix (m) [matrix of math nodes,row sep=3em,column sep=4em,minimum width=2em]
{
G & H \\
G/\ker \varphi & \mbox{Im} \varphi \\};
\path[-stealth]
(m-1-1) edge node [left] {$q$} (m-2-1)
edge node [above] {$\varphi$} (m-1-2)
edge node [above] {$\hat{\varphi}$} (m-2-2)
(m-2-1) edge node [below] {$\overline{\varphi}$} (m-2-2) ;
\end{tikzpicture}
\end{document}
因此,我想要做的是,不要用箭头来表示从右下角节点到右上节点的映射,而是用集合包含符号来显示所讨论集合之间的关系。
谢谢!
答案1
使用未绘制的边(或\path
带有 的边),并在包含内容 的--
该边/路径上放置一个节点。sloped
\subseteq
为了比较,我用以下方法制作了相同的图表tikz-cd
。
在您的原始图表中,我添加了一个auto
选项,使沿路径放置节点变得更容易,但对于我们的特殊节点,需要再次禁用该选项。
如果你想避免写那么长
(m-2-2) edge[draw=none]
node [sloped, auto=false,
allow upside down] {$\subseteq$} (m-1-2);
您可以使用一种特殊的样式来实现这一点。tikz-cd
也可以定义一种略有不同的样式。请参阅第二个代码示例。
代码 1
\documentclass[class=amsart,10pt,tikz]{standalone}
\usepackage{tikz,tikz-cd}
\usetikzlibrary{matrix, arrows}
\DeclareMathOperator{\im}{Im}
\begin{document}
\begin{tikzpicture}
\matrix (m) [matrix of math nodes,row sep=3em,column sep=4em,minimum width=2em] {
G & H \\
G/\ker \varphi & \im \varphi \\
};
\path[-stealth, auto] (m-1-1) edge node[swap] {$q$} (m-2-1)
edge node {$\varphi$} (m-1-2)
edge node {$\hat{\varphi}$} (m-2-2)
(m-2-1) edge node[swap] {$\overline{\varphi}$} (m-2-2)
(m-2-2) edge[draw=none]
node [sloped, auto=false,
allow upside down] {$\subseteq$} (m-1-2);
\end{tikzpicture}
\begin{tikzcd}
G \rar{\varphi} \dar[swap]{q}\drar{\hat\varphi}
& H \\
G/\ker\varphi \rar[swap]{\overline\varphi}
& \im \varphi \arrow[draw=none]{u}[sloped,auto=false]{\subseteq}
\end{tikzcd}
\end{document}
代码 2
\documentclass[class=amsart,10pt,tikz]{standalone}
\usepackage{tikz,tikz-cd}
\usetikzlibrary{matrix, arrows}
\DeclareMathOperator{\im}{Im}
\makeatletter
\tikzset{
edge node/.code={%
\expandafter\def\expandafter\tikz@tonodes\expandafter{\tikz@tonodes #1}}}
\makeatother
\tikzset{
subseteq/.style={
draw=none,
edge node={node [sloped, allow upside down, auto=false]{$\subseteq$}}},
Subseteq/.style={
draw=none,
every to/.append style={
edge node={node [sloped, allow upside down, auto=false]{$\subseteq$}}}
}
}
\begin{document}
\begin{tikzpicture}
\matrix (m) [matrix of math nodes,row sep=3em,column sep=4em,minimum width=2em]{
G & H \\
G/\ker \varphi & \im \varphi \\
};
\path[-stealth, auto] (m-1-1) edge node[swap] {$q$} (m-2-1)
edge node {$\varphi$} (m-1-2)
edge node {$\hat{\varphi}$} (m-2-2)
(m-2-1) edge node[swap] {$\overline{\varphi}$} (m-2-2)
(m-2-2) edge[subseteq] (m-1-2);
\end{tikzpicture}
\begin{tikzcd}
G \rar{\varphi} \dar[swap]{q}\drar{\hat\varphi}
& H \\
G/\ker\varphi \rar[swap]{\overline\varphi}
& \im \varphi \arrow[Subseteq]{u}{}
\end{tikzcd}
\end{document}
输出