# Short exact sequences stemming from a long exact sequence with tikz

Does something exist, preferrably with tikz, but anything really that generates the diagram

I think it would be extremely insightful to how short exact sequences are related. I would rather not re-invent the wheel if anyone knows where or how they generated the above picture. I found some code which I have tried to modify here.

I have:

\documentclass[tikz, border=5pt]{standalone}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[line join = round, line cap = round,baseline=(current bounding box.center)]

\node (z) {$[\wedge]$};
\node (x) [below left=1cm and .8cm of z] {$[\vee]$};
\node (y) [below right=1cm and .8cm of z] {$[\neg \wedge]$};
\node (a) [right=1cm of y] {$[\neg \vee]$};
\draw[<->] (z) to node [sloped, above] {} (y);
\draw[<->] (x) to node [sloped, above] {} (z);
\draw[<->] (y) to node [sloped, above] {} (x);
\draw[->] (y) to node [sloped, above] {} (a);

\end{tikzpicture}
\end{document}


EDIT: How would one go from what egreg kindly designed to that of:

• Your code produces a compilation error. Please check that your code compiles before posting unless your question is about a compilation error. (In that case, also give the exact error you get.) Your diagram doesn't seem to bear much relation to the target: what are you trying to do exactly? – cfr Sep 5 '15 at 19:51
• The picture clearly shows use of Xy-pic. – egreg Sep 5 '15 at 19:51
• @cfr the code (except for the added standalone addition) compiles fine. I took the standalone etc. code from here: tex.stackexchange.com/questions/258164/… and it works there so I have no idea what is wrong... – Relative0 Sep 5 '15 at 20:00
• @user1922184 It works because I edited your question to correct it. – cfr Sep 5 '15 at 23:08
• Hi cfr, I meant that it worked on my computer before I put in the standalone code in. When I tried to get it to work here though, well I guess there was a problem. Even still, I do not see a display of the code that you edited. Why would it not work and what did you do? – Relative0 Sep 6 '15 at 13:43

The diagram clearly shows having been drawn with Xy-pic (the horrible arrow tips are revealing).

Here's how you can do it with tikz-cd

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

\begin{document}

$\begin{tikzcd}[row sep=1em,column sep=1em] & & 0 \arrow[dr] & & 0 & & 0 \arrow[dr] & & 0 & & 0 \arrow[dr] & & 0\\ & & & C_2 \arrow[ur] \arrow[dr] & & & & C_4 \arrow[ur] \arrow[dr] & & & & C_6 \arrow[ur] \arrow[dr] \\ & & A_1 \arrow[rr] \arrow[ur] & & A_2 \arrow[rr] \arrow[dr] & & A_3 \arrow[rr] \arrow[ur] & & A_4 \arrow[rr] \arrow[dr] & & A_5 \arrow[rr] \arrow[ur] & & A_6 \arrow[dr] \\ & C_1 \arrow[ur] & & & & C_3 \arrow[dr] \arrow[ur] & & & & C_5 \arrow[dr] \arrow[ur] & & & & C_7 \arrow[dr] \\ 0 \arrow[ur] & & & & 0 \arrow[ur] & & 0 & & 0 \arrow[ur] & & 0 & & & & 0 \end{tikzcd}$

\end{document}


Here is the version with only five terms in the long exact sequence. The idea is that in the long sequence in the middle we jump over one column, which makes room for the terms of the diagonal short exact sequences.

It's just a patience game of counting steps. You think of this as a matrix, with & for separating cells in a row and \\ for ending a row; trailing & can be omitted. With \arrow you specify the target cell.

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

\begin{document}

$\begin{tikzcd}[row sep=1em,column sep=1em] & & 0 \arrow[dr] & & 0 & & 0 \arrow[dr] & & 0 & & & & 0\\ & & & C_2 \arrow[ur] \arrow[dr] & & & & C_4 \arrow[ur] \arrow[dr] & & & & C_6 \arrow[ur] \\ & & A_1 \arrow[rr] \arrow[ur] & & A_2 \arrow[rr] \arrow[dr] & & A_3 \arrow[rr] \arrow[ur] & & A_4 \arrow[rr] \arrow[dr] & & A_5 \arrow[ur] \\ & C_1 \arrow[ur] & & & & C_3 \arrow[dr] \arrow[ur] & & & & C_5 \arrow[dr] \arrow[ur] \\ 0 \arrow[ur] & & & & 0 \arrow[ur] & & 0 & & 0 \arrow[ur] & & 0 \end{tikzcd}$

\end{document}


Here's the doubled diagram, although I can't understand its meaning.

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

\begin{document}

$\begin{tikzcd}[row sep=1em,column sep=1em] & & 0 \arrow[dr] & & 0 & & 0 \arrow[dr] & & 0 & & 0 \arrow[dr] & & 0\\ & & & C_2 \arrow[ur] \arrow[dr] & & & & C_4 \arrow[ur] \arrow[dr] & & & & C_6 \arrow[ur] \arrow[dr] \\ 0 \arrow[dr] & & A_1 \arrow[rr] \arrow[ur] & & A_2 \arrow[rr] \arrow[dr] & & A_3 \arrow[rr] \arrow[ur] & & A_4 \arrow[rr] \arrow[dr] & & A_5 \arrow[rr] \arrow[ur] & & A_6 \arrow[dr] \\ & C_1 \arrow[ur] \arrow[dr] & & & & C_3 \arrow[dr] \arrow[ur] & & & & C_5 \arrow[dr] \arrow[ur] & & & & C_7 \arrow[dr] \\ 0 \arrow[ur] & & 0 \arrow[dr] & & 0 \arrow[ur] & & 0 \arrow[dr] & & 0 \arrow[ur] & & 0 \arrow[dr] & & 0 \arrow[ur] & & 0 \\ & & & C_2 \arrow[ur] \arrow[dr] & & & & C_4 \arrow[ur] \arrow[dr] & & & & C_6 \arrow[ur] \arrow[dr] \\ & & A_1 \arrow[rr] \arrow[ur] & & A_2 \arrow[rr] \arrow[dr] & & A_3 \arrow[rr] \arrow[ur] & & A_4 \arrow[rr] \arrow[dr] & & A_5 \arrow[rr] \arrow[ur] & & A_6 \arrow[dr] \\ & C_1 \arrow[ur] & & & & C_3 \arrow[dr] \arrow[ur] & & & & C_5 \arrow[dr] \arrow[ur] & & & & C_7 \arrow[dr] \\ 0 \arrow[ur] & & & & 0 \arrow[ur] & & 0 & & 0 \arrow[ur] & & 0 & & & & 0 \\ \end{tikzcd}$

\end{document}


• This is great! It works and I have been able to modify it almost perfectly except that I am trying to make $A_5$ the last node (instead of $A_6$. I am able to get rid of all that is after except for the upward exact sequence $A_5 \rightarrow C_6 \rightarrow 0$ which I want (so I am able to remove the exact sequence $0 \rightarrow C_6 \rightarrow A_6 \rightarrow C_7 \rightarrow 0$ but keeping the $C_6$ as it is part of the other sequence. I however can not get the arrow $C_6 \rightarrow 0$. Everything I try throws a no shape known error. Any ideas? Thanks again. – Relative0 Sep 6 '15 at 15:11
• @user1922184 I'll try it. – egreg Sep 6 '15 at 15:30
• egreg, seems it works well. Also it seems like this question is getting a lot of votes so I am glad it is helpful. That being said, I have been trying to "glue" 2 of these diagrams together such that the bottom 0's from the top diagram connect with the top 0's from the bottom diagram. So for example, the bottom $C_4$ has a 0 coming in, and ideally that would be from $C_3$ from the top diagram. Likewise $C_4$ from the bottom would connect to $C_5$ from the top: $C_4 \rightarrow 0 \rightarro C_5$. This would happen for all the 0's going in/out of the bottom diagram and the top diagram (cont.) – Relative0 Sep 7 '15 at 12:28
• So the bottom and top diagrams would "share" the 0's (there would have to be one going out of $C_1$ as well. I know that somehow this would entail editing the top line of code of the bottom diagram and the bottom line of the top diagram and adding the corresponding \arrow[dr] and \arrow[ur] arrows - however I am unsure of how many "&" 's to delete (or add) to correct the number of columns. Everything I try throws an error. You have already done a lot and it is more than appreciated. If however you see the solution, please do share. Thanks. – Relative0 Sep 7 '15 at 12:33
• @user1922184 I'm not sure to understand – egreg Sep 7 '15 at 13:01