考虑下面的代码。
\documentclass[14pt,reqno,a4paper]{amsart}
\usepackage{extsizes}
\usepackage{blindtext}
\textheight 9.3in \textwidth 6.5in
\calclayout
\usepackage{amsmath,amsthm,amsfonts,amssymb}
\usepackage{hyperref}
\usepackage{mathrsfs}
\usepackage[all]{xy}
\usepackage[normalem]{ulem}
\usepackage{tikz-cd}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\newcommand{\uMor}[1]{\operatorname{\underline{Mor_{#1}}}}
\usepackage{color}
\pagestyle{myheadings}
\begin{document}
\begin{tikzcd}
(\mathcal{C}/U)^{\text{op}} \arrow[rrr, "{\uMor{\mathcal{F}}(x,y)}"{name=U}, bend left=49] \arrow[rrr, "{\uMor{\mathcal{G}}(\Psi(x),\Psi(y))}"'{name=D}, bend right=49] & & & (\text{Set})
\arrow[Rightarrow, from=U, to=D, shorten >=2pt, shorten <=2pt]
\end{tikzcd}
\end{document}
我想在 tikzcd 代码中为图表添加标题。
我想将图形命名为“图 1”
有哪些方法可以做到这一点?
答案1
\documentclass[14pt,reqno,a4paper]{amsart}
\usepackage{extsizes}
\textheight 9.3in \textwidth 6.5in
\calclayout
\usepackage{tikz-cd}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\newcommand{\uMor}[1]{\operatorname{\underline{Mor_{#1}}}}
\usepackage{capt-of}
\pagestyle{myheadings}
\begin{document}
\begin{figure}
\begin{tikzcd}
(\mathcal{C}/U)^{\text{op}} \arrow[rrr, "{\uMor{\mathcal{F}}(x,y)}"{name=U}, bend left=49] \arrow[rrr, "{\uMor{\mathcal{G}}(\Psi(x),\Psi(y))}"'{name=D}, bend right=49] & & & (\text{Set})
\arrow[Rightarrow, from=U, to=D, shorten >=2pt, shorten <=2pt]
\end{tikzcd}
\caption{my caption text}
\end{figure}
\begin{center}
\begin{tikzcd}
(\mathcal{C}/U)^{\text{op}} \arrow[rrr, "{\uMor{\mathcal{F}}(x,y)}"{name=U}, bend left=49] \arrow[rrr, "{\uMor{\mathcal{G}}(\Psi(x),\Psi(y))}"'{name=D}, bend right=49] & & & (\text{Set})
\arrow[Rightarrow, from=U, to=D, shorten >=2pt, shorten <=2pt]
\end{tikzcd}
\captionof{figure}{my caption text}
\end{center}
\end{document}
与问题无关,但您可能需要记住,该hyperref
包通常(除了少数例外)应该是您加载的最后一个包。