У меня возникла следующая проблема с 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: Я решил проблему с изгибом.
Второе редактирование: Я использую Tikz-Cd, как рекомендует Egreg. Код такой:
\[
\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}