{trees} is for questions about drawing or constructing tree {diagrams} (for example, family trees).

learn more… | top users | synonyms

42
votes
2answers
28k views

How can I draw simple trees in LaTeX?

I need to draw a tree, and constantly using dotty and including the PNGs is starting to be a pain. Is there a way to get LaTeX to draw it's own trees that doesn't involve learning an entirely new ...
4
votes
2answers
64 views

Tree diagram got cut off

After compiling the code for a tree diagram, some parts of the right hand side of the tree got cut off. I've already used \centering function but this does not fix the problem.I'm not sure how to ...
5
votes
3answers
594 views

Making mixed trees with and without text-containing nodes

I’m using TikZ to draw linguistic syntax trees where some nodes have textual labels and some nodes don’t. I’d like the branch from a labelless node to continue at the same angle into the right hand ...
4
votes
2answers
958 views

Lining up edges of a tree with TikZ

I'm drawing trees with TikZ and \begin{tikzpicture} \node {$C$} child[missing] child{node {$i$} child[missing] child{node {$j$}} }; \end{tikzpicture} produces edges that don't ...
7
votes
2answers
332 views

Automatic connection of text points in tikz-qtree

I have to draw pictures like the following a lot: I want to use tikz-qtree, since I have a lot of trees and this package simplifies things considerably. Right now I use the following code, since it ...
1
vote
2answers
463 views

Depth-first traversal of a binary tree

How can I achieve the drawing of a depth-first traversal of a binary tree like in this picture ?
14
votes
4answers
8k views

How to control spacing in a TikZ tree?

I want to draw a tree and I don't know how to enforce the spacing between them. Some are overlapping. This is my code: \begin{tikzpicture} \tikzstyle{every node}=[circle,draw] \node {A} child { node ...
4
votes
2answers
386 views

How to generate labels next to junctions and avoid self-collision with tikz?

I have an ASCII-art phylogenetic tree that looks (in part) like /------ PLN /-----+ 0.9 | \------ IL1 /--------+ 1.8 | | /----- PVD | ...
1
vote
2answers
517 views

Draw a tree with variable node number

I would like to draw a tree in tex that is more like a sketch of a tree: It should contain variable node numbers. Important is, that the dots are contained in the tree drawn. Is that possible with ...
4
votes
2answers
2k views

AVL Trees in TikZ: draw outside of node

I'm trying to draw an AVL tree with TikZ. I got the basic tree structure covered, but I'm not sure how to draw the balance factor outside of the node (see picture below). Any suggestions?
4
votes
2answers
148 views

tikz draw tree with extra column

01, 001 and 0001 are not actually "childs". How do I add K=1,2,3 and K=4 to the left hand column? And I tried really hard to adjust the distance. But this is the best I can do. Thanks. ...
9
votes
4answers
348 views

Problem using macros to define tree substructures

Relatively simple problem: I want to use macros to define substructures of a tree. In the following example for illustration, I want to define some children (left and right) to be used several times ...
3
votes
1answer
62 views

How to draw an unrooted phylogenetic tree?

I have a problem! I want to draw an unrooted phylogenetic tree like this one: (Image taken from commons.wikimedia) I've tried with the package newicktree, but without success! Anyone can help me ...
4
votes
1answer
123 views

Trees and fitting trees underneath them

Questions How can I fit a tree in the blank space under where I have marked Tree 2 in the photo (directly underneath Tree 1, but to the right of \Rightarrow)? How can I caption Tree 1 and Tree 2 ...
6
votes
2answers
152 views

Decision Tree with Labels on Both Sides of Line

I am trying to generate a decision tree similar to this scanned example: Notice that some branches have text on the top as well as the bottom. I have not figured out how to do this. I can get text ...
1
vote
3answers
46 views

Adding Short Lines Across Decision Tree Branch

I am creating decision trees using the 'forest' package and would like to add short lines across a branch to indicate that the decision is sub-optimal. Can this be done in 'forest'? I am attaching a ...
7
votes
2answers
176 views

Adding Triangles to LaTeX Decision Trees

