1

I would like to construct the following diagram in LaTeX. What's the best way to do it? I'd like to avoid using external software. (I currently have a "linear" sequence \cdots\to H_p(L)\to H_p(K)\to\cdots but I'd like to remake it to look like the one in the image.)

The diagram I'd like to construct.

1
  • Take a look at tikzcd
    – cmhughes
    Mar 23, 2016 at 21:00

2 Answers 2

11

The most difficult part is probably how to make it fit in the text width:

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

\begin{document}

\[
\begin{tikzcd}[column sep=small]
\cdots \arrow[r,"\varepsilon_*"] &
  H_{p+2}(K,L) \arrow[d,"\partial_*"] \\
& H_{p+1}(L) \arrow[r,"i_*"] &
  H_{p+1}(K) \arrow[r,"\varepsilon_*"] &
  H_{p+1}(K,L) \arrow[d,"\partial_*"] \\
&&& H_{p}(L) \arrow[r,"i_*"] &
    H_{p}(K) \arrow[r,"\varepsilon_*"] &
    H_{p}(K,L) \arrow[d,"\partial_*"] \\
&&&&& H_{p-1}(L) \arrow[r,"i_*"] & \cdots
\end{tikzcd}
\]

\end{document}

enter image description here

With this code

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

\begin{document}

\[
\begin{tikzcd}[column sep=.5em]
\cdots \arrow[r,"\varepsilon_*"] &[.5em]
  H_{p+2}(K,L) \arrow[d,"\partial_*"] \\
& H_{p+1}(L) \arrow[r,"i_*"] &
  H_{p+1}(K) \arrow[r,"\varepsilon_*"] &[.5em]
  H_{p+1}(K,L) \arrow[d,"\partial_*"] \\
&&& H_{p}(L) \arrow[r,"i_*"] &
    H_{p}(K) \arrow[r,"\varepsilon_*"] &[.5em]
    H_{p}(K,L) \arrow[d,"\partial_*"] \\
&&&&& H_{p-1}(L) \arrow[r,"i_*"] &[.5em] \cdots
\end{tikzcd}
\]

\end{document}

and the standard text width for article we get an overfull box of less than 1pt and the output seems quite acceptable.

enter image description here

3
  • Thanks for the effort! I got this far myself and had exactly the same problem (I adapted the [Snake lemma](www.texample.net/tikz/examples/snake-lemma/) example). Mar 23, 2016 at 21:31
  • @blazs I managed to squeeze it more than in the previous attempt.
    – egreg
    Mar 23, 2016 at 21:39
  • 11
    @blazs Then don't you think it might have been helpful to include what you'd got in your question so somebody else didn't need to repeat your efforts?!
    – cfr
    Mar 23, 2016 at 21:40
5

Building upon egreg's answer, I want to show that this diagram can be set with macros purely defined by plain TeX.

\def\rar#1{\mathop{\longrightarrow}\limits^{#1}}
\def\dar#1{\bigg\downarrow\rlap{$\scriptstyle#1$}}

$$
  \ialign{\hfil$#$\hfil&&\hskip.1em\hfil$#$\hfil\crcr
    \cdots & \rar{\varepsilon_*} & H_{p+2}(K,L) \cr
    && \dar{\partial_*} \cr
    && H_{p+1}(L) & \rar{i_*} & H_{p+1}(K) & \rar{\varepsilon_*} & H_{p+1}(K,L) \cr
    &&&&&& \dar{\partial_*} \cr
    &&&&&& H_{p}(L) & \rar{i_*} & H_{p}(K) & \rar{\varepsilon_*} & H_{p}(K,L) \cr
    &&&&&&&&&& \dar{\partial_*} \cr
    &&&&&&&&&& H_{p-1}(L) & \rar{i_*} & \cdots \cr
  }
$$

\bye

enter image description here

2
  • Not really; the arrows are not the same. I find those holes unacceptable.
    – egreg
    Mar 23, 2016 at 22:52
  • @egreg I never claimed that it is as beautiful as your solution ;) Mar 24, 2016 at 18:40

You must log in to answer this question.

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