Tag Info

New answers tagged

2

For completeness, and in partial response to a query in the comments on my other answer, here is the tree set with prftree. As can be seen, this no more lends itself to typesetting this kind of tree than semantic. If anybody wants to typeset natural deduction proofs of this kind for logic, though, it looks like a really nice package with a lot of convenience ...


4

An attempt at this problem with MetaPost. It defines a macro binomial_tree(expr N, p)(text thelabels) where N is the number of periods (horizontal/vertical levels), p is the probability value and (since the OP required manual labelling) thelabels is a list containing all the labels in the right order, the nodes being numbered from left to right and from top ...


4

Defining a style creates another macro argument layer, so you need to double the #, like this: content/.wrap pgfmath arg={##1}{content("!u")*\p},


3

If you're just interested in the resulting output, use the standalone class: \documentclass[margin=5pt]{standalone} It will create a page of sufficient size leaving a margin/border of 5pt.


4

This calculates the probabilities for a given value of p. You just need to put my binomial=<value> at the start of the tree to select the appropriate style with the appropriate value of p. I've used 0.25 as an example. You also specify the content of the nodes manually, as you requested. \documentclass[tikz,border=10pt]{standalone} ...


3

This solution uses matrix and is not so automatic as Malipivo's solution. All links could be drawn within some \foreach loop, but I was not enough inspired now. \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{matrix,shapes} \begin{document} \begin{tikzpicture}[mynode/.style={draw,ellipse, minimum width=1.5cm, minimum height=.8mm}] \matrix (A) ...


3

Version 2 (strategy of overwriting the node labels) I've added probabilities above/below the arrows; p0 can be changed via the \malp command. Next to it, I've written horizontal level plus number of ds (vertical level) information into the nodes. We can turn it off via the \nodeformat command. If we want to add our own node text, it's located in the last ...


4

If you are willing to use forest, this can be done fairly simply, the code can be simplified and some nodes can be created automatically. In this case, I've appended the f nodes automatically. I've created a style my x to make it easier to add the edge labels, and I've used a tier, in combination with 2 phantom nodes to manage the alignment of the terminal ...


5

You should be using forest for better (wait for cfr to add an example, for sure :-)). For your code, you have to add few red and black at suitable places. \documentclass[a4paper,landscape] {article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{arrows,automata,calc,shapes,backgrounds} \usepackage{amsmath, amssymb} \tikzset{ ...


3

It can also be done with MetaPost, e.g. with the help of the MetaObj package. A tree is one of the ‘‘objects’’ that MetaObj handles, and is defined recursively, as those in this program are: t := _T(TCs)(TCs, _T(TCs)(TCs, _T(TCs)(TCs))); ... t := _T(TCs)(_T(TCs)(_T(TCs)(TCs, _T(TCs)(TCs)))); _T is a shortcut for the new_Tree command, which create a ...



Top 50 recent answers are included