思维导图的问题

思维导图的问题

我在以下 MWE 中有两个思维导图,并且遇到了一些问题。

思维导图几乎完全相同,但一些子节点出现在不同的位置,特别是 Int.2,与节点右边缘留下不同的空间,如红色十字所示。

此外,无论我引入什么更改,我总是会收到相同的过满警告

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

无论我做了什么更改,总是太宽 7.53343pt,而且我没有在任何地方看到过过满的问题......

如果有人能帮忙我将非常感激。谢谢!

梅威瑟:

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

其结果为:

在此处输入图片描述

答案1

例如,你可以做这样的事情:

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

思维导图

请注意,由于上方有带星号的节点,右侧地图中从 Int.2 到右边缘的距离更大。如果您不想要这样,则需要重新定位该节点。(或者扩展左侧地图的背景。)不过,据我所知,这确实使角度正确。也就是说,两个 Int.2 节点垂直对齐,而当我运行您的原始 MWE 时并没有发生这种情况。

相关内容