tikzcd 中的双箭头

tikzcd 中的双箭头

请看下面的例子:

\begin{center}
    \begin{tikzcd}
        x_1(k+1) \arrow{d}{x_1(k)} & \\
        x_2(k+1) \arrow{d}{x_2(k)} & x_4(k+1) \arrow{lu}{x_1(k)} \arrow{l}{x_2(k)} \arrow[loop right]{l}{x_4(k)} \\
        x_3(k+1) \arrow[ru, equal]{x_3(k)} & \\
    \end{tikzcd}
\end{center}

并输出:

输出

问题是我想在双线(x_3(k+1) 和 x_4(k+1) 之间)的两侧获得箭头。我该怎么做?

答案1

添加箭头并移动它。我会给图表留出更多空间,并改变大多数标签的侧面。

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

\begin{document}

\begin{equation*}
\begin{tikzcd}[row sep=3em,column sep=3em]
x_1(k+1) \arrow[d,swap,"x_1(k)"] & \\
x_2(k+1) \arrow[d,swap,"x_2(k)"] &
  x_4(k+1)
  \arrow[lu,swap,"x_1(k)"]
  \arrow[l,swap,"x_2(k)"]
  \arrow[l,loop right,"x_4(k)"]
  \arrow[dl,shift right]
 \\
x_3(k+1) \arrow[ru,shift right,swap,"x_3(k)"]
\end{tikzcd}
\end{equation*}

\end{document}

在此处输入图片描述

答案2

箭头类型是Leftrightarrow您想要的吗?

\documentclass[tikz,border=4mm]{standalone}
\usepackage{tikz-cd}
\begin{document}
    \begin{tikzcd}
        x_1(k+1) \arrow{d}{x_1(k)} & \\
        x_2(k+1) \arrow{d}{x_2(k)} & x_4(k+1) \arrow{lu}{x_1(k)} \arrow{l}{x_2(k)} \arrow[loop right]{l}{x_4(k)} \\
        x_3(k+1) \arrow[ru, Leftrightarrow]{x_3(k)} & \\
    \end{tikzcd}
\end{document}

在此处输入图片描述

相关内容