I am using the 'forest' package in LaTeX in order to create decision trees with multiple decisions. I've got it mostly how I want it, except for two things: I'd like the circles at the leaves of the ...
0
votes
1answer
92 views

Drawing node arrows

I'm not sure how the node function works for use in trees such as the one drawn by Gonzalo Medina in this post: Trees and arrows I'd like to be able to create arrows going from different nodes to ...
5
votes
1answer
95 views

Trees and arrows

I need to draw an arrow, using \draw[semithick,->] (t)..controls +(south west:5) and +(south:5) .. (wh);. I want the arrow to connect e3 at the bottom of the following tree to the single e3 ...
1
vote
0answers
13 views

Strikeout and qtree [duplicate]

I cannot get strikeout to apply inside a tikzpicture. In the example below, strikeout only applies to"Hello World" at the beginning, but not in the tree. How can I solve this problem? ...
1
vote
1answer
40 views

Extending the branches of a tree with binary branches

In the following tree, how can I introduce further and further binary branches between S and VP? \documentclass[12pt,a4paper]{article} \usepackage{tikz-qtree} \usepackage{tikz-qtree-compat} ...
1
vote
1answer
37 views

Fitting items next to trees on the page

I want to be able to put items to the left or right of the tree structure in the following example. How can I do that? At the moment each tree occupies a line. \documentclass[12pt,a4paper]{article} ...
2
votes
3answers
39 views

Positioning of trees

Consider \documentclass[12pt,a4paper]{article} \usepackage{tikz-qtree} \usepackage{tikz-qtree-compat} \begin{document} X + Y $\Rightarrow$ \begin{tikzpicture} \Tree [.X X Y ] \end{tikzpicture} ...
20
votes
4answers
7k views

Drawing a directory listing a la the tree command in TikZ

Good day everyone - Is there a fast and efficient way to draw directory tree structures (aka depth-indented listings) like the unix's tree command, that is, is there a way to draw the following using ...
28
votes
3answers
3k views

How can I improve this family tree in TikZ?

To answer a question about how to draw family tree on LaTeX-Community.org, I created an example: \documentclass{minimal} \usepackage{tikz} \usetikzlibrary{trees} \begin{document} ...
9
votes
2answers
3k views

Probability Tree-diagram with TikZ

Thanks for helping me out. How can I make the following tree-diagrams? http://www.vias.org/tmdatanaleng/cc_prob_cond_independ.html
16
votes
5answers
1k views

Typesetting genealogical trees

I looking for a simple way to typeset a genealogical tree in LaTeX. In particular, I'm interested in typesetting a so-called "Ahnentafel", that is a tree that shows me, my parents, my grandparents, ...
2
votes
1answer
95 views

Drawing a tree diagram

How do I draw the tree diagram below in Latex? I also want to label the branches the way they are in the figure. Here's my preamble: \documentclass[11pt,reqno]{amsart} % Packages ...
2
votes
1answer
90 views

Family Tree gone “wrong”

Trying to make a simple tree, but when I finished I realized I'd gone about it totally the wrong way... Would appreciate some help trying to make this the "correct" way. Oh, and also to circle the ...
2
votes
2answers
110 views

Drawing graph decomposition as a tree

Let's say I have a triangle like this which is easily generated by pgf. \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[ vertex/.style={circle, draw=blue!60, ...
6
votes
1answer
215 views

How to create a correctly aligned tree proof in logic with 4 branches, columns of line numbers and justifications?

I'm looking for a way to make a Logic Tree with three columns (line number, tree itself and commentary). I've tried using a tikz matrix, and it worked very well, except when I get more than two ...
13
votes
3answers
5k views

How do I draw a B+ tree in latex?

Is there some way to draw a B+ tree in latex? It would look something like the picture below (ignoring the animations) Animation linked here: http://i.stack.imgur.com/JRcmY.gif Screenshot of the ...
0
votes
2answers
55 views

Dependency tree graph with extra arrows

I built the tree (black components) using the Stanford Parser. However, it doesn't make its graphs exportable, so I had to take a screenshot. Then to that graph I had to add the two new colorful rows ...
1
vote
1answer
58 views

implement a tree that will fit on two column page structure and permit multiline nodes

