![在交换图中任意添加符号](https://linux22.com/image/347682/%E5%9C%A8%E4%BA%A4%E6%8D%A2%E5%9B%BE%E4%B8%AD%E4%BB%BB%E6%84%8F%E6%B7%BB%E5%8A%A0%E7%AC%A6%E5%8F%B7.png)
到目前为止我已经:
\documentclass{article}
\usepackage{tikz-cd}
\usepackage{stmaryrd}
\usetikzlibrary{arrows}
%
\begin{document}
\begin{center}
\begin{tikzcd}[column sep=large]
{\begin{tikzpicture}\draw[{[-]}] (0,0) -- (2,0);
\foreach \x in {0}
\draw (\x cm,0pt) -- (\x cm,0pt) node[anchor=north] {$0$};
\foreach \x in {2}
\draw (\x cm,0pt) -- (\x cm,0pt) node[anchor=north] {$1$};\end{tikzpicture}} \arrow[r, "\textrm{gluing}"] &
{\begin{tikzpicture}\draw (0,0) circle (1cm);
\draw (0.8,0) -- (1.2,0); \end{tikzpicture}}\mathbb{Z}
\end{tikzcd}
\end{center}
\end{document}
看起来像
但 \mathbb{Z} 需要向下和向右移动一点。
答案1
以下代码以与@CarLaTeX 的另一个解决方案基本相同的方式解决问题,但也简化了代码。
\documentclass[border=2mm]{standalone}
\usepackage{tikz-cd}
\usetikzlibrary{arrows}
\usepackage{amssymb}
\begin{document}
\begin{tikzcd}[column sep=large]
\tikz\draw[{[-]},yshift=0.5ex] (0,0)node[below]{$0$} -- (2,0)node[below]{$1$};
\arrow[r, "\textrm{gluing}"]
& \tikz\draw (0,0) circle (1cm) (0.8,0) -- (1.2,0) node[right]{$\mathbb Z$};
\end{tikzcd}
\end{document}
答案2
这样的解决方案对您来说可以吗?
编辑:gernot 已经发布了一个完美的解决方案,不过,我想补充一点,你也可以设置你想要的节点位置,例如node[below=.7em, right=-.3em]
\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{tikz-cd}
\usepackage{stmaryrd}
\usetikzlibrary{arrows}
%
\begin{document}
\begin{center}
\begin{tikzcd}[column sep=large]
{\begin{tikzpicture}\draw[{[-]}] (0,0) -- (2,0);
\foreach \x in {0}
\draw (\x cm,0pt) -- (\x cm,0pt) node[anchor=north] {$0$};
\foreach \x in {2}
\draw (\x cm,0pt) -- (\x cm,0pt) node[anchor=north] {$1$};\end{tikzpicture}} \arrow[r, "\textrm{gluing}"] &
{\begin{tikzpicture}\draw (0,0) circle (1cm);
\draw (0.8,0) -- (1.2,0) node[below=.7em, right=-.3em] {$\mathbb{Z}$}; \end{tikzpicture}}
\end{tikzcd}
\end{center}
\end{document}