Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [forest]

{forest} is about trees in {diagrams} created with the forest package. It is built upon {tikz-pgf}.

Filter by
Sorted by
Tagged with
1 vote
1 answer
108 views

How can I get the result of this forest?

In this code, \documentclass{article} \usepackage{forest} \usepackage{siunitx} \usepackage{amsmath} \usetikzlibrary{shadows,arrows.meta} \newcommand\engnum[1]{\ifcase#1 %zero \or %one \or %two \or %...
John Paul Peter's user avatar
2 votes
2 answers
204 views

working with several tikz forest

EDIT: ultimately my problem was how to have several trees in one single tikzpicture and being able to access node positions. See the accepted answer for how to do that. My workaround caused the ...
Olivier Gauthé's user avatar
3 votes
1 answer
50 views

Adding additional edges in the forest

I have the following graph created by "forest" \documentclass[tikz,border=5pt]{standalone} \usepackage{forest} \usetikzlibrary{arrows.meta} \begin{document} \begin{forest} for tree={...
Vika's user avatar
  • 489
3 votes
1 answer
139 views

Automatically giving nodes the name that is also used as their label

I draw a lot of connections between nodes by hand. For this the easiest way is to give the nodes the names that correspond to their node labels. The node that is displayed as clause should also have ...
Stefan Müller's user avatar
4 votes
1 answer
76 views

Increasing the distance between tiers in forest

I try to get more space between the penultimate line and the line at the bottom in the following type hierarchy. \documentclass{article} \usepackage{forest} \useforestlibrary{linguistics} \...
Stefan Müller's user avatar
0 votes
1 answer
73 views

Change my Forest figure

Question: How can I achieve figure 2 from figure 1 ? MWE: \documentclass{article} \usepackage{tikz} \usepackage{lscape} \usepackage[edges]{forest} \forestset{ calign to midchild or edge midpoint/....
SandyM's user avatar
  • 2,881
3 votes
2 answers
143 views

A very basic autosegmental tree using forest

I need to draw a simple autosegmental diagram where the parent node (the feature name) branches into two children (segments), with the ability to control which of the branches are vertical. For ...
Yebeg Tibs's user avatar
1 vote
1 answer
30 views

Forest branching

I need to change the branches of the following diagram \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{trees} \usepackage{forest} \begin{document} \begin{forest} for tree={...
Frank's user avatar
  • 465
4 votes
1 answer
46 views

Change line length between parent/child in forest

Consider the following forest: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[edges]{forest} \begin{document} \begin{forest} forked edges, for tree={fork sep=2mm, grow=east,...
John Doe's user avatar
  • 231
2 votes
1 answer
46 views

Increase line length in tikz forest

Suppose I have the following tree: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[edges]{forest} \begin{document} \begin{forest} for tree={ grow=east, parent anchor=...
John Doe's user avatar
  • 231
3 votes
2 answers
190 views

Added an element in forest

Could you help me add the curved arrow that goes from alpha to beta on this figure? It would be simpler with tikzpicture, but with forest I don't really see it. \documentclass{article} \usepackage{...
matheux's user avatar
  • 99
2 votes
2 answers
44 views

Draw coloured edges in forest

\documentclass[12pt,a4paper]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{amsmath, amsthm, amssymb} \usepackage[ngerman]{babel} \usepackage{forest} \begin{document} \...
VD3's user avatar
  • 69
3 votes
2 answers
44 views

Forest (linguistics) adding boxes and outer title

I have the following tree and I need to add another box and some text as illustrated in the second pic: \documentclass{article} \usepackage[linguistics]{forest} \usepackage{tikz} \begin{document} \...
Frank's user avatar
  • 465
0 votes
1 answer
44 views

Forest Package Alignment Help

Using the forest package, I am trying to make: \Tree [.Red-Shirt [.Black-Pants [.Red-Black-Outfit ] ] [.Blue-Pants [.Red-Blue-Outfit ] ] [.Red-Pants [.Red-Red-Outfit ] ] [.Gold-Pants [.Red-Gold-...
muzan muzan's user avatar
3 votes
1 answer
163 views

Unable to use the forest package to make a tree

I am a little new to the forest package. Here is how I setup my forest package - \newenvironment{abc} { \forest for tree={ font=\sffamily\small, % <- Adjust font size here grow'=0, ...
desert_ranger's user avatar
0 votes
0 answers
21 views

Equations Below Rotated Forest [duplicate]

I created the following graph: \documentclass{article} \usepackage{forest} \usetikzlibrary{shadows} \useforestlibrary{edges} \usepackage{amsmath} \usepackage[graphicx]{realboxes} \usepackage[left=2....
s28's user avatar
  • 107
-1 votes
1 answer
47 views

Black dots as nodes in a tree

I want to draw a tree like this one and the nodes should be black dots \begin{forest} [[[][]][[][]]] \end{forest} How can I do that?
VD3's user avatar
  • 69
2 votes
2 answers
47 views

forest - Centering root node tree using folder for an organigram (organisational chart)

This is my last resort trying to understand the best way to center the root node on an organigram I made. The problem is caused - I think - by the use of folder that is required for this. Without the ...
Stephen Whitmarsh's user avatar
3 votes
0 answers
49 views

What causes calign=fixed edge angles to behave inconsistently when grow is not equal to 270?

I would like to understand what causes the following behaviour in forest. MWE [Note that most of the code isn't code necessary to reproduce the problem but rather annotations I've added in an attempt ...
cfr's user avatar
  • 208k
5 votes
3 answers
115 views

Getting parallel lines in trees with forest

I created the following tree. I would like the angle betwen lesbarkeit and lesbar and keit to be such that the edges are parallel to the ones of les and bar. I guess shifting lesbarkeit to the left ...
Stefan Müller's user avatar
1 vote
2 answers
54 views

Tikz forest. grow east Issue with arrows. How to keep them straight?

For my flow chart, if I do not use grow=east option for the tree, it does not fit the page width. Using grow=east makes it fit. But now the arrows connecting the nodes no longer are straight as they ...
Nasser's user avatar
  • 20.3k
1 vote
2 answers
100 views

Add Equations to TikZ figure

I would like to: (A) rotate the tikz figure (B) add equations below the figure (rotated) How could I do that? I drew a sketch: CODE: \documentclass{article} \usepackage{forest} \usetikzlibrary{...
s28's user avatar
  • 107
3 votes
2 answers
97 views

How to draw stacked/partially overlapped blocks in Tikz to indicate many items?

I am trying to make something similar to this below (drawn using another software) but in Tikz Currently I use tikz/forest to make my flow diagrams. But I do not know how to make such stacked/...
Nasser's user avatar
  • 20.3k
2 votes
1 answer
59 views

How to adjust parent anchors so that they don't touch

I want to make my tree look like the default tree in the forest documentation, like below: As you can see, there is some spacing between the edges, and their endpoints are not connected to each other. ...
l0uis's user avatar
  • 23
2 votes
1 answer
45 views

How to draw lines in forest package?

I would need to draw a line from W pointing to the line that connects $\phi$ to M. the line should start from W and end in the middle of the line connecting $\phi$ to M. Can anyone help me? Thank you \...
Andrea 's user avatar
  • 135
2 votes
1 answer
60 views

How to write text on a line in forest package?

I have drawn a stemma codicum using the forest package, but I would need to write some text next to the line that connects a to b. Can anyone help me? Thanks \documentclass[border=0.5cm]{standalone} \...
Andrea 's user avatar
  • 135
2 votes
2 answers
83 views

How to expand branches of a forest tree

I am trying to draw a stemma codicum of a critical edition using the package forest - after the first step of drawing all the branches I now need to expan the branches before adjusting all the lengths....
Andrea 's user avatar
  • 135
1 vote
1 answer
49 views

Empty nodes with vertical edges in forest?

I have a tree preamble that generates trees with fixed angles, empty nodes, and centered middle nodes in ternary branching environments. I'd like to modify it to always give empty nodes vertical edges,...
argo's user avatar
  • 63
0 votes
1 answer
35 views

Forest Multiple Labels

I am trying to draw forests. I am able to add a single label to edges, but I do not know how to add a second one. Here is the code I have: \documentclass{article} \usepackage{tikz} \usepackage[...
Den's user avatar
  • 37
8 votes
2 answers
215 views

Problem with forked edges in atypical forest.sty

Most examples of output from forest (not unnaturally) follow a pyramidal shape commonly encountered in linguistic trees. As an experiment in culinary recipe formatting, I've tried to invert the ...
sgmoye's user avatar
  • 8,941
4 votes
1 answer
491 views

Rotate a forest tree

I would like you to help me please. I am drawing some syntactic phrase structure trees using the forest package, option linguistics. The problem is that when the trees grow, they do not fit in the ...
Silué Lacina's user avatar
2 votes
1 answer
71 views

Making a forest tree fit the page width?

Is there a way to specify that you'd like the tree to stretch across the entire textwidth? In other words, to make the leftmost node align with the left margin, and the rightmost with the right margin,...
Vincent Mariani's user avatar
0 votes
3 answers
59 views

Forrest tree with nodes having text and images

Found the answers I needed here....what a prompt, helpful community! Thank you all. I am trying to recreate this plot from MS Word How does one create a node with wrapped text and an image below it? ...
Bhuvan's user avatar
  • 1
1 vote
2 answers
83 views

Forest edge labeling

I am learing to plot forest diagrams. I am in the process of ploting an implicit tree with n children. There are 3 questions I could not resolve: 1) How to change the dotted edge to ( . . . ) rather ...
Den's user avatar
  • 37
5 votes
2 answers
192 views

forest: Even horizontal distribution of all nodes on the same level

In the following tree, some nodes have multiple parents (which technically violates the tree definition). Therefore, to create the tree in the forest package, I manually added the edges from children ...
Zhorrid's user avatar
  • 101
1 vote
1 answer
38 views

Forest structure with redundant arc

I am trying to use the forest structure offered here: https://tex.stackexchange.com/a/713546/, but on a different tree. I get a picture but one arc is redundant (from (0,0) to (5,5)), and I cannot ...
Vika's user avatar
  • 489
2 votes
2 answers
101 views

Using the package memoize with a specified --output-directory

I'm trying to configure the package memoize, but am running into issues when trying to pass an --output-directory option to LuaLatex. From looking at the output files and how they end up, it looks as ...
Vincent's user avatar
  • 23
11 votes
2 answers
447 views

Eulerwalk around Forest tree

Is there a clever way to draw an Eulerian walk around a tree? My current solution is quite clumsy... \documentclass[aspectratio=169]{beamer} \usepackage[utf8]{inputenc} \usetheme{moloch} \usepackage{...
Arne's user avatar
  • 1,390
2 votes
1 answer
148 views

how to write a code for 2 stage game?

I am a student, and got the following question: A market is characterized by a demand function Q = 1−P and by a single firm with constant marginal cost c. The monopolist is facing potential entry from ...
Hanan's user avatar
  • 21
4 votes
2 answers
95 views

Recreating a Forest with Different Angles and Parallel Lines

I have utilized the code which cfr has beautifully generated here to recreate the below image: A MWE of my efforts is as follows: \documentclass[11pt]{book} \usepackage{graphicx} \usepackage{amsthm,...
Arian's user avatar
  • 149
4 votes
4 answers
375 views

Background image behind a LaTeX/TikZ forest node

I use the forest package to draw ancestry trees. I would like to add papyrus scroll-like backgrounds to the nodes. This is the basic example: \documentclass[]{standalone} \usepackage{pgfplots} \...
lak20's user avatar
  • 85
1 vote
2 answers
64 views

How to break line in a text node in a tikz forest diagram

I need to break line in a node text in a tikz forest diagram. I tried to add \ or \newline in the node text, but that did not work. Here is the sample code: \documentclass{article} \usepackage{tikz} \...
None's user avatar
  • 319
2 votes
3 answers
128 views

How to create recurrence trees with level labels and work labels?

I am trying to create recurrence trees to solve for time complexity of recurrences. This is my attempt so far, but the labels are all messed up and I can't seem to get the work labels working. \begin{...
Rachel Chen's user avatar
2 votes
1 answer
58 views

Alignment between level of forest

I almost finished my diagram with help of peoples from this Stack Exchange network community. Please look at the figure which I attached here. I make two small circles. Is it possible to make these ...
SandyM's user avatar
  • 2,881
3 votes
1 answer
104 views

Latex Forest Package Reduce the length of lines betwen nodes?

By using Forest package i am try to create red-black tree. In some point in my presentation i need to shorten the lines between the nodes which are red, but the parents are black. \documentclass{...
İbrahim Uğur ABA's user avatar
-3 votes
1 answer
81 views

Probability tree with multiple sources that highlights a specific path [closed]

I am trying to recreate a graphic using latex. I want to create a tree-like shape that also includes the events with 0 probability. It should look similar to I tried to create this using the tikz ...
SebastianP's user avatar
2 votes
1 answer
104 views

degryuter template : forest trees and langsci-avm matrixes do not display

I am having some issues with the degruyter latex template for articles. Everything works, except for syntactic trees and lfg AVMs. I am compiling with xelatex and I am using the forest and langsci-avm ...
Silué Lacina's user avatar
3 votes
1 answer
109 views

Format particular terminal nodes and remove lines between them and their parents using forest

When using the forest package to draw linguistic syntax trees, how can one prevent lines being drawn between particular terminal nodes and their parents, while still maintaining them as separate "...
Kyle F. Hartzenberg's user avatar
2 votes
2 answers
139 views

Can you help improve a forest diagram?

I am looking to improve this diagram, especially the linking arrows at the top that overlap the boxes. \documentclass{article} \usepackage[margin=1cm]{geometry} \usepackage{pdflscape} \usepackage{...
yannisl's user avatar
  • 118k
6 votes
2 answers
388 views

Adding arrows between two forests

Here's my code: \documentclass[french, 12pt]{report} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage[a4paper]{geometry} \usepackage{graphicx} % Required for ...
Caro's user avatar
  • 61

1
2 3 4 5
19