When using the distance style attribute on edges, for example,

\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]

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.

  \begin{tabular}{c c}
    \bug & \hat \\
    \suser & \patch\\
    \source &
  \begin{tabular}{c c}
    \bug & \hat\\
    \suser & \patch\\
    \source & \debf
% Define a few styles and constants
\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]

    \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]
    \node(gcc) [projects, right=of kde]
    \path ($ (kde)!.5!(gcc) $) node (upstr label) [label] {Upstream projects};

    \node (fedora) [projects, right=of debian]
    \node (OpenBSD) [projects, right=of derivs]
    \node (oecos label) [label,below=of OpenBSD] {Other ecosystems};

      \node (oecos) [ecosystem, fit={(fedora) (OpenBSD) (oecos label)}] {};
      \node (decos) [ecosystem, fit={(decos label) (debian) (derivs)}] { };

    \path ($ (oecos.south)!.5!(decos.south) $)+(0,-3em) node [label] (FOSS label) {FOSS Ecosystem};


      \node (upstreams) [ecosystem,fit={(kde) (upstr label) (gcc)},minimum
      height=4em] {};

    \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}
    \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}
    \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}

      \path[use as bounding box,clip] node (foss)
      [ecosystem,fill=blue!50,fit=(oecos) (decos) (lpatch) (lbugl) (lsource)
        (FOSS label) (upstreams)] {};
    \clip (foss.north east) rectangle (foss.south west);

See the following image to get an idea of the whitespace: Excess whitespace around edges with distance style attribute

  • My guess is that the control points for the loops are forcing the bounding box to be too big (see tex.stackexchange.com/q/4654/86 for a similar situation, and also how the current bounding box can be used to diagnose this). Jun 14, 2011 at 13:35
  • 1
    Whitespace is... white. It's difficult to get a handle on what the problem is from the above picture. (I'm reminded of a joke from Red Dwarf: Holly says "the thing about black holes is they're black. and the thing about space is... it's black"... Anyone?
    – Seamus
    Jun 14, 2011 at 13:36
  • 2
    @Seamus: "But what is it?" "It's like a magic door." "Well, why didn't you say so!". Seriously, that's why using the 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. Jun 14, 2011 at 15:32
  • I'd help, but I can't compile your sample without the images. Jun 15, 2011 at 0:10
  • If you use use as bounding box, you first have to call \pgfresetboundingbox, as use as bounding box will not decrease the size of the bounding box.
    – Jake
    Jun 15, 2011 at 3:09

1 Answer 1


If you add the overlay option to your picture, the bounding box will be set to 0x0, which gets rid of the whitespace. You can prove it to yourself by putting the picture in an \fbox:


To re-establish the bounding box, I think the "use as bounding box" option on a path will do it.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .