# Tag Info

8

I cannot answer the question about the usage starred macros in forest keys, but it is generally not recommended to use macros that expand to pgf keys. Rather, this is what styles are for. And with styles there is no problem, and the code becomes even shorter. \documentclass[12pt,a4paper]{article} \usepackage{forest} \forestset{el/.style={edge label={node[...

5

I recommend switching to forest. There you can implement simple rules such as where n children=1{<do something>}{<otherwise>} However, looking at your tree it seems to me that the actual rule is if={isodd(level)}{fill,for descendants={edge={very thick}}}{for descendants={edge={thin}}} Anyway, I added both options. Please let me know if the ...

5

\documentclass[border=9pt]{standalone} \usepackage[linguistics]{forest} \forestset{ declare toks={multi name}{}, multi dom/.style={ if={>On={level}{0}}{}{% delay/.process={OOw2}{name}{multi name}{ insert before={[##2,tier=##1]}, insert after={[##2,tier=##1]}, !u.s sep'=0pt, }, before typesetting nodes={ ...

4

I'd go with a style, as suggested in the other answer. The problem seems to lie in expandability, as the following working code shows. \documentclass[12pt,a4paper]{article} \usepackage{forest,xparse} \NewExpandableDocumentCommand{\probaweight}{sm}{% \IfBooleanTF{#1}% {}% {node[midway, fill=white]{#2}}% } \begin{document} \begin{forest} [ [...

3

An answer by using styles: The output is like @Ignasi's answer output but I used styles and didn't made the arrow thick: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes} \begin{document} \begin{tikzpicture} [ level 1/.style={sibling distance=30mm}, level 2/.style={sibling distance=15mm}, level 3/.style={sibling distance=7mm}, triangle/....

3

You can always declare an edge from parent style on desired node and revert it in descendant branches \documentclass[border=2mm,tikz]{standalone} \usetikzlibrary{shapes.geometric} \begin{document} \begin{tikzpicture} [ level 1/.style={sibling distance=30mm}, level 2/.style={sibling distance=15mm}, level 3/.style={sibling distance=7mm}, triangle/.style = {...

3

Adaptations: added tikz option: growth parent anchor=south west (default was south) changed tikz option: edge from parent path to starting point ([xshift=2mm] \tikzparentnode.south west) changed the grow points to avoid overlapping Use tikzset instead of tikzstyle (see Should \tikzset or \tikzstyle be used to define TikZ styles?). Code: \documentclass{...

3

I'm not sure if this is what you want, but you can use 'invisible' nodes at level 2 so it doesn't look as if there are nodes there. You just need to make them coordinates. If the angles matter, you'll need to adjust those in the usual ways, but I guess this gives the general idea. \documentclass[tikz,border=9pt]{standalone} \usetikzlibrary{trees} \begin{...

2

\documentclass[tikz]{standalone} \usepackage[edges]{forest} \usetikzlibrary{arrows.meta} \usetikzlibrary{calc} \forestset{ declare boolean={my folder}{0}, folder/.append style={ for descendants=my folder}, folders down/.style={ for tree={grow'=0, folder}, tier=level me, }, } \begin{document} \begin{forest} forked edges, /tikz/>/.tip={...

2

Like Alan Munn and cfr I also do not understand the problem. You could make the code you have a bit more versatile by using the auto enumeration that can be found in the forest manual on p. 52, and then all you need to do is to add some basic pgf functions. You may want to adjust the items "cat","mole","duck","marmot",... to your needs. \documentclass[12pt,...

2

You could move the D node a bit to the left to make room, with e.g. node [circle,draw,xshift=-5mm] {D} and perhaps also reduce the distance between H and I the same way you did earlier, with node [circle,draw]{F} [sibling distance=7mm] child {node[circle,draw]{H}} child {node[circle,draw]{I}} If you don't need to emphasize the missing children, then no ...

2

Like this: \documentclass[10pt]{article} \usepackage{tikz} \pagestyle{empty} \begin{document} \begin{center} \begin{tikzpicture} \node [circle,draw]{F} [level distance=10mm,sibling distance=25mm] child { node [circle,draw]{D} [level distance=10mm ,sibling distance=15mm] child {node [circle,draw] {B} child {node [circle,draw] ...

2

Here is a possible way. You need to be careful with the braces. I removed them around #2 and #4 in order to not confuse the parser. Other than that I first expand the nested \phrase in a macro \temp, which gets used in the way you do in the case of the unnested \phrase. \documentclass{article} \usepackage{tikz} \usepackage{tikz-qtree} \usepackage{amssymb} \...

1

\documentclass{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{tikz-cd} \begin{document} \[ \begin{tikzcd}[column sep=0em] & \text{Intermediate fields}\\[-4ex] & \mathbb{Q}(\sqrt{3},\sqrt{5})\ar[d, dash]\ar[dr, dash]\ar[dl, dash]\\ \mathbb{Q}(\sqrt{3}) & \mathbb{Q}(\sqrt{5}) & \mathbb{Q}(\sqrt{15})\\ & \mathbb{Q}\ar[u, ...

1

Based on answer (which was significantly improved by edit of @marmoth, thank you again!): \documentclass[12pt, margin=3mm]{standalone} \usepackage{forest} \begin{document} \forestset{ declare toks={elo}{font=\footnotesize, inner sep=2pt, midway, sloped}, % Edge Label Options anchors/.style={anchor=#1,child anchor=#1,parent anchor=#1}, dot/....

1

Just for fun. Since this tree can be found almost literally in the forest manual, I thought it might be worthwhile to add it here. \documentclass{article} \usepackage[edges]{forest} \begin{document} \tikzset{selected/.style={draw=red,fill=red!30}, optional/.style={dashed,fill=gray!50}} \begin{forest} for tree={draw,grow'=0,folder} [texmf [doc] [...

1

As explained in the tikz-qtree manual, you can use \node commands in the tree. This allows you to use fit to draw a frame around nodes that you gave names. \documentclass[12pt]{article} \usepackage[margin=2cm,left=2cm,includefoot]{geometry} \usepackage{tikz-qtree} \usetikzlibrary{fit} \begin{document} \begin{tikzpicture}[scale = 0.7] \Tree [.IP [.\node(DP)...

1

As suggested, forest can do a better job more easily. I don't know just what the trees should look like, so this may need adjustment. For example, you might want a straight line in the last tree or to use fit=band globally. \documentclass[border=9pt]{standalone} \usepackage[]{forest} \usetikzlibrary{shapes} \tikzset{ pl1/.style = {draw, inner sep = 0, ...

Only top voted, non community-wiki answers of a minimum length are eligible