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

learn more… | top users | synonyms

163
votes
12answers
23k views

How can we draw a Christmas tree with decorations, using TikZ?

I would like to use TikZ for drawing a christmas tree. Here's a start, I used the lindenmayersystems library for drawing a tree: \documentclass{article} \usepackage{tikz} ...
37
votes
1answer
22k 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 ...
24
votes
1answer
5k views

Making a (simple) directory tree

I'm trying to make a simple directory tree representation in LaTeX. Something like: spam | +-- ham +-- eggs | +-- more spam +-- dead parrots The tree won't be that long (say, ...
24
votes
1answer
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} ...
20
votes
3answers
3k views

Rounded corners in TikZ trees.

When I use TikZ tree with nodes with rounded corners, the connecting lines do not touch the nodes (near corners) but end where would rectangle end. Is there an easy way around it? ...
20
votes
3answers
5k 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 ...
20
votes
2answers
2k views

How to change the level distance in tikz-qtree for one level only?

I am trying to draw a tree for a game theory problem. The problem is that the label p1=0.5 crosses label I. I would like to adjust the level distance of the first level, but the \tikzset{level ...
20
votes
1answer
522 views

Drawing Bruhat--Tits trees with TikZ

I am not a regular user of TikZ, and I was wondering if there was a quick way of drawing trees that look like ? (the picture seems to have been taken from page 71 of J. P. Serre's book on trees). ...
17
votes
3answers
1k views

TikZ: “skipping” levels when drawing trees

I'm interested in using TikZ to draw rooted trees whose leaves should all be on the same level, pretty much like this: Please don't pay attention to the fancy style and colours, I'm only interested ...
16
votes
5answers
7k views

How to make a 3 level deep tree with tikz

I am busy making a full binary tree of three levels deep. The code I am having now is (using the trees library): \begin{tikzpicture} \node {root} child {node {left} child {node {lleft}} ...
15
votes
1answer
437 views

Is it possible to emulate qtree with forest?

This question was actually asked by Alan Munn in a comment to How do I create a LCM tree diagram?. I repeat (and self-answer) it here because the answer is too long to fit the margin :-) qtree is a ...
14
votes
4answers
3k views

How to automatically draw a graph in LaTeX

clarification: when I say "graph", I mean the computer science term. I want to draw a full binary tree of h height. It means that there's one root with two sons, each son has two sons and so forth. ...
13
votes
3answers
1k views

How can I create this game-tree in Latex?

I have the following figure: As of now I create this in Word/Powerpoint and paste the screenshot in a LaTeX file. Is there a way to create this natively? Also, what would be the advantage of doing ...
12
votes
3answers
6k 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 ...
12
votes
2answers
4k 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 ...
12
votes
1answer
451 views

draw a many edge from a node- Tree - tikz

i want to draw the tree in the following picture : i have write : \documentclass{article} \usepackage{tikz} \usepackage{color} \definecolor{red}{rgb}{1,0,0} \begin{document} ...
11
votes
4answers
448 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, ...
11
votes
2answers
1k views

How two connect any arbitrary nodes of tree in tikz

I need to be able to connect any arbitrary nodes in a tree to each other. I am using the tree package in tikz to create my tree. I cannot figure out though how to connect to nodes by let say a draw ...
11
votes
1answer
594 views

Using beamer overlays with forest generated trees

I am using the forest package from Sašo Živanović in order to create a wide tree on a beamer slide. Previously, I was using qtree. But due to the easier way of arranging nodes automatically with ...
10
votes
3answers
2k views

How to draw syntactical trees with parallel leafs for a natural language?

I need to draw syntactical trees for a natural language. The problem is that I need all the leafs to be parallel. How the other nodes are sorted in relation to the other at the same depth is not ...
10
votes
1answer
918 views

Tikz tree and position of single leaf in binary tree

I am constructing a binary tree which looks as follows: \begin{tikzpicture} \node {root} child { node {left} } child { node {right} child { node {rightmost} } ...
10
votes
1answer
164 views

Indefinite Subtrees

While doing tree proofs, sometimes we need to consider a root with some subtrees, but we don't know the exact properties of the subtrees, so we just represent them using triangles. Is it possible to ...
10
votes
1answer
378 views

Drawing PQ-trees

I need to draw PQ-trees in LaTeX which look like these: I tried trees in tikz but I had two problems: partially shade rectangles use vertical pointers from children to the parent, if the parent ...
9
votes
2answers
5k views

How to draw up a hierarchical tree diagram for taxonomic classification

Please show me the most simple, elegant code for this: How to do it in other words.
9
votes
4answers
3k views

beamer & TikZ: gradually unveil trees

Imagine a simple tree: \begin{tikzpicture} \node {Selbstregulation} [edge from parent fork down] child {node {Kognition}} child {node {Metakognition} child {node {Planung}} ...
9
votes
1answer
762 views

draw an ellipse into a Tree picture -tikz package

I have draw a tree using tikz package like this \begin{tikzpicture} \tikzstyle{level 1}=[sibling distance=40mm] \tikzstyle{level 2}=[sibling distance=20mm] \tikzstyle{level 3}=[sibling ...
9
votes
1answer
3k views

Triangle node with adjustable height

I'm trying to draw AVL trees with TikZ, what I need is: Binary tree with simple circle nodes, and adjustable height triangle (or rectangle) nodes for subtrees, both containing only single ...
9
votes
1answer
1k views

How to draw a tree diagram where its rectangular nodes have a floating numbering label each?

This is a graph someone send me in Word: Ignoring the Hebrew text, how can I produce such a graph in LaTeX (I actually use LyX, but I suppose it won't help me so much)? If there's an elegant and ...
9
votes
1answer
233 views

tikzpicture has a node whose text is a tree: unevenly formatting

I want to typeset a picture similar to the following one, using tikz. For that purpose I have written the following latex document \documentclass{minimal} \usepackage{tikz} \usetikzlibrary{chains} ...
8
votes
2answers
491 views

how to draw a diagram that forks out, then joins in the middle then forks out again?

Update: ref comments: I've slightly corrected the terminology and the title. I am using the term diagram now, instead of tree, and I am just asking on how to draw this diagram in Tikz. Any tool or ...
8
votes
3answers
313 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 ...
8
votes
1answer
265 views

Multiway trees like in Knuth's The Art of Computer Programming, Volume 3

I was wondering if anybody knows how to draw a multiway tree like in Knuth's The Art of Computer Programming, Volume 3 on page 484? This looks like a rounded box with the value of the keys being ...
8
votes
1answer
1k views

How to draw a joining line between two picture tikz-pgf

I'am having draw two tree using the tikz-pgf package \begin{frame} \begin{columns}[c] \begin{column}{2cm} \begin{tikzpicture}[scale=0.5] \tikzstyle{level 1}=[sibling distance=10mm] ...
8
votes
2answers
1k views

How to draw empty nodes in tikz-qtree?

I'm new to tikz-qtree, and I would like to reproduce this figure in LaTeX: So far, I've managed to cobble this bit of code, but the results are a bit comical, as the empty nodes (those without ...
8
votes
2answers
2k views

TikZ: Draw a B+ Tree

Having consulted How do I draw a B+ tree with tikz in latex with more than 4 Key value pair in a node and How do I draw a B+ tree in latex? threads, I think the multipart feature of TikZ might just do ...
8
votes
2answers
192 views

Using tikz overlay / remember picture option with forest trees

I want to connect two forest trees with an arrow, in a similar way it is discussed here for plain tikz trees. However, it seems to be impossible to add options to the forest environment in a similar ...
7
votes
2answers
237 views

Special tree in tikz

I'm trying to draw a tree like this: The root has three children and every of this two... The nodes in the first two tiers has additional informations.. I searched for examples like that, but could ...
7
votes
2answers
319 views

Trees with only leaves in TikZ

Following Roel's answer to How to write a tree with no (visible) root with TikZ? I attempted to visualise my Huffman-Code for "Tennessee", but it didn't turn out as I expected: My MWE: ...
7
votes
2answers
282 views

How do I draw merged red black tree into 2,3,4 tree in tikz?

I'm using tikz in study material and I want to show analogy between RB trees and B-trees (2,3,4 tree). I want my output looks something like this example from Wikipedia. For RB tree I'm using almost ...
7
votes
1answer
877 views

Drawing binary trees with LaTeX labels

Is there some good tool for drawing binary trees with labels that are rendered by latex? I would need to have the tree node placement done automatically for me, because there are too many labels to ...
7
votes
1answer
1k views

Tikz - Marking nodes in a binary tree?

I need help marking nodes in a binary tree. I've tried drawing this using the fitting library in tikz, but the fit would cover other undesired nodes as well. Please help. The code I tried is here ...
7
votes
3answers
998 views

tree list in a table

I would like to put a tree list into a table environment. Smth. like: +--------------------------+---------------------------+-------------+ | Heading 1 | Heading 2 | ...
7
votes
1answer
2k views

Tikz Mindmap - how to get more nodes

% Author: Till Tantau % Source: The PGF/TikZ manual \documentclass{article} \usepackage{tikz} \usetikzlibrary{mindmap,trees} \usepackage{verbatim} \begin{document} \pagestyle{empty} \begin{comment} ...
7
votes
1answer
2k views

LaTeX probability tree

Please could you tell me if the Probability tree posted on 2006-12-14 by Kjell Magne Fauske can be done with three branches instead of just two.
7
votes
1answer
325 views

Draw randomized tree in TikZ

I am trying to draw a randomized tree using TikZ, that is, I'm looking for a macro \randtree{NN}{x} that attaches a randomized tree of maximum depth x to a node named NN. The nodes need not be visible ...
7
votes
2answers
179 views

Seeking improvement on a poor solution---for descendant charts

I've a solution to a problem that screams out for improvement. I'm working on a second edition of a family history (mine) that has a great number of descendant charts. I've cobbled together a way of ...
7
votes
1answer
262 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 ...
7
votes
1answer
346 views

Trees in latex : Depth of 4 nodes

I am following the current tutorial (MWE) : link However, I am facing difficulties to perform a tree of 4 nodes. Items are superposed, and even if I add a child [missing] {} it doesn't solve the ...
7
votes
1answer
240 views

Creating radial trees in TikZ

I am fairly new TikZ user and I am looking for a way to generate a radial tree similar this: or this: So far, I have two methods of doing this: 1) Program it manually - This involves quite a ...
6
votes
3answers
1k views

drawing a syntax tree in tikz

I would like to draw a syntax tree, which resembles the below syntax tree. I know that I can use tikz to draw syntax trees, but I can't seem to figure out how to draw a straight line down to a node, ...