tikzcd:如何获得均匀的列间距

tikzcd:如何获得均匀的列间距

我已经做了以下

\begin{equation}
\begin{tikzcd}
K_1 \arrow[dashed]{r}{\mu_{21}} & K_2\arrow[dashed]{r}{\mu_{32}} & 
K_3\arrow[dashed]{r}{\mu_{43}} & K_4\\
K_{01}\arrow[hook]{u}\arrow{ur}{\beta_{21}}&
K_{02}\arrow[hook]{u}\arrow[]{ur}{\beta_{32}} &
K_{03}\arrow[hook]{u}\arrow[]{ur}{\beta_{43}}&
R\arrow[swap]{u}{\alpha_{4}} \\
\beta_{21}^{-1}(K_{02})\arrow[hook]{u} \arrow[]{ur}{\beta_{21}} &
\beta_{32}^{-1}(K_{03})\arrow[hook]{u} \arrow[]{ur}{\beta_{32}} &
R\arrow[swap]{u}{\alpha_{3}}\\
\beta_{21}^{-1}\beta_{32}^{-1}(K_{03})\arrow[hook]{u} \arrow[]{ur}{\beta_{32}} &
R\arrow[swap]{u}{\alpha_{2}}\\   
R\arrow[swap]{u}{\alpha_{1}}
\end{tikzcd}
\end{equation}

并且列从左到右越来越紧密。如何使(列和行)间距均匀?

提前致谢。

答案1

使用between origins

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}

\begin{equation}
\begin{tikzcd}[
  column sep={6em,between origins},
  row sep={6em,between origins},
]
K_1 \arrow[r,dashed,"\mu_{21}"] & K_2\arrow[r,dashed,"\mu_{32}"] &
K_3 \arrow[r,dashed,"\mu_{43}"] & K_4\\
K_{01} \arrow[u,hook] \arrow[ur,"\beta_{21}"] &
K_{02} \arrow[u,hook] \arrow[ur,"\beta_{32}"] &
K_{03} \arrow[u,hook] \arrow[ur,"\beta_{43}"] &
R \arrow[u,swap,"\alpha_{4}"] \\
\beta_{21}^{-1}(K_{02}) \arrow[u,hook] \arrow[ur,"\beta_{21}"] &
\beta_{32}^{-1}(K_{03}) \arrow[u,hook] \arrow[ur,"\beta_{32}"] &
R \arrow[u,swap,"\alpha_{3}"] \\
\beta_{21}^{-1}\beta_{32}^{-1}(K_{03}) \arrow[u,hook] \arrow[ur,"\beta_{32}"] &
R \arrow[u,swap,"\alpha_{2}"] \\
R \arrow[u,swap,"\alpha_{1}"]
\end{tikzcd}
\end{equation}

\end{document}

在此处输入图片描述

答案2

很可能我误解了什么,但根据 Bernard 的说法,我会这样做

\documentclass{article}
\usepackage{tikz-cd}
\tikzset{
    every node/.style={
        minimum width=1.8cm
    }}
\begin{document}
\begin{equation}
\begin{tikzcd}
K_1 \arrow[dashed]{r}{\mu_{21}} & K_2\arrow[dashed]{r}{\mu_{32}} & 
K_3\arrow[dashed]{r}{\mu_{43}} & K_4\\
K_{01}\arrow[hook]{u}\arrow{ur}{\beta_{21}}&
K_{02}\arrow[hook]{u}\arrow[]{ur}{\beta_{32}} &
K_{03}\arrow[hook]{u}\arrow[]{ur}{\beta_{43}}&
R\arrow[swap]{u}{\alpha_{4}} \\
\beta_{21}^{-1}(K_{02})\arrow[hook]{u} \arrow[]{ur}{\beta_{21}} &
\beta_{32}^{-1}(K_{03})\arrow[hook]{u} \arrow[]{ur}{\beta_{32}} &
R\arrow[swap]{u}{\alpha_{3}}\\
\beta_{21}^{-1}\beta_{32}^{-1}(K_{03})\arrow[hook]{u} \arrow[]{ur}{\beta_{32}} &
R\arrow[swap]{u}{\alpha_{2}}\\   
R\arrow[swap]{u}{\alpha_{1}}
\end{tikzcd}
\end{equation}
\end{document}

在此处输入图片描述

相关内容