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.

I have to draw a snake lemma, as here: snake lemma.

The code is

\documentclass{article}
    \usepackage{tikz-cd}
    \usepackage{amsmath}
    \DeclareMathOperator{\Tor}{Tor}
    \begin{document}
    \begin{tikzcd}
              \cdots \rar   & \Tor_3^A(A, M) \rar & \Tor_3^A(K,M) \rar & \Tor_3^A(K/A,M) \ar[out=0, in=180, looseness=2]{dll}   & \\
                    & \Tor_2^A(A, M) \rar & \Tor_2^A(K,M) \rar & \Tor_2^A(K/A,M) \ar[out=0, in=180, looseness=2]{dll}   & \\
                    & \Tor_1^A(A, M) \rar & \Tor_1^A(K,M) \rar & \Tor_1^A(K/A,M) \ar[out=0, in=180, looseness=2]{dll}   & \\
                    & A \otimes_A M  \rar & K \otimes_A M \rar & K/A\otimes_A M \rar                    & 0
        \end{tikzcd}
\end{document}

The resulting diagram is shifted on the very right side of the page. The more I increase the value of looseness the more the figure is shifted.

How can I center the figure?

share|improve this question
1  
Nice question! For a while you can push it back using negative horizontal space \hspace{-3cm} for example. –  Sigur Jan 28 '13 at 22:43
    
Great! I haven't thought about it. Thank you. –  Andrea Gagna Jan 28 '13 at 22:51
2  
I think it is worth linking this to tex.stackexchange.com/q/43621/86 which contains the explanation as to why the excess space occurs (and a variety of ways to get around the problem). –  Loop Space Jan 29 '13 at 11:45

1 Answer 1

up vote 13 down vote accepted

You can add the overlay option to those problematic arrows, so they don't affect the bounding box calculation. I did it in this MWE, now the diagram is centered:

\documentclass{article}
\usepackage{tikz-cd}
\usepackage{amsmath}
\DeclareMathOperator{\Tor}{Tor}
\begin{document}
\begin{tikzcd}
  \cdots \rar   & \Tor_3^A(A, M) \rar & \Tor_3^A(K,M) \rar & \Tor_3^A(K/A,M)
          \ar[out=0, in=180, looseness=2, overlay]{dll}   & \\
        & \Tor_2^A(A, M) \rar & \Tor_2^A(K,M) \rar & \Tor_2^A(K/A,M)
          \ar[out=0, in=180, looseness=2, overlay]{dll}   & \\
        & \Tor_1^A(A, M) \rar & \Tor_1^A(K,M) \rar & \Tor_1^A(K/A,M)
          \ar[out=0, in=180, looseness=2, overlay]{dll}   & \\
        & A \otimes_A M  \rar & K \otimes_A M \rar & K/A\otimes_A M \rar & 0
\end{tikzcd}
\end{document}

centered diagram

share|improve this answer
    
Fantastic, thank you! –  Andrea Gagna Jan 29 '13 at 19:51

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.