2

I have two mindmaps in the following MWE and have a couple of problems.

The mindmaps are almost identical, but some child nodes appear at different positions, in particular Int.2, leaving different space with the right edge of the node, as indicated with red crosses.

Besides, no matter all the changes I introduce, I ALWAYS get the same overfull warning

 Overfull \hbox (7.53343pt too wide) in paragraph at lines 61--61

ALWAYS 7.53343pt too wide, no matter the changes I make, and I do not see any overfull problem anywhere...

I would really appreciate if someone could help. Thanks!

MWE:

\documentclass{beamer}

\usepackage{tikz,lmodern}
\usetikzlibrary{positioning,shadows,calc,mindmap,trees,shapes,
    decorations.pathreplacing}

\begin{document}



\begin{frame}

\begin{center}
\begin{tikzpicture}
    \node[inner sep=0, fill=yellow] (A) at (0,0) {
    \resizebox{.4\linewidth}{!}{%
    \begin{tikzpicture}
        \path[small mindmap,concept color=white!99!green, text=black,
        level 1 concept/.append style=
        {every child/.style=, sibling angle=-30}]
        node[concept, scale=0.8, font=\large] {BRCA1}[counterclockwise from=0]
            child[concept color=green]{node[concept, scale=0.6, font=\large] at(2,0) {Int.1}}
            child[concept color=green]{node[concept, scale=1.1] at(2,-.8) {Int.2}}
            child[concept color=green, opacity=0]{node[concept, star, star points=18, scale=0.6, font=\LARGE] at(1,-.5) {Int.3}}
            child[concept color=green]{node[concept, scale=0.7, font=\large] at(-.2,-1.5) {Int.5}}
            child[concept color=green]{node[concept, scale=0.5, font=\large] at(0,0) {Int.6}}
            child[concept color=green!25!white]{node[concept, scale=0.4, font=\LARGE] at(-3,.5) {Int.8}}
            child[concept color=white!90!green]{node[concept, star, star points=18, scale=0.4, font=\huge] at(-.5,1) {Int.9}}
            child[concept color=green!25!white]{node[concept, scale=0.6, font=\large] at(-.3,1) {Int.10}}
            child[concept color=green]{node[concept] at(0,2) {Int.11}}
            child[concept color=green!25!white]{node[concept, scale=1.3] at(1.5,-.5) {Int.13}}
            child[concept color=green, opacity=0]{node[concept, star, star points=18, scale=0.3, font=\huge] at(4,-.1) {Int.14}}
        ;
    \end{tikzpicture}
    }%
    };


    \node[inner sep=0, fill=yellow, right=.2cm of A] (B) {
    \resizebox{.4\linewidth}{!}{%
    \begin{tikzpicture}
        \path[small mindmap,concept color=black!90!green, text=white,
        level 1 concept/.append style=
        {every child/.style=, sibling angle=-30}]
        node[concept, scale=0.8, font=\large] {BRCA1}[counterclockwise from=0]
            child[concept color=green, text=black]{node[concept, scale=0.6, font=\large] at(2,0) {Int.1}}
            child[concept color=green, text=black]{node[concept, scale=1.1] at(2,-.8) {Int.2}}
            child[concept color=black!75!green]{node[concept, star, star points=18, scale=0.6, font=\LARGE] at(1,-.5) {Int.3}}
            child[concept color=green, text=black]{node[concept, scale=0.7, font=\large] at(-.2,-1.5) {Int.5}}
            child[concept color=green, text=black]{node[concept, scale=0.5, font=\Large] at(0,0) {Int.6}}
            child[concept color=green!60!black]{node[concept, scale=1.2] at(-3,.5) {Int.8}}
            child[concept color=green, text=black, opacity=0]{node[concept, star, star points=18, scale=0.4, font=\huge] at(-.5,1) {Int.9}}
            child[concept color=green!60!black]{node[concept, scale=1.1] at(-.3,1) {Int.10}}
            child[concept color=green, text=black]{node[concept] at(0,2) {Int.11}}
            child[concept color=green!60!black]{node[concept, scale=0.7, font=\large] at(1.5,-.5) {{\large Int.13}}}
            child[concept color=black!75!green]{node[concept, star, star points=18, scale=0.3, font=\huge] at(4,-.1) {Int.14}}
        ;
    \end{tikzpicture}
    }%
    };
\end{tikzpicture}
\end{center}
\end{frame}

\end{document}

Which produces:

enter image description here

7
  • The problem remains even using report class.
    – Sigur
    Commented Jul 20, 2014 at 0:16
  • TikZ nodes are also \hboxes look at the following line in the warning and you'll see the offending nodes. For example try Int. 14 Instead of nesting tikzpictures inside nodes, use scopes and place them properly and relatively. The problem is the star spikes enlarge the bounding box.
    – percusse
    Commented Jul 20, 2014 at 0:20
  • could you provide a MWE? I'm not really familiar with mindmaps and do not even know what scopes are... Thanks!
    – DaniCee
    Commented Jul 20, 2014 at 0:31
  • The shift in the coordinate changes things. You can reproduce with just 2 nodes (the root and Int.2, say). As soon as you move the second mindmap, the placement changes. (You don't need the spikes to show this much.)
    – cfr
    Commented Jul 20, 2014 at 0:37
  • @Sigur I think DaniCee hoped for a MWE demonstrating the solution. I'm sure the OP already knows how to reproduce the problem...
    – cfr
    Commented Jul 20, 2014 at 0:38

1 Answer 1

1

For example, you could do something like this:

\documentclass{standalone}

\usepackage{tikz,lmodern}
\usetikzlibrary{positioning,calc,mindmap,trees,shapes,backgrounds}

\begin{document}

\begin{tikzpicture}
        \path[small mindmap,concept color=white!99!green, text=black,
        level 1 concept/.append style=
        {every child/.style=, sibling angle=-30}]
        node[concept, scale=0.8, font=\large] at (0,0) {BRCA1}[counterclockwise from=0]
            child[concept color=green]{node (int1) [concept, scale=0.6, font=\large] at(2,0) {Int.1}}
            child[concept color=green, text=black]{node[concept, scale=1.1] at(2,-.8) {Int.2}}
            child[concept color=green, opacity=0]{node[concept, star, star points=18, scale=0.6, font=\LARGE] at(1,-.5) {Int.3}}
            child[concept color=green]{node (int5) [concept, scale=0.7, font=\large] at(-.2,-1.5) {Int.5}}
            child[concept color=green]{node[concept, scale=0.5, font=\large] at(0,0) {Int.6}}
            child[concept color=green!25!white]{node (int8) [concept, scale=0.4, font=\LARGE] at(-3,.5) {Int.8}}
            child[concept color=white!90!green]{node[concept, star, star points=18, scale=0.4, font=\huge] at(-.5,1) {Int.9}}
            child[concept color=green!25!white]{node[concept, scale=0.6, font=\large] at(-.3,1) {Int.10}}
            child[concept color=green]{node (int11) [concept] at(0,2) {Int.11}}
            child[concept color=green!25!white]{node[concept, scale=1.3] at(1.5,-.5) {Int.13}}
            child[concept color=green, opacity=0]{node[concept, star, star points=18, scale=0.3, font=\huge] at(4,-.1) {Int.14}}
        ;
        \path[small mindmap,concept color=black!90!green, text=white,
        level 1 concept/.append style=
        {every child/.style=, sibling angle=-30}]
        node[concept, scale=0.8, font=\large] at (12,0) {BRCA1}[counterclockwise from=0]
            child[concept color=green, text=black]{node[concept, scale=0.6, font=\large] at(2,0) {Int.1}}
            child[concept color=green, text=black]{node[concept, scale=1.1] at(2,-.8) {Int.2}}
            child[concept color=black!75!green]{node[concept, star, star points=18, scale=0.6, font=\LARGE] at(1,-.5) {Int.3}}
            child[concept color=green, text=black]{node[concept, scale=0.7, font=\large] at(-.2,-1.5) {Int.5}}
            child[concept color=green, text=black]{node[concept, scale=0.5, font=\Large] at(0,0) {Int.6}}
            child[concept color=green!60!black]{node (int8x) [concept, scale=1.2] at(-3,.5) {Int.8}}
            child[concept color=green, text=black, opacity=0]{node[concept, star, star points=18, scale=0.4, font=\huge] at(-.5,1) {Int.9}}
            child[concept color=green!60!black]{node[concept, scale=1.1] at(-.3,1) {Int.10}}
            child[concept color=green, text=black]{node[concept] at(0,2) {Int.11}}
            child[concept color=green!60!black]{node[concept, scale=0.7, font=\large] at(1.5,-.5) {{\large Int.13}}}
            child[concept color=black!75!green]{node (int14x) [concept, star, star points=18, scale=0.3, font=\huge] at(4,-.1) {Int.14}}
        ;
        \begin{scope}[on background layer]
            \fill [yellow] ($(int8.west |- int11.north) + (-1pt,1pt)$) coordinate (c1) -- ($(int1.east |- c1) + (1pt,0)$) coordinate (c2) -- ($(int5.south -| c2) - (0,1pt)$) coordinate (c3) -- (c3 -| c1) -- cycle;
            \fill [yellow] ($(int8x.west |- int11.north) + (-1pt,1pt)$) coordinate (c4) -- ($(int14x.east |- c4) + (5pt,0)$) coordinate (c5) -- ($(int5.south -| c5) - (0,1pt)$) coordinate (c6) -- (c6 -| c4) -- cycle;
        \end{scope}

\end{tikzpicture}

\end{document}

mindmaps

Notice that the distance to the right edge from Int.2 is greater in the right hand map because of the starred node above. If you don't want that, you need to relocate that node. (Or extend the background of the left map.) This does, however, get the angles right as far as I can tell. That is, the two Int.2 nodes are aligned vertically which didn't happen when I ran your original MWE.

3
  • This solves the problem of the Int.2 position, but the "Overfull \hbox (7.53343pt too wide)" warning still persists... It doesn't seem to be due to Int.14 being a star, cause changing this does not solve the warning... any ideas?
    – DaniCee
    Commented Jul 20, 2014 at 1:37
  • @DaniCee Try making the font \tiny and you will see the problem disappears. The issue is not the star shape per se but it is that node: there is too much stuff for the size of the node. Try switching the \Huge to \LARGE as that seems to resolve the problem. (You need to do the same for the first mindmap node where this comes up, too.
    – cfr
    Commented Jul 20, 2014 at 1:43
  • aaaah righ right, it was the text inside the node, not the spikes getting out of the yellow square... thanks!!
    – DaniCee
    Commented Jul 20, 2014 at 1:50

You must log in to answer this question.

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