How can I realize this proof tree in LaTeX?
Does anyone have an idea how to achieve this?
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
S_1 \mathbf{R_5}
\begin{cases}
S_2 \mathbf{R_2}
\begin{cases}
S_4 \mathbf{R_1} & \\
S_5 \mathbf{R_3} & S_6 \mathbf{R_4}
\end{cases} \\
S_3 \mathbf{R_6}
\end{cases}
\end{equation*}
\end{document}
I suggest to define the command
\infer{conclusion}{premise1\\premise2\\...}
as
\newcommand\infer[2]{#1\left\{\begin{array}{@{}l@{}}#2\end{array}\right.}
Moreover, we use the abbreviation
\newcommand\claim[2]{S_{#1}\;\mathbf{R}_{#2}}
to typeset the proof items.
\documentclass{article}
\newcommand\infer[2]{#1\left\{\begin{array}{@{}l@{}}#2\end{array}\right.}
\newcommand\claim[2]{S_{#1}\;\mathbf{R}_{#2}}
\begin{document}
\[\infer
{\claim15}% from
{\infer
{\claim22}% from
{\claim41
\\% and
\claim53\quad\claim64
}
\\% and
\claim36
}
\]
\end{document}
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\DeclareMathOperator{\bfR}{\mathbf{R}}
\begin{document}
\begin{equation*}
S_1 \bfR_5\begin{cases}
S_2 \bfR_2 & \begin{cases}
S_4 \bfR_1 & \\
& \\
S_5 \bfR_3 & \quad S_6 \bfR_4
\end{cases} \\
S_3 \bfR_6 &
\end{cases}
\end{equation*}
\end{document}
This is only likely to be of interest if either you need to draw lots of trees like this or you are familiar with Forest already. In the former case, it would be worth learning enough Forest for the sake of the very concise tree specifications it allows. In the latter, you might want to make the most of existing knowledge since it does allow really very concise specifications of trees.
The format of the node content as S with a subscript and bold R with a subscript is, I assume merely indicative. Hence, you would need to modify this for your particular needs. If the nodes fit a template model, the specification can be all the more concise, of course, as shown below.
The code below sets up a style proof schema tree which expects the content of the tree to be specified as pairs of integers separated by a colon. The content of each node is then split, the first part being taken as the first subscript and the second part as the second. This is then formatted appropriately and the curly brackets added using a non-standard edge path and the brace decoration from the decorations.pathreplacing library.
The upshot is that the tree can be specified with just
\begin{forest}
proof schema tree,
[1:5
[3:6
[5:3
[6:4]
]
[4:1]
]
[2:2]
]
\end{forest}
Complete code:
\documentclass[border=10pt,tikz]{standalone}
\usepackage{forest}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\forestset{
declare count={s content}{0},
declare count={r content}{0},
proof schema tree/.style={
for tree={
math content,
grow=0,
child anchor=parent,
parent anchor=children,
l sep'=7.5pt,
},
for nodewalk={
fake=r,
descendants
}{
if={>On>On=&{!u.n children}{1}{n}{1}}{
edge+={decorate, decoration={brace, amplitude=5pt}},
edge path'={(.child anchor |- .south) -- (!ul.child anchor |- !ul.north)},
}{no edge},
},
before typesetting nodes={
for tree={
split option={content}{:}{s content,r content},
content/.process={OOw2{s content}{r content}{S_{##1} \mathbf{R_{##2}}}},
},
},
},
}
\begin{forest}
proof schema tree,
[1:5
[3:6
[5:3
[6:4]
]
[4:1]
]
[2:2]
]
\end{forest}
\end{document}
braces-environment from theamsmath-package. – naphaneal Jan 02 '17 at 23:28casesenvironments, also fromamsmath– AboAmmar Jan 02 '17 at 23:40