1

I have a tikz-cd diagram which does not want to sit in the middle of the page. I figured out it is because the names of the nodes are to long, because if I replace them all with X, then everything is fine.

\documentclass[a4paper, 11pt]{article}
\usepackage[a4paper,margin=1.0in]{geometry}
\usepackage{tikz-cd}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document} Does not look centered... [ \begin{tikzcd} ...\arrow[r] & {H_{k+1}(\mathbb R^n \times \mathbb R, H_-)} \arrow[r] & {H_{k+1}(\mathbb R^n\times \mathbb R, H_+\cup H_-)}\ar[out=-20, in=160]{dll} \ H_k(H_+\cup H_-, H_-) \arrow[r] &H_k(\mathbb R^n \times \mathbb R, H_-)\arrow[r] &... \end{tikzcd} ]

This looks much better: [ \begin{tikzcd} X\arrow[r] & {X} \arrow[r] & {X}\ar[out=-20, in=160]{dll} \ X \arrow[r] &X\arrow[r] &X \end{tikzcd} ]

\end{document}

View: https://www.overleaf.com/read/vyjykbkstykp

What can I do to shift my diagram into the middle of the page?

(What I have tried: different environments and adding empty nodes on the right hand side).

Sebastiano
  • 54,118
Nico
  • 145
  • 2
    In addition to the overlay option proposed by daleif, I suggest also you do \newcommand{\RR}{\mathbb{R}} in the preamble and use \RR instead of \mathbb R (which, by the way, should be \mathbb{R}) and avoid useless braces around the diagram nodes. Also ... should be \dotsb. – egreg Mar 23 '21 at 11:11

1 Answers1

3

This seems to be due to the special arrow you use, try using this instead

\ar[out=-20, in=160,overlay]{dll}

I added the overlay option, then the size is ignored in the size calculations.

daleif
  • 54,450
  • 2
    This probably uses a Bezier curve, and it is a known problem that the control points are taken into account in the bounding box calculation: https://tex.stackexchange.com/questions/290357/tikz-bounding-box-cropping-too-much-space-for-curves – Rmano Mar 23 '21 at 11:18
  • Thanks a lot :) I did not realize that the curve was the problem, since it works fine with different nodes. – Nico Mar 23 '21 at 12:20