Tag Info

New answers tagged

2

Because trees need a forest... ... and I like automated solutions... \documentclass[tikz, border=5pt, mult, varwidth]{standalone} \usepackage{forest} \begin{document} \forestset{ filled circle/.style={ circle, text width=3pt, fill, }, phantom/.append style={label={}}, my label/.style n args=2{ edge label={node ...


4

Another option, allowing perhaps finer control over the arrows in case cfr's solution is not directly usable, would be to place the trees in TikZ's \nodes and then to use the nodes' names to draw the arrows. The safer way to do this would be to first box the trees and then use the boxes inside a tikzpicture; in the following example I used the same tree ...


4

One way is to draw the trees as a single tree with a phantom root node: \documentclass[tikz,border=5pt]{standalone} \usepackage[utf8]{inputenc}% just for this example as my editor uses this encoding \usepackage[T1]{fontenc} \usepackage{forest} \begin{document} \begin{forest} for tree={grow'=north, circle, draw, minimum ...


1

The package forest (which builds on the graphics package tikz-pgf) can be configured as shown below to give you a straight-spined tree with symmetric binary branching. I took the intermediate projection (bar-level) labels out of your MWE to show the straight line through empty nodes as you requested. \documentclass[10pt]{article} \usepackage{tikz} ...


6

In order to avoid the empty space at the root, you want to make the root a coordinate, rather than a node, since nodes have some minimal dimension, whereas a coordinate does not. As for text on the branches, you can, in fact, do it with edge from parent. It's hard to say where you're going wrong, since there isn't an example in your MWE, but the MWE below ...


3

You can redefine the tree drawing stage to save the tree in a box and then draw the tree in a circled node. What is nice about this is that you can define a style for this once and then just apply it to trees without having to think about their layout in order to figure out which nodes to name. \usepackage{forest} \forestset{ sn edges/.style={for ...


4

One option is to name some special \nodes (the root and the lowest(s) one(s)) in the tree and then use the fit library with a circular \node: The example code: \documentclass{article} \usepackage{forest} \usetikzlibrary{fit} \begin{document} \begin{forest} [a,name=root [b [c [d,name=lowestl] [e] ] [f ] ] [g [h] [i ...


1

For completeness, the extremely powerful forest package should be included ;): \documentclass[standalone, border=5pt]{standalone} \usepackage{forest} \newcommand*\primary{\textsuperscript{0}} \begin{document} \begin{forest} for tree={ where n children=0{tier=terminal}{}, parent anchor=south, child anchor=north, } [S [NP [John ...


0

Although you want to draw trees, there's no need to use Tikz trees, tikz-qtree, forest, ... for drawing them. A matrix like in next code or just correctly positioned nodes can do the same. And next code doesn't insert a tikzpicture inside another tikzpicture which sometimes is not recommended. \documentclass[tikz,border=2mm]{standalone} ...


4

One option: The code: \documentclass{article} \usepackage{forest} \usetikzlibrary{positioning,arrows.meta} \newsavebox\Downtree \newsavebox\Uptree \tikzset{ nleft/.style={text width=15pt,midway,left,font=\strut\scriptsize}, nright/.style={text width=15pt,midway,right,font=\strut\scriptsize}, } \savebox\Downtree{\begin{forest} for tree={ s ...



Top 50 recent answers are included