[Tex/LaTex] Tikz-cd and snake lemma: “loseness” and centered figures

tikz-cdtikz-pgf

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?

Best Answer

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