Why do I have so much free space on the left-hand side of my tikz diagram?
Something about the curvy edge is increasing the bounding box by a lot. This could be considered a bug. To cancel that effect, add overlay
to the options for the \path
which draws the arrows.
You might also consider using \limits
for your \bigoplus
es and \mathclap
(reference) to get the subscripts taking up less space. Here's my version:
\def\mathclap{\mathpalette\mathclapinternal}
\def\mathclapinternal#1#2{\clap{$\mathsurround=0pt#1{#2}$}}
\let\oldbigoplus=\bigoplus
\def\bigoplus{\oldbigoplus\limits}
\begin{tikzpicture}[remember picture=true]
\matrix (m) [
matrix of math nodes,
row sep=1em,
column sep=2em,
text height=1.5ex, text depth=0.25ex
]
{Q_{5}\oplus\bigoplus_{\mathclap{i\in\{1,2,3,4\}}} Q_{12345\setminus i}[1] &
\bigoplus_{\mathclap{l\in\{1,2,3,4\}}} Q_{l5}\oplus Q_{12345}[1] &
\bigoplus_{\mathclap{j\neq k\in\{1,2,3,4\}}} Q_{jk5} \\
\bigoplus_{\mathclap{i\in\{1,2,3,4\}}} Q_{12345\setminus i} &
Q_{12345} &
S_{12345} \\
};
\path[overlay,->, font=\scriptsize,>=latex]
(m-1-1) edge (m-1-2)
(m-1-2) edge (m-1-3)
(m-1-3) edge[out=348,in=172] (m-2-1)
(m-2-1) edge (m-2-2)
(m-2-2) edge (m-2-3);
\end{tikzpicture}
PS: Your descr/.style=...
declaration has no effect unless you are actually applying the style to something. So you can cut that out for minimal example purposes.
Edit: I have incorporated @Caramdir's suggested edits.
Some additional small improvements on Matthew's version: In the original example I removed text height=1.5ex, text depth=0.25ex
which I usually add to center the arrows on complicated the text. However, it is necessary here. Also the starting and ending directions of the curved arrow need to be tweaked a little bit:
\documentclass{article}
\usepackage{tikz,mathtools} %mathtools provides \mathclap
\usetikzlibrary{matrix,arrows}
\let\oldbigoplus=\bigoplus
\def\bigoplus{\oldbigoplus\limits}
\begin{document}
\begin{tikzpicture}
\matrix (m) [
matrix of math nodes,
row sep=2.5em,
column sep=2em,
text height=1.5ex, text depth=0.25ex
]
{Q_{5}\oplus\bigoplus_{\mathclap{i\in\{1,2,3,4\}}} Q_{12345\setminus i}[1] &
\bigoplus_{\mathclap{l\in\{1,2,3,4\}}} Q_{l5}\oplus Q_{12345}[1] &
\bigoplus_{\mathclap{j\neq k\in\{1,2,3,4\}}} Q_{jk5} \\
\bigoplus_{\mathclap{i\in\{1,2,3,4\}}} Q_{12345\setminus i} &
Q_{12345} &
S_{12345} \\
};
\path[overlay,->, font=\scriptsize,>=latex]
(m-1-1) edge (m-1-2)
(m-1-2) edge (m-1-3)
(m-1-3) edge[out=348,in=172] (m-2-1)
(m-2-1) edge (m-2-2)
(m-2-2) edge (m-2-3);
\end{tikzpicture}
\end{document}
It is most definitely the curvy path which is pushing things out. To see this, you can draw the bounding box at a particular point by writing:
\draw (current bounding box.north west) rectangle (current bounding box.south east);
at appropriate junctures, say after the \matrix
and after the \path
commands. Note that this draws the current bounding box so putting it at different places shows how the bounding box changes during the diagram.
As an alternative solution, the \useasboundingbox
sets the bounding box for the picture. To be accurate, it means that as far as the bounding box is concerned everything after this command gets ignored. So putting it after the matrix command but before the path command means that the matrix gets used for the bounding box but the path doesn't. Thus my soution:
\documentclass{article}
\thispagestyle{empty}
\usepackage[scale=.96]{geometry}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows}
\begin{document}
\begin{tikzpicture}
\matrix (m) [
matrix of math nodes,
row sep=2em,
column sep=2em,
]
{ Q_{5}\oplus\bigoplus_{i\in\{1,2,3,4\}} Q_{12345\setminus i}[1] &
\bigoplus_{l\in\{1,2,3,4\}} Q_{l5}\oplus Q_{12345}[1] &
\bigoplus_{j\neq k\in\{1,2,3,4\}} Q_{jk5} \\
\bigoplus_{i\in\{1,2,3,4\}} Q_{12345\setminus i} &
Q_{12345} &
S_{12345} \\
};
\useasboundingbox (0,0);
\path[->, font=\scriptsize,>=latex]
(m-1-1) edge (m-1-2)
(m-1-2) edge (m-1-3)
(m-1-3) edge[out=355,in=175] (m-2-1)
(m-2-1) edge (m-2-2)
(m-2-2) edge (m-2-3);
\end{tikzpicture}
\end{document}
The effect of the overlay
tag is similar. That tag removes the path from the bounding box consideration, whereas the \useasboundingbox
removes everything after it (but not including itself).