# Sequence does not come out right

\usepackage{tikz}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing}

\begin{tikzpicture}[scale=1.5]

\node (A) at (1,0) {$0$};
\node (B) at (2,0) {$H^1(G/H,M^H$};
\node (C) at (3,0) {$H^1(G,M)$};
\node (D) at (4,0) {$H^1(H,M)$};
\path[->,font=\scriptsize,>=angle 90]
(A) edge node[above]{} (B)
(B) edge node[above]{$\textnormal{Inf}$} (C)
(C) edge node[above]{$\textnormal{Res}$} (D);

\end{tikzpicture}


I'm writing a LaTeX document with this code and while the diagram has appeared in the right order, they are squeezed together because of the length of the elements in the sequence. How can I fix this?

-
Welcome to TeX.SX! –  egreg Jun 10 '14 at 20:34

You want to use tikz-cd:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\DeclareMathOperator{\Inf}{Inf}
\DeclareMathOperator{\Res}{Res}

\begin{document}
\begin{tikzcd}
0 \arrow{r} &
H^1(G/H,M^H) \arrow{r}{\Inf} &
H^1(G,M) \arrow{r}{\Res} &
H^1(H,M)
\end{tikzcd}
\end{document}


-
Thanks for the quick response! –  Haikal Yeo Jun 10 '14 at 20:36
I'm not a specialist in group cohomology, but I've used several diagrams and exact sequences. ;-) –  egreg Jun 10 '14 at 20:39
I got this error when I typed the code into my latex document in SAGE: <inserted text> \cr l.231 ! Misplaced \cr. <inserted text> \cr Do you know what's wrong? –  Haikal Yeo Jun 10 '14 at 21:02
@HaikalYeo Sorry, but I don't know about SAGE. Are you sure you have an up-to-date TeX distribution? –  egreg Jun 10 '14 at 21:03
Have a look at the Sage tutorial where there are instructions about how to include latex packages. –  Andrew Swann Jun 11 '14 at 6:50