0

My document looks like this:

\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{tikz}
\usepackage{tikz-qtree,tikz-qtree-compat}
\usepackage{graphicx}
\title{}
\author{}

\begin{document}
\begin{frame}
\resizebox{\linewidth}{!}{%

\begin{tikzpicture}[level 1/.style={level distance=1cm}]

\Tree
[.(-,(3,3),1) 
[.(1,(8,0),2) 
                  [. (1,(1,1),1) {(1,(1,1),$\perp $)\\ (-1,1)} ] 
                  [.(1,(1,1),2) [.(1,(1,1),1) {(1,(1,1),$\perp $) (-1,1)} ] ]
                  [.(1,(8,0),1) (1,(8,0),$\perp $)  ]
               ] 
 [.(-,(3,3),2) 
                                [.(2,(0,8),1) 
                                                        [.(2,(1,1),2) {(2,(1,1),$\perp $)} ]
                                                        [.(2,(1,1),1) {(2,(1,1),2)} ]
                                                        [.(2,(0,8),2) {(2,(0,8),$\perp $)} ]]
                 { (-,(3,3),$\perp$)} 
              ]
]

\bigskip
\end{tikzpicture}
}
\end{frame}
\end{document}

The text (-1,1) (in the first indented line) should appear below the leaf, but when I insert a line break (\\), I get an error.

ChrisS
  • 13,529

1 Answers1

1

Your problem is that TikZ doesn't know how to break the lines. If you add the option align=center to the options for the tikzpicture environment, the problem is resolved.

For more information, see the PGF Manual, section 16.4.3, page 179, or this answer to a similar question.

ChrisS
  • 13,529