为什么箭头比两个节点之间的距离短?

为什么箭头比两个节点之间的距离短?

我遇到了一个相当奇怪的问题,无法解决:

\documentclass{amsart}
\usepackage{mathrsfs}
\usepackage{tikz-cd}
\usetikzlibrary{calc}
\newcommand{\gal}[1]{\mathscr{G}_{#1}}
\begin{document}
\begin{center} 
\begin{tikzcd}[row sep=small, column sep=small] 
  \phantom{K}\arrow[ddddd, mapsfrom, maps to, "\gal{K}" description, to path={ -- (\tikztostart.west) |-($(\tikztostart.west)!.5!(\tikztotarget.west)$)\tikztonodes -| (\tikztotarget.west)}]&  & \overline{F} & \phantom{K} \arrow[dddddd, mapsfrom, maps to, "\gal{F}" description, to path={ -- (\tikztostart.west) |-($(\tikztostart.west)!.5!(\tikztotarget.west)$)\tikztonodes -| (\tikztotarget.west)}]\\ 
  \phantom{K} \arrow[dddd, xshift=1.35em, mapsfrom, maps to, "\Gamma_K" description, to path={ -- (\tikztostart.west) |-($(\tikztostart.west)!.5!(\tikztotarget.west)$)\tikztonodes -| (\tikztotarget.west)}]& K_\infty \arrow[ur, dash, "\mathscr{H}_K"] & & \\
  & & F_\infty \ar[-]{ul} \ar[uu, dash, "\mathscr{H}_F"']& \phantom{K} \arrow[dddd, xshift=1.35em, mapsfrom, maps to, "\Gamma_F" description, to path={ -- (\tikztostart.west) |-($(\tikztostart.west)!.5!(\tikztotarget.west)$)\tikztonodes -| (\tikztotarget.west)}]\\
  & K_n \ar[-]{uu} & \\
  \phantom{K}& & F_n \ar[-]{uu} \ar[-]{ul} & \\
  \phantom{K} & K \ar[-]{uu} & \\
  & F \ar[-]{u} \ar[-]{uur} & &  \phantom{K}
\end{tikzcd}
\end{center}
\end{document}

使用此代码(不一定是最小的,对不起!),标有和的箭头\Gamma_K\Gamma_F绘制它们的节点之间的距离短?我遗漏了什么吗?Gamma_K箭头(分别为)应停止在与(分别为)Gamma_F相同的水平。KF

如果您能指出我遗漏了什么,我将非常感激。

代码输出

答案1

您的箭头路径使事情变得过于复杂,并且还导致线的延伸超过了栏maps from

我建议简化您的代码,使用tikzcd7 行 2 列的 。然后,您可以在末尾添加外部“箭头”,向左或向右移动任意量。例如,箭头\Gamma_K从一个单元格绘制2-1到另一个单元格6-1,但向左移动1cmstart anchor=center并将end anchor=center箭头垂直放置在您想要的位置。

{}最后,我在单元格1-1和占位符中添加了空内容,7-2而不是使用phantom

在此处输入图片描述

\documentclass{amsart}
\usepackage{mathrsfs}
\usepackage{tikz-cd}
%\usetikzlibrary{calc}
\newcommand{\gal}[1]{\mathscr{G}_{#1}}
\begin{document}
\begin{center} 

\begin{tikzcd}[row sep=small, column sep=small] 
{} & \overline{F}\arrow[dd, dash, "\mathscr{H}_F"] & \\
K_{\infty}\arrow[ur, dash, "\mathscr{H}_K"]\arrow[dd, dash]\arrow[dr, dash] \\
& F_{\infty}\arrow[dd, dash] \\
K_n\arrow[dr, dash]\arrow[dd, dash] \\
& F_n \\
K\arrow[d, dash] \\
F\arrow[uur, dash] & {}
\arrow[from=2-1, to=6-1, xshift=-1cm, mapsfrom, maps to, "\Gamma_K"description, start anchor=center, end anchor=center]
\arrow[from=1-1, to=6-1, xshift=-1.5cm, mapsfrom, maps to, "\gal{K}"description, start anchor=center, end anchor=center]
\arrow[from=1-2, to=7-2, xshift=1cm, mapsfrom, maps to, "\gal{F}"description, start anchor=center, end anchor=center]
\arrow[from=3-2, to=7-2, xshift=1.5cm, mapsfrom, maps to, "\Gamma_F"description, start anchor=center, end anchor=center]
\end{tikzcd}

\end{center}
\end{document}

相关内容