2

The following program copied from Mindmap/trees in TikZ is compiling independently.


\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{mindmap}


\begin{document}
\begin{tikzpicture}[
  mindmap,
  every node/.style={concept, execute at begin node=\hskip0pt},
  root concept/.append style={
    concept color=black, fill=white, line width=1ex, text=black
  },
  text=white, grow cyclic,
  level 1/.append style={level distance=4.5cm,sibling angle=90},
  level 2/.append style={level distance=3cm,sibling angle=45}
]

\node[root concept] {Computational Complexity} % root
child[concept color=red] { node {Computational Problems}
child { node {Problem Measures} }
child { node {Problem Aspects} }
child { node {Problem Domains} }
child { node {Key Problems} }
}
child[concept color=blue] { node {Computational Models}
child { node {Turing Machines} }
child { node {Random-Access Machines} }
child { node {Circuits} }
child { node {Binary Decision Diagrams} }
child { node {Oracle Machines} }
child { node {Programming in Logic} }
}
child[concept color=orange] { node  {Measuring Complexity}
child { node {Complexity Measures} }
child { node {Classifying Complexity} }
child { node {Comparing Complexity} }
child { node {Describing Complexity} }
}
child[concept color=green!50!black] { node {Solving Problems}
child { node {Exact Algorithms} }
child { node {Randomization} }
child { node {Fixed-Parameter Algorithms} }
child { node {Parallel Computation} }
child { node {Partial Solutions} }
child { node {Approximation} }
};
\end{tikzpicture}
\end{document}

However, when I try to include this file in my main document using the following, I get an error.

\begin{figure}[h!]

\includestandalone[width=.8\textwidth]{figures/mindMapExample}

\end{figure}

The error says: pgfkeys: I do not know the key '/tikz/mindmap' and I am going to ignore it. Perhaps you misspelled it. ]

How to resolve it?

2
  • Please provide a complete example of your main document. Do you load the standalone package? Which TikZ-packages are loaded...
    – LaRiFaRi
    Jul 15, 2014 at 11:52
  • 5
    You need \usetikzlibrary{mindmap} in the main document. Jul 15, 2014 at 11:55

1 Answer 1

3

As mentioned in comments, use standalone and mindmap packages:

\documentclass[11pt]{article} % use larger type; default would be 10pt
\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
\usepackage{standalone}
\usepackage{tikz}
\usetikzlibrary{mindmap}

\title{Tikz: Using standalone}
\author{Sooraj}

\begin{document}
\maketitle
\section{Computional complexity}
Now, when I try to include this file in my main document using the following, I get this:
\begin{figure}[h!]
\includestandalone[width=.8\textwidth]{figures/mindMapExample}
\caption{Blablabla}
\end{figure}

\end{document}

includestandalone presumes that all the needed packages are already loaded by main..

In result you get this:

enter image description here

1
  • You could also use the subpreambles option for the standalone package to prevent the need for duplicating includes of TikZ libraries: \usepackage{standalone}[subpreambles=true]
    – Stanley F.
    Oct 27, 2022 at 8:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .