我在 TikZ 和 PGF 软件包 3.0.1a 版手册第 81 页的示例中收到一条错误消息

我在 TikZ 和 PGF 软件包 3.0.1a 版手册第 81 页的示例中收到一条错误消息

我复制了以下代码,并在复制粘贴中重建了丢失的换行符。

\begin{tikzpicture}[mindmap]
    \begin{scope}[
        every node/.style={concept,circular drop shadow,execute at begin node=\hskip0pt},
        root concept/.append style={
            concept color=black,fill=white,line width=1ex,text=black,font=\large\scshape},
        text=white,
        computational problems/.style={concept color=red,faded/.style={concept color=red!50}},
        computational models/.style={concept color=blue,faded/.style={concept color=blue!50}},
        measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}},
        solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}},
        grow cyclic,
        level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape},
        level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}]
        \node[root concept] {  ComputationalComplexity}% root
        child[computational problems] {node{ComputationalProblems}
            child{node{ProblemMeasures} }
            child{node{ProblemAspects} }
            child[faded] {node{ProblemDomains} }
            child{node{KeyProblems} }}
        child[computational models] {node{ComputationalModels}
            child{node{TuringMachines} }
            child[faded] {node{Random-AccessMachines} }
            ...
    \end{scope}
\end{tikzpicture}

但是,Latex 编辑器返回以下错误:

在此处输入图片描述

答案1

您复制了一个片段。您至少需要确保保留所有结束括号和分号。此外,如果您发布示例,请确保它们以 开头\documentclass和以 结尾\end{document},以便至少在原则上可以编译它们。

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{mindmap,shadows}
\begin{document}
\begin{tikzpicture}[mindmap]
    \begin{scope}[
        every node/.style={concept,circular drop shadow,execute at begin node=\hskip0pt},
        root concept/.append style={
            concept color=black,fill=white,line width=1ex,text=black,font=\large\scshape},
        text=white,
        computational problems/.style={concept color=red,faded/.style={concept color=red!50}},
        computational models/.style={concept color=blue,faded/.style={concept color=blue!50}},
        measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}},
        solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}},
        grow cyclic,
        level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape},
        level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}]
        \node[root concept] {  ComputationalComplexity}% root
        child[computational problems] {node{ComputationalProblems}
            child{node{ProblemMeasures} }
            child{node{ProblemAspects} }
            child[faded] {node{ProblemDomains} }
            child{node{KeyProblems} }}
        child[computational models] {node{ComputationalModels}
            child{node{TuringMachines} }
            child[faded] {node{Random-AccessMachines} }};
%            ...
    \end{scope}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容