I have a paper formatted like this one, i.e. two columns of text per page. I've been trying to make a tree structure to fit inside of one column, but so far I've been unable to make it work. There ...
1
vote
2answers
61 views

qtree spacing and alignment

I have the following qtree \begin{center} \Tree[.{\tiny \ttfamily \itseries educated at}{\tiny \ttfamily ( Bush, University of Texas at Austin)} [. [. ...
1
vote
0answers
24 views

What am I doing wrong with the qtree function? [duplicate]

I have been trying to figure out what is wrong with my code, but no matter what I do it does not compile. \documentclass[12pt]{report} \usepackage{tikz-qtree, qtree, graphicx} ...
8
votes
4answers
472 views

Upside-down syntax trees for linguistics with horizontal lines

I know that syntax analysis can be done in Latex using using TikZ, but the tree-structure that produces isn't really used in my country. Here, we mostly use straight lines instead of hierarchy trees. ...
6
votes
4answers
186 views

How to use Tikz and macros to very efficiently draw recombining binomial trees when taking notes during class

For a class in derivatives pricing I would like to find a way to quickly and efficiently draw recombining binomial trees. The class involved quite a few of those trees and it would be immensely ...
4
votes
1answer
28 views

How can I set a style in `\forestset` which requires delayed calculations with the results of node walks?

What is the correct way to wrap the specification for the tree below into the my binomial style defined in \forestset and why? The following code works fine: ...
5
votes
2answers
191 views

How to colour branch/edge on a tree using tikz?

I have created a tree diagram using tikz on Latex. However I'm not sure how to go about highlighting/adding colour to a branch. For instance, looking at the tree that I've illustrated, I want to ...
4
votes
1answer
1k views

Multipart nodes with multipart subparts — style issue

I want to typeset multipart nodes that have multipart sub parts — similar to the following diagram (from Miller and Ranum) I have tried using TikZ horizontal split rectangles inside vertical split ...
3
votes
4answers
166 views

How to draw trees

I'd like to know how to draw these trees: I really have no idea. I've taken a look but I didn't find out anything that could help me (to draw these trees in particular). So I hope you can help me. ...
5
votes
2answers
100 views

Obtain a TikZ tree from a Lua table/string

Let's consider I have a database where with appropriate passages I obtain the a string that describes a layered tree. Consider the following listing: % !TEX encoding = UTF-8 % !TEX program = ...
0
votes
1answer
140 views

How to display contents of a tree grid in a latex table

I am working on displaying a nested bill of material in tree grid in a latex document. Is there a package available that can help with this? A short example of my current table \begin{table}[h] ...
8
votes
2answers
145 views

Drawing a tikz tree above a tikz-dependency tree with same leaves

I would like to achieve the following goal: I have two different kind of trees that I would like to merge : \documentclass{article} \usepackage{color,graphicx} \usepackage{tikz} ...
4
votes
2answers
106 views

How to add a numbered label to syntax tree?

\documentclass{article} \usepackage{forest} \begin{document} \begin{forest} baseline, for tree={parent anchor=south, child anchor=north, align=center, l sep+=0em, s sep+=4em} [T$'$ ...
3
votes
1answer
437 views

Package pgf Error: No shape named is known

I have encountered a problem Package pgf Error: No shape named is known but, I do not know what's wrong with it and how to fix it? Can anybody help me? My code is as follows: ...
4
votes
1answer
75 views

How to obtain the same-sized-boxes?

I want all the rectangle have the same size. What should I do? \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \usepackage{tikz-qtree} \tikzset{edge from parent/.style= {draw, ...
2
votes
2answers
67 views

How can I put something under something in a Tree?

\documentclass{article} \usepackage{tikz} \usepackage{tikz-qtree} \begin{document} \begin{tikzpicture} \tikzset{grow'=right,level distance=32pt} \tikzset{execute at begin node=\strut} ...
0
votes
0answers
27 views

For a tree, I want add labels for every line of children [duplicate]

I have asked the same question about four or five hours ago. @Jason Zentz has given me a link. But the tree linked gowns down. It is a little different from mine. I tried many time to solve the ...