节点间有曲线连接的交换图

节点间有曲线连接的交换图

我在使用 Tikz 时遇到以下问题:我想绘制一条连接节点$H_q(X_1)$和的曲线$H_q(X_1,A)$。我在下面代码的最后一行使用了命令\draw[bend right,->] (-2) to node [anchor=north]{$H_{n-1}(Id)$} (10); 但结果并不好。绘制的曲线位于字母上方,如下所示:

在此处输入图片描述

我怎样才能使这条曲线向左弯曲更多?这是我的图表的代码:

    \begin{center}
\begin{tikzpicture}[every node/.style={midway}]
  \matrix[column sep={10em,between origins}, row sep={2.9em}] at (0,0) {
   \node(-14) {}; & \node (-13) {};&\node(-12) {};\\
  \node(-11){} ; & \node(-10) {$H_{q+1}(X,A)$};&\node(-9) {}; \\
 \node(-8) {$H_{q+1}(X_2,A)$}; & \node (-7) {};&\node(-6) {$H_{q+1}(X_1,A)$};\\
  \node(-5){} ; & \node(-4) {$H_q(A)$};&\node(-3) {}; \\
 \node(-2) {$H_q(X_1)$}; & \node (-1) {};&\node(0) {$H_q(X_2)$};\\
   \node(1){} ; & \node(2) {$H_q(X)$};&\node(3) {}; \\
 \node(4) {$H_q(X,X_2)$}; & \node (5) {};&\node(6) {$H_q(X,X_1)$};\\
     \node(7) {}; & \node (8) {$H_q(X,A)$};&\node(9) {};\\
     \node(10){$H_q(X_1,A)$} ; & \node(11) {};&\node(12) {$H_q(X_1,A)$}; \\
    \node(13) {}; & \node (14) {$H_{q-1}(A)$};&\node(15) {};\\
    \node(16){$H_{q-1}(X_2)$} ; & \node(17) {};&\node(18) {$H_{q-1}(X_1)$}; \\
    \node(19) {}; & \node (20) {$H_{q-1}(X)$};&\node(21) {};\\
    \node(22){} ; & \node(23) {};&\node(24) {}; \\
     };

      \draw[->] (-14) -- (-10) node[anchor=south]  {};
      \draw[->] (-13) -- (-10) node[anchor=south]  {};
      \draw[->] (-12) -- (-10) node[anchor=south]  {};

     \draw[->] (-4) -- (-6) node[anchor=north]  {$\partial_{(q+1)_1}^*$};
  \draw[->] (-4) -- (-8) node[anchor=north]  {$\partial_{(q+1)_2}^*$};
  \draw[->] (-6) -- (-10) node[anchor=south]  {$H_q(l_1)$};
  \draw[->] (-8) -- (-10) node[anchor=south]  {$H_q(l_2)$};

  \draw[<-] (-2) -- (-4) node[anchor=south]  {$H_q(m_1)$};
  \draw[<-] (0) -- (-4) node[anchor=south]  {$H_q(m_2)$};
  \draw[->] (-2) -- (2) node[anchor=north]  {$H_q(i_1)$};
  \draw[->][red] (0) -- (2) node[anchor=north]  {$H_q(i_2)$};


  \draw[->] (2) -- (4) node[anchor=south]  {$H_q(s_2)$};
  \draw[->] (2) -- (6) node[anchor=south]  {$H_q(s_1)$};
  \draw[<-] (4) -- (8) node[anchor=north] {$H_q(j_2)$};
  \draw[<-] (6) -- (8) node[anchor=north] {$H_q(j_1)$};

  \draw[<-] (8) -- (10) node[anchor=north]  {$H_q(l_1)$};
  \draw[<-] (8) -- (12) node[anchor=north]  {$H_q(l_2)$};
  \draw[->] (10) -- (14) node[anchor=north] {$\partial_{q_1}^*$};
  \draw[->] (12) -- (14) node[anchor=north] {$\partial_{q_2}^*$};

  \draw[->] (14) -- (16) node[anchor=south]  {$H_{q-1}(m_2)$};
  \draw[->] (14) -- (18) node[anchor=south]  {$H_{q-1}(m_1)$};
  \draw[->] (16) -- (20) node[anchor=north] {$H_{q-1}(i_2)$};
  \draw[->] (18) -- (20) node[anchor=north] {$H_{q-1}(i_1)$};

   \draw[<-][thick][green] (4) -- (10) node[anchor=east] {$H_q(k_1)$};
   \draw[<-] (6) -- (12) node[anchor=west] {$H_q(k_2)$};


    \draw[->] (-10) -- (-4) node[anchor=west]  {$\partial_{q+1}^*$};
   \draw[->] (-4) -- (2) node[anchor=west]  {$H_{q}(m)$};
    \draw[->] (2) -- (8) node[anchor=west]  {$H_{q}(n)$};
    \draw[->] (8) -- (14) node[anchor=west]  {$\partial_{q}^*$};
     \draw[->] (14) -- (20) node[anchor=west]  {$H_q(m)$};

      \draw[->] (20) -- (22) node[anchor=west]  {};
        \draw[->] (20) -- (23) node[anchor=west]  {};
          \draw[->] (20) -- (24) node[anchor=west]  {};


      \draw[bend right=75,->]  (-2) to node [anchor=east]{$H_{q}(n_1)$} (10);   
      \draw[bend right=75,->]  (4) to node [anchor=east]{$\partial_{q_2}^*$} (16);   

       \draw[bend left=75,->]  (0) to node [anchor=west]{$\partial_{q_2}^*$} (12);   
       \draw[bend left=75,->]  (6) to node [anchor=west]{$\partial_{q_2}^*$} (18);   

