# Two long exact sequences

I want to write a commutative diagram consisting of two long exact sequences with maps between them. I wrote the following code but it could not compile. Please help.

\documentclass[12pt]{article}

\usepackage{tikz-cd}
\usepackage{amsmath,amsfonts,amssymb,amsthm,mathdots}

\begin{document}
\begin{center}
\begin{tikzcd}
\cdots \arrow{r}{d^{i-2}} \arrow{u} & X^{i-1}\arrow{u}\arrow{r}{d^{i-1}} & X^i \arrow{u} \arrow{r}{d^{i}} & X^{i-1} \arrow{u} \arrow{r}{d^{i+1}} & \cdots \arrow{u}\\ \cdots \arrow{r}{d_{i+2}} & X_{i+1} \arrow{r}{d_{i+1}} & X_i \arrow{r}{d_{i}} & X_{i+1} \arrow{r}{d_{i+1}} & \cdots
\end{tikzcd}
\end{center}
\end{document}


I am sorry for the messy code.

Your arrows direction in the first row is wrong. Instead direction u (up), you should use d (down) :

\documentclass[margin=3mm]{standalone}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}
\cdots \arrow{r}{d^{i-2}} \arrow{d}
& X^{i-1}\arrow{d}\arrow{r}{d^{i-1}}
& X^i \arrow{d} \arrow{r}{d^{i}}
& X^{i-1} \arrow{d} \arrow{r}{d^{i+1}}
& \cdots \arrow{d}\\
\cdots \arrow{r}{d_{i+2}}
& X_{i+1} \arrow{r}{d_{i+1}}
& X_i \arrow{r}{d_{i}}
& X_{i+1} \arrow{r}{d_{i+1}}
& \cdots
\end{tikzcd}
\end{document}


• Thank you. It was a stupid mistake. – Hitjuich Jun 3 at 10:27
• Such mistakes happens quit often. Since answer solve your problem, you can accept it (by clicking on check mark at top left side of answer) :-) – Zarko Jun 3 at 10:30