The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

5

It is possible to avoid the phantoms altogether by using calign=fixed edge angles, as in the manual on the top of p. 41. And I would define a style for that. \documentclass{article} \usepackage{forest} \forestset{binomial queue/.style={calign=fixed edge angles,calign primary angle=30,calign secondary angle=60, for tree={if n children={1}{grow=-60}{calign=...


4

A simple rude solution: \documentclass[margin=3mm]{standalone} \usepackage{forest} \begin{document} \begin{forest} for tree={circle,l=14mm,s sep=10mm,draw} [23 [,phantom] [,phantom] [51] [24 [,phantom] [65] ] ] \end{forest} \end{document} a little bit more "advance" solution \documentclass[margin=3mm]{...


2

I do not get errors (of course after loading amsmath for bmatrix). \documentclass[11pt]{article} \usepackage{forest} \usepackage{amsmath} \begin{document} \textit{Generator $(12)$} \[ \begin{forest} for tree={grow'=east,l sep=8em,s sep=3em,circle,inner sep=2pt,fill} [,label=left:{$(12)=\begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 2 \\ 0 & 0 &...


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/....


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

I'm obviously biased, but I'd use prooftrees: \documentclass{standalone} \usepackage[tableaux]{prooftrees} \forestset{ my label/.style={ edge label={node [midway, font=\scriptsize, left] {$#1$}} }, } \begin{document} \begin{tableau}{not line numbering, single branches, not auto move} [(\lnot A \to (B \to \lnot C)) [\lnot A, my label=\to ...


3

I'm not really sure why anyone would really want to use xytree for trees, given the existence of tree drawing packages like tikz-qtree and forest, but it's possible to do what you want using xypic \save and \restore along with object composition. Unpacking the code somewhat: \save"2,2"*+<2.5em,1.5em>{}."4,4"*+=[F-]\frm{}\restore We first compose ...


0

The use of the dot language with the program Graphviz together with the dot2tex package (to include the dot figure in LaTeX) was helpful to get the wished result. Benefits of dot is a simpler writing of the graph, see code and figure example. On the other hand, the squared edge is not always drawn as it should be, see Graphviz edge between nodes wrong drawn....


2

Forest already counts levels, so a separate function to do this is superfluous. In addition, minimising the use of pgfmath will speed compilation. (Not an issue if this is your only tree and it is this simple, but more of a problem if you have many or complex trees.) \documentclass[tikz,border=10pt]{standalone} \usepackage[]{forest} \begin{document} \begin{...


0

Version 0.7 of prooftrees can do this by disabling the automated movement algorithm. \documentclass[tikz,border=10pt]{standalone} \usepackage{prooftrees} \begin{document} \begin{prooftree} { to prove=\neg(a \vee b) \vee ((a \vee b) \vee b), not auto move, } [{(a \vee b) \vee ((a \vee b) \vee b)}, just = 1 [{\neg (a \vee b)}, just = 2 ...


4

The XY syntax is quite concise and powerful, but it takes some getting used to. But it's easy to add the labels relative to the position of the bullet using the \save and \restore function of XY. See my answer to Pushout commutative diagram for a detailed explanation of how that works. \documentclass{article} \usepackage[all]{xy} \begin{document} \[ \...


4

A solution with TiKz. (I never used the xy package). \documentclass[margin=3mm]{standalone} \usepackage{tikz} \tikzset{% pics/bullet/.style args={#1,#2}{ code={ \node at (0,1) [draw,circle,fill,minimum size=2mm,inner sep=0pt,label={$#1$}](#1){}; \node at (2,1) [draw,circle,fill,minimum size=2mm,inner sep=0pt,,label={$#2$}](#2){}; \node at (1,...


Top 50 recent answers are included