7

I'm trying to create a binary tree using TeXstudio. I used the instructions listed in this question: Drawing binary trees with LaTeX labels

When I compile it, I got this error:

enter image description here

I checked if I have the package or not and here is the packages I have:

Packages

this is the result I got after adding \usepackage{tikz}: enter image description here

F 505
  • 525
  • 4
    You don't have \usepackage{tikz} declared in your preamble. It's not enough to have it in MiKTeX, you have to load it in your document. Read also our starter guide to familiarize yourself further with our format. – CarLaTeX Nov 12 '16 at 17:59

1 Answers1

11

The implicit load of TikZ package in that example comes from the fact that standalone class has an option to load TikZ automatically if you use

\documentclass[tikz]{standalone}

but if you are using article class then you have to explicitly load the packages hence you need to add

\usepackage{tikz}

to your preamble before \usetikzlibrary{}

percusse
  • 157,807