![如何使用 TiKZ 在 A4 纸上插入思维导图](https://linux22.com/image/323896/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20TiKZ%20%E5%9C%A8%20A4%20%E7%BA%B8%E4%B8%8A%E6%8F%92%E5%85%A5%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE.png)
我需要用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}
我的问题是:
- 我该如何调整思维导图的大小以便将其插入 A4 文档中?我尝试插入思维导图,更改文档类别,设计从工作表中显示出来。
- 我希望相对于根概念的圆比其他圆大。我该怎么做?
提前感谢您的合作
答案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}