I am trying to typeset the Mayer-Vietoris sequence (concisely - without the map names above the arrows). Currently I am simply using the AMS align environment with a bunch of \rightarrow, \cdots and a \hphantom to align the last line horizontally:

\cdots & \rightarrow H_{n}\left(A\cap B\right)\rightarrow H_{n}\left(A\right)\oplus H_{n}\left(B\right)\rightarrow H_{n}\left(X\right)\rightarrow \\
 & \rightarrow H_{n-1}\left(A\cap B\right)\rightarrow\cdots \\
 & \hphantom{\rightarrow H_{n}\left(A\cap B\right)\rightarrow H_{n}\left(A\right)\oplus H_{n}\left(B\right)}\cdots\rightarrow H_{0}\left(X\right)\rightarrow 0

The result looks like this:


I would like to align the first arrow on the last line correctly under the penultimate arrow on the first line, and also to merge the last line with the second one, so it looks like this (image made with image editor):


How should I do this?

3 Answers 3


Here is a possible solution using the package mathtools (which is kind of a successor of amsmath):

% arara: pdflatex


        \cdots &\rightarrow H_{n}(A\cap B)\rightarrow H_{n}(A)\oplus H_{n}(B) &&\rightarrow H_{n}(X)\rightarrow \\
        &\rightarrow H_{n-1}(A\cap B)\rightarrow\cdots &&\mathllap{\cdots}\rightarrow H_{0}(X)\rightarrow 0

enter image description here

A short explanation:

I used an alignat with two alignment points (as requested by you). First, I tried to push the \cdots to the right with \hfill but this does not work here. For sure you could find some array solution with this trick.

Therefore, I had to add the dots to the right of the second alignment mark and change its width to zero. The command \mathllap is provided by mathtools and smashes the box width setting its content to the left.

  • 1
    Thanks, this is exactly what I wanted :) I am already using mathtools in my work but I am not proficient with it. Commented Jan 8, 2015 at 10:41

Here's another solution using tikz-cd, which I personally use for such diagrams most of the time:

        \cdots \rar & H_n(A \cap B) \rar & H_n(A) \oplus H_n(B) \rar & H_n(X) \rar & \hphantom{0}\\
        \hphantom{\cdots} \rar 
        & H_{n-1}(A \cap B) \rar 
        & \makebox[\widthof{$H_n(A) \oplus H_n(B)$}][c]{$\cdots\hfill \cdots$} \rar
        &  H_0(X) \rar & 0


enter image description here

The advantage of this solution is the customizability provided by tikz. For example you can easily

  • make the diagram smaller (or bigger) by using the keys row sep and column sep
  • add colors
  • add labels to the arrows and customize them in terms of position and orientation

You can exploit the direct sum symbol and avoid any computation:



\cdots & \to H_{n}(A\cap B)\to H_{n}(A) & {}\oplus H_{n}(B) & \to H_{n}(X)\to \\
       & \to H_{n-1}(A\cap B)\to\cdots  & \cdots          & \to H_{0}(X)\to 0


enter image description here

Note that I removed \left and \right, which make no sense in this case. Using \to instead of \rightarrow is just a personal preference (it's surely faster to type).

Alternative solution, in case a suitable fake alignment point is not available, using ideas from https://tex.stackexchange.com/a/209732/4427


    \makebox[\ifcase\expandafter #1\maxcolumn@widths\fi]{$\displaystyle#2$}%


\cdots \to {} & H_{n}(A\cap B)\to H_{n}(A) \oplus H_{n}(B)        && \to H_{n}(X)\to \\
       \to {} & \Spread{2}{H_{n-1}(A\cap B)\to\cdots\hfill\cdots} && \to H_{0}(X)\to 0


The first argument to \Spread is the column number.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .