Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\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?

share|improve this question
2  
Welcome to TeX.SX! –  egreg Jun 10 at 20:34

1 Answer 1

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}

enter image description here

share|improve this answer
    
Thanks for the quick response! –  Haikal Yeo Jun 10 at 20:36
    
I'm not a specialist in group cohomology, but I've used several diagrams and exact sequences. ;-) –  egreg Jun 10 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 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 at 21:03
1  
Have a look at the Sage tutorial where there are instructions about how to include latex packages. –  Andrew Swann Jun 11 at 6:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.