Vertical left branch in qtree

March 24   tikz qtree 0 1 Views
Advertisement

Let's consider a really simple tree like the following :

\documentclass[12pt]{beamer} \usepackage{qtree, tikz-qtree, tikz} \begin{document}  \begin{frame}{Title} \begin{tikzpicture} \Tree      [.XP     [.X ] [.compl ] ]    \end{tikzpicture} \end{frame}  \end{document} 

In its natural form, it looks like two symetric branches /\ . How can I make it looks like |\ (or eventually the reverse, /|). In other words, given that I only use binary branches, how can I "tell my tree" to put a branch straight, and the other one oblic left of oblic right? I may eventually want to draw a tree like this :

 |\  |\ /| 
Advertisement

Replay

I don't know with qtree but with forest it's easy with options calign=first or calign=last.

\documentclass[12pt]{beamer}
%\usepackage{qtree, tikz-qtree, tikz}
\usepackage{forest}
\begin{document}

\begin{frame}{Title}
\begin{forest}
    [XP, for tree={calign=first}
    [X [a [A, calign=last [B] [D]] [B]] [b] [c]] [compl, calign=last [A] [B] ] ]
\end{forest}
\end{frame}

\end{document}

Vertical left branch in qtree

Tags: tikz qtree, qtree
PC site About | Contact

©2016 avrocks.com all rights reserved

processed in 0.154 (s). 5 q(s)