\end{tikzpicture}
\end{center}

先感谢您。

编辑:我们如何避免出现例如连接和的$H_q(s_2)$线被覆盖的情况?$H_q(X)$$H_q(X,X_2)$

PS:弯曲问题我解决了。

第二次编辑:我使用 Egreg 推荐的 Tikz-Cd。代码如下:

\[
\begin{tikzcd}
& {H_q(A)}  \arrow[dl,swap,"H_q(m_1)"] \arrow[dd,"H_q(m)"] \arrow[dr,"H_q(m_2)"] \\
H_q(X_1) \arrow[dr,swap,"H_q(i_1)"]
  \arrow[dddd,bend right=50,swap,"H_{n-1}(\mathit{Id})"] &&
  H_q(X_2) \arrow[dddd,bend left=50,"H_{n-1}(\mathit{Id})"]  \arrow[red,dl,"H_q(i_2)"] \\
& H_q(X) \arrow[dl,swap,"H_q(s_1)"] \arrow[dd,"H_q(n)"] \arrow[dr,"H_q(s_2)"] \\
H_q(X,X_2)\arrow[dddd,bend right=50,swap,"H_{n-1}(\mathit{Id})"]  && H_q(X,X_1)\arrow[dddd,bend left=50,"H_{n-1}(\mathit{Id})"]  \\
& H_q(X,A) \arrow[ul,"H_q(j_2)"] \arrow[ur,swap,"H_q(j_1)"] \arrow[dd,"\partial_q^*"] \\
H_q(X_1,A) \arrow[uu,"H_q(k_1)"] \arrow[ur,swap,"H_q(l_1)"] \arrow[dr,swap,"\partial^*_{q_1}"] &&
  H_q(X_1,A) \arrow[ul,"H_q(l_2)"] \arrow[uu,swap,"H_q(k_2)"] \arrow[dl,"\partial^*_{q_2}"] \\
& H_{q-1}(A) \arrow[dl,swap,"H_{q-1}(m_2)"] \arrow[dd,"H_{q-1}(m)"] \arrow[dr,"H_{q-1}(m_1)"] \\
H_{q-1}(X_2) \arrow[dr,swap,"H_{q-1}(i_1)"]
  &&
  H_{q-1}(X_1) \arrow[red,dl,"H_{q-1}(i_2)"] \\
& H_{q-1}(X)
\end{tikzcd}
\]

结果是:

在此处输入图片描述

现在的问题是我无法像原图一样画出尾巴和头部。总是显示错误?我该怎么做?

答案1

您可以使用tikz-cd

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

\begin{document}

\[
\begin{tikzcd}
& {} \arrow[dl] \arrow[dd,swap,"n"] \arrow[dr] \\
H_q(X_1) \arrow[dr,swap,"H_q(i_1)"]
  \arrow[dddd,bend right=50,swap,"H_{n-1}(\mathit{Id})"] &&
  H_q(X_2) \arrow[red,dl,"H_q(i_2)"] \\
& H_q(X) \arrow[dl,swap,"H_q(s_1)"] \arrow[dd,swap,"n"] \arrow[dr,"H_q(s_2)"] \\
H_q(X,X_2) && H_q(X,X_1) \\
& H_q(X,A) \arrow[ul,"H_q(j_2)"] \arrow[ur,swap,"H_q(j_1)"] \arrow[dd,"\partial"] \\
H_q(X_1,A) \arrow[uu,"H_q(k_1)"] \arrow[ur,swap,"H_q(l_1)"] \arrow[dr,swap,"\partial^*_q"] &&
  H_q(X_1,A) \arrow[ul,"H_q(l_2)"] \arrow[uu,swap,"H_q(k_2)"] \arrow[dl,"\partial^*_q"] \\
& {}
\end{tikzcd}
\]

\end{document}

在此处输入图片描述

相关内容