I would like to make something similar to the logic tree below. I've tried using tikz-qtree, but I can't figure out how to number every line in the tree. I did however find something else doable in qtree. Here's a sample of my code (note that it's not the same tree as below)
\documentclass[a4paper, english, 12pt, reqno]{article}\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[norsk]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage[shortlabels]{enumitem}
\usepackage{bm}
\usepackage{qtree}
\begin{document}
\maketitle{}
\section{}
\begin{center}
\begin{tabular}{c c c}
\Tree[.{1\\2\\ 3\\4} [.5 [.6 ] ] ] &
\Tree[.$A\supset B$\\$C\vee A$\\$\sim\sim C$\,\checkmark\\$C$ [.$C$ $s$ $s$ ][.$A$ $c$ $c$ ] ] &
\Tree[.SM\\SM\\SM\\3$\sim\sim$D [.3$\vee$D [.1$\supset$D ] ] ]
\end{tabular}
\end{center}
\end{document}
So I have some questions, which I hope will be able to help me get closer to a similar tree as in the picture.
1) My lines are not aligned horizontally, any ideas on how to fix that?
2) How can I remove the lines that connects the numbers, and the notation on the right side of the tabular enviroment?
3) This question is not about my code, but I will have this problem later. As you see on line 9 in the picture, there is a node all the way down to the 12th line, skipping the lines in between. How do I do this?
I'm open for using tikz-qtree too, and I probably missed something in the manual, so I will try to read more, as I'm quite new to using qtree in LaTeX. Thanks in advance!
Best Answer
This is a variant of Ignasi's answer. It uses a new package based on
forest
. The advantage is that the lines are automatically numbered, the justifications are added as annotations with their nodes using the keyjust
(no need for a separate tree) and the vertical spacing between lines which should be grouped together (as when listing assumptions) is corrected automatically. In addition, styles are provided to move nodes (move by
) to lower lines in the tree without the need to set specialtier
names or enter empty nodes. Cross-referencing support is provided in justifications and closure annotations (using either named nodes or relative node names), so that line numbers need not be hard-coded. Further options and details are explained in the package documentation.