Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Badbox from PGF layer using fit

This peace of code is compiled with 'Underfull \hbox (badness 1484) in paragraph at lines 23--23' message. Line 23 is \node[draw, inner sep = 10pt, fit=(MUL1) (MUL2)] {};. How can I get rid of underfull box?

\documentclass[a4paper]{report}

\usepackage{tikz}
\usetikzlibrary{positioning,fit}

\pgfdeclarelayer{background}
\pgfsetlayers{background,main} 

\begin{document}

\begin{tikzpicture}
  \node[draw]                  (MUL1) {MUL1};
  \node[draw, right = of MUL1] (MUL2) {MUL2};

  \node[left =  of MUL1] (A) {A};
  \node[right = of MUL2] (B) {B};

  \draw[->] (A)    -- (MUL1);
  \draw[->] (MUL1) -- (MUL2);
  \draw[->] (MUL2) -- (B);

  \begin{pgfonlayer}{background}
    \node[draw, inner sep = 10pt, fit=(MUL1) (MUL2)] {};
  \end{pgfonlayer}      
\end{tikzpicture}

\end{document}
share|improve this question

marked as duplicate by Jake, Guido, Thorsten, percusse, Loop Space Dec 3 '12 at 10:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
Welcome to TeX.sx! –  Kurt Dec 3 '12 at 2:13
    
This looks like it probably is a duplicate of the question that Jake points to. It currently has 4 votes to close as a duplicate. Could someone with the right version of TikZ (I have the CVS) please verify that the solution there does solve this one before anyone casts the final vote-to-close as duplicate? –  Loop Space Dec 3 '12 at 9:55
1  
(Someone just verified it for me in chat. I shan't name David Carlisle as he doesn't want it known that he has compiled a document using TikZ. Anyway, confirmed as duplicate.) –  Loop Space Dec 3 '12 at 10:01

2 Answers 2

There is a bug in the fit library of TikZ/pgf (v2.10). With the latest CVS version of TikZ/pgf (cf. my answer to How to install a current version of TikZ?), your MWE compiles without error or warning.

share|improve this answer

It has something to do with the empty node.

Writing

\begin{pgfonlayer}{background}
 \node[draw, inner sep = 10pt, fit=(MUL1) (MUL2)] {\hspace*{\fill}~};
\end{pgfonlayer}%      

instead will get rid of the underfull error. Seems there's got to be a better way to achieve your effect.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.