如何使用 TiKZ 在 A4 纸上插入思维导图

如何使用 TiKZ 在 A4 纸上插入思维导图

我需要用LaTex制作思维导图,阅读手册后,我按照示例制作了下面的思维导图。

\documentclass[article, 12pt, oneside]{memoir}

\usepackage[a2paper]{geometry}
\usepackage{tikz}
\usetikzlibrary{mindmap}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[
    mindmap,
    grow cyclic, text width=4cm, align=flush center,
    every node/.style={concept},
    concept color=orange!40,
    %root/.style= {concept color=black!40,font=\large\bfseries,text width=12em},
    level 1/.style={level distance=8cm,sibling angle=90},
    level 2/.style={level distance=6cm,sibling angle=45},
    level 3/.style={level distance=6cm,sibling angle=45}]]

\node [root concept] {\textbf{Root concept}}
   child [concept color=blue!30] { node {Classification}
        child { node {first classification}}
        child { node {first classification}}
        child { node {first classification}}
    }
    child [concept color=green!30] { node {One concept}
        child [concept color=green!40]{ node {description \\ of concept 1}}
       % child { node {B}}
    }
    child [concept color=yellow!30] { node {Second \\ concept}
        child { node {Environment}}
        child { node {concept two}}
        child [concept color=red!40] { node {concept \\ three}
                child { node {Description of child concept one}}  
                child { node {Description of child concept two}}
                child { node {Description of child concept three}}      
        }
    }
    child [concept color=teal!40]  { node {Other concept}
        child { node {description concept}}
        child { node {description concept}}
        child { node {description concept}}
        child { node {...}}
        child { node {...}}
    }
    ;
\end{tikzpicture}
\end{document}

我的问题是:

  1. 我该如何调整思维导图的大小以便将其插入 A4 文档中?我尝试插入思维导图,更改文档类别,设计从工作表中显示出来。
  2. 我希望相对于根概念的圆比其他圆大。我该怎么做?

提前感谢您的合作

答案1

为了将其放在 A4 纸上,您可以将其tikzpicture附在

\resizebox{\textwidth}{!}{
    *code here*
}

对于节点大小,添加scale=2即可。我还添加了其他一些东西,例如将其封闭tikzpicture在图形环境中,以便您可以应用标题。

输出

图像

代码

\documentclass[article, 12pt, oneside, a4paper]{memoir}
\usepackage{geometry}
\usepackage{tikz}

\usetikzlibrary{mindmap}
\pagestyle{empty}

\begin{document}
\begin{figure}[!h]
\resizebox{\textwidth}{!}{
\begin{tikzpicture}[
    mindmap,
    grow cyclic, text width=4cm, align=flush center,
    every node/.style={concept},
    concept color=orange!40,
    %root/.style= {concept color=black!40,font=\large\bfseries,text width=12em},
    level 1/.style={level distance=8cm,sibling angle=90},
    level 2/.style={level distance=6cm,sibling angle=45},
    level 3/.style={level distance=6cm,sibling angle=45}]]

\node [root concept, scale=2] {\textbf{Root concept}}
   child [concept color=blue!30] { node {Classification}
        child { node {first classification}}
        child { node {first classification}}
        child { node {first classification}}
    }
    child [concept color=green!30] { node {One concept}
        child [concept color=green!40]{ node {description \\ of concept 1}}
       % child { node {B}}
    }
    child [concept color=yellow!30] { node {Second \\ concept}
        child { node {Environment}}
        child { node {concept two}}
        child [concept color=red!40] { node {concept \\ three}
                child { node {Description of child concept one}}  
                child { node {Description of child concept two}}
                child { node {Description of child concept three}}      
        }
    }
    child [concept color=teal!40]  { node {Other concept}
        child { node {description concept}}
        child { node {description concept}}
        child { node {description concept}}
        child { node {...}}
        child { node {...}}
    }
    ;
\end{tikzpicture}}
\caption{caption here}
\end{figure}
\end{document}

相关内容