当在长文本上使用 TikZ 思维图库时,文本只会变成一条细线,而节点会放大(见下文)。当使用参数时text width
,内接矩形会变宽,但气泡对于内接文本来说仍然太大了。
如何合理利用思维导图节点的空间?
\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{mindmap, trees}
% laymans blindtext
\newcounter{int}
\newcommand{\blindtext}[1]{\setcounter{int}{0}\loop This is a long text. \addtocounter{int}{1}\ifnum\value{int}<#1\repeat}
\begin{document}
\begin{tikzpicture}[
mindmap,
concept color=gray!50,
text=black,
level 1 concept/.append style={
level distance=9 cm,
sibling angle=72}
]
\node[concept] {} [clockwise from=0]
child {node[concept] {\blindtext{10}}}
child {node[concept, text width=4.5cm] {\blindtext{10}}};
\end{tikzpicture}
\end{document}
答案1
可以使用shapepar
包将文字铸造成圆形。
为什么这样做会直接失败并出现“失控参数?”这个问题在我上面,但可以先绘制一个空节点,然后叠加文本:
\documentclass{scrartcl}
\usepackage{tikz, shapepar}
\usetikzlibrary{mindmap, trees}
% laymans blindtext
\newcounter{int}
\newcommand{\blindtext}[1]{\setcounter{int}{0}\loop This is a long text. \addtocounter{int}{1}\ifnum\value{int}<#1\repeat}
\begin{document}
\begin{tikzpicture}[
mindmap,
text centered,
concept color=gray!50,
text=black,
level 1 concept/.append style={
level distance=9 cm,
sibling angle=72}
]
\node[concept] {} [clockwise from=0]
child {node[concept, text width=4.5cm] (node1) {}};
\node[extra concept, fill=none, draw=none, text width=4.5cm] at (node1) {\Shapepar{\circleshape} \blindtext{10}\par};
\end{tikzpicture}
\end{document}