我的代码是:
\documentclass[a4paper]{book}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[column sep=large, row sep=huge]
Hom_{\Gamma}(\mathcal{B}(G),A)\arrow{r}{\rho}\arrow{rd}
& Hom_{\Delta}(\mathcal{B}(G),A)\arrow{d}{i^{*}}\\
& Hom_{\Gamma}(\mathcal{B}(G),A)
\end{tikzcd}
\end{document}
但我希望斜箭头指向 Hom 的 H 左侧,而不是上方。我该如何修复?
答案1
设置end anchor
密钥。
\arrow[rd, end anchor=west]
或者,
\arrow[rd, end anchor=north west]
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[column sep=large, row sep=huge]
Hom_{\Gamma}(\mathcal{B}(G),A)\arrow{r}{\rho}\arrow[rd, end anchor=west]
& Hom_{\Delta}(\mathcal{B}(G),A)\arrow{d}{i^{*}}\\
& Hom_{\Gamma}(\mathcal{B}(G),A)
\end{tikzcd}
\end{document}
答案2
我认为 TikZ 更简单。
%\documentclass[a4paper]{book}
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\path
(0,0) node (L) {$Hom_{\Gamma}(\mathcal{B}(G),A)$}
++(0:4) node (C) {$Hom_{\Delta}(\mathcal{B}(G),A)$}
+(-90:2) node (B) {$Hom_{\Gamma}(\mathcal{B}(G),A)$};
\draw[->] (L)--(C) node[midway,above]{$\rho$};
\draw[->] (C)--(B) node[midway,right]{$i^{*}$};
\draw[->] (L)--(B.north west);
\end{tikzpicture}
\end{document}