When using the distance style attribute on edges, for example,
\tikzstyle{flowloop} = [out=-150, in=-30, looseness=0.8, loop, distance=7*\limw]
or
\tikzstyle{flowloop} = [out=-150,in=-30,looseness=0.8,distance=9*\limw]
I get excessive whitespace around my edges. I've tried using clip and 'use as bounding box' to no avail. Any suggestions on how to remove it or not have it appear in the first place? I've had to resort to using the 'pdfcrop' bundled with TeXLive to get rid of it.
See attached code and graphic to see what I mean. You'll notice that there's a loop's width of whitespace to the left and right of my two bottom loops.
\def\limw{0.050\textwidth}
\setlength{\tabcolsep}{1pt}
\renewcommand{\arraystretch}{0.3}
\def\bug{\includegraphics[width=\limw]{graphics/icons/kbugbuster}}
\def\suser{\includegraphics[width=\limw]{graphics/icons/system-users}}
\def\hat{\includegraphics[width=\limw]{graphics/icons/applications-engineering}}
\def\patch{\includegraphics[width=\limw]{graphics/icons/text-x-patch}}
\def\source{\includegraphics[width=\limw]{graphics/icons/text-x-objchdr}}
\def\debf{\includegraphics[width=\limw]{graphics/icons/application-x-deb}}
\def\litim{%
\bug
\hat
\suser
\patch
\source
}
\def\litimt{%
\begin{tabular}{c c}
\bug & \hat \\
\suser & \patch\\
\source &
\end{tabular}
}
\def\litimp{%
\begin{tabular}{c c}
\bug & \hat\\
\suser & \patch\\
\source & \debf
\end{tabular}
}
% Define a few styles and constants
\def\blockdist{8.0*\limw}
\def\logosize{3.2em}
\tikzstyle{projects} = [draw, fill=orange!30, text width=5em,
text centered, minimum height=\logosize+0.6em,
node distance=0.5*\blockdist and \blockdist]
\tikzstyle{ecosystem} = [projects, text width=6em, fill=blue!30,
minimum height=12em, rounded corners, draw=black,dashed,
node distance=\blockdist and \blockdist]
\tikzstyle{label} = [text width=6em, text centered,
node distance=0.1*\blockdist and 0.1*\blockdist]
%\tikzstyle{flowloop} = [out=-150, in=-30, looseness=0.8, loop, distance=7*\limw]
\tikzstyle{flowloop} = [out=-150, in=-30,looseness=0.8,distance=9*\limw]%distance=8*\limw]
\pgfdeclarelayer{background2}
\pgfdeclarelayer{background1}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background2,background1,main,foreground}
\begin{tikzpicture}
\node (debian) [projects] {\includegraphics[height=\logosize]{graphics/logos/DebianLogo}};
\node (derivs) [projects, node distance=5*\limw, below=of debian] {Debian derivatives};
\node (decos label) [label,below=of derivs] {Debian ecosystem};
\node (kde) [projects, above=of debian]
{\includegraphics[height=\logosize]{graphics/logos/KDELogo}};
\node(gcc) [projects, right=of kde]
{\includegraphics[height=\logosize]{graphics/logos/GCCLogo}};
\path ($ (kde)!.5!(gcc) $) node (upstr label) [label] {Upstream projects};
\node (fedora) [projects, right=of debian]
{\includegraphics[height=\logosize]{graphics/logos/FedoraLogo}};
\node (OpenBSD) [projects, right=of derivs]
{\includegraphics[height=\logosize]{graphics/logos/GentooLogo}};
\node (oecos label) [label,below=of OpenBSD] {Other ecosystems};
\begin{pgfonlayer}{background1}
\node (oecos) [ecosystem, fit={(fedora) (OpenBSD) (oecos label)}] {};
\node (decos) [ecosystem, fit={(decos label) (debian) (derivs)}] { };
\end{pgfonlayer}
\path ($ (oecos.south)!.5!(decos.south) $)+(0,-3em) node [label] (FOSS label) {FOSS Ecosystem};
\begin{pgfonlayer}{background1}
\end{pgfonlayer}
\begin{pgfonlayer}{background1}
\node (upstreams) [ecosystem,fit={(kde) (upstr label) (gcc)},minimum
height=4em] {};
\end{pgfonlayer}
\path [draw, <->] (debian) -- node {\litimp} (derivs);
\path [draw, <->] (decos.east) -- node[above] {\litim} (oecos.west);
\path [draw, <->] (decos.north |- upstreams.south) -- node {\litimt} (decos.north);
\path [draw, <->] (oecos.north |- upstreams.south) -- node {\litimt} (oecos.north);
\path [draw, ->] (decos.270) edge[flowloop]
node [pos=0.25] (lbugl) {\bug}
node [pos=0.35] {\hat}
node [pos=0.45] {\suser}
node [pos=0.55] (lpatch) {\patch}
node [pos=0.65] {\source}
node [pos=0.75] {\debf}
(decos.270);
\path [draw, ->] (oecos.270) edge[flowloop]
node [pos=0.25] {\bug}
node [pos=0.375] {\hat}
node [pos=0.50] {\suser}
node [pos=0.625] (lpatch) {\patch}
node [pos=0.75] (lsource) {\source}
(oecos.270);
\path [draw, ->] (upstreams.270) edge[flowloop]
node [pos=0.25] {\bug}
node [pos=0.375] {\hat}
node [pos=0.50] {\suser}
node [pos=0.625] {\patch}
node [pos=0.75] {\source}
(upstreams.270);
\begin{pgfonlayer}{background2}
\path[use as bounding box,clip] node (foss)
[ecosystem,fill=blue!50,fit=(oecos) (decos) (lpatch) (lbugl) (lsource)
(FOSS label) (upstreams)] {};
\end{pgfonlayer}
\clip (foss.north east) rectangle (foss.south west);
\end{tikzpicture}
See the following image to get an idea of the whitespace:
current bounding box
can be used to diagnose this).current bounding box
node can help diagnose whitespace. Insert\draw (current bounding box.south west) rectangle (current bounding box.north east);
before and after the suspect command to see how much whitespace it adds.use as bounding box
, you first have to call\pgfresetboundingbox
, asuse as bounding box
will not decrease the size of the bounding box.