Originally, you had
\documentclass{article}
\documentclass{tikz-qtree}
...
A LaTeX document can only have one class as the error says. But you can also load packages to extend the functionality of the class. tikz-qtree
is not a document class at all: it is a package. So, you want:
\documentclass{article}
\usepackage{tikz-qtree}
...
EDIT
After correcting the problem above, you continued to report the same error. This was somewhat puzzling but AlanMunn held the key to this mystery.
As explained by AlanMunn in comments, the package tikz-qtree
loads a code file named tikz-qtree.tex
. Because your document was itself called tikz-qtree.tex
, LaTeX tried to read the document a second time when the package called the code file.
This happens because files in the current directory take precedence over those elsewhere, so LaTeX read your document tikz-qtree.tex
rather than the code file tikz-qtree.tex
.
Hence, it really did get two \documentclass
commands as input - they just both happened to be from the single instance in your document.
I don't know if there is a moral to this story other than that AlanMunn knows everything there is to know about packages which draw trees, but at least it dispels the mystery.
\usepackage{tikz-qtree}
. It is a package not a class. Your document can have only one class but many packages!\documentclass{tikz-qtree}
but it is edited away within the 5 mins so no longer makes sense.tikz-qtree
is a wrapper fortikz-qtree.tex
.