I'm trying to format a PD derivation but I'm having trouble getting subderivations to display well. Essentially what I'm trying to accomplish is this:
1 | P Assumption
2 | Q Assumption
------------
3 | P v Q 1, 2 vI
4 | | P A / vE
| --------
5 | | R
6 | R
The above is all nonsense but it shows the format I need. Basically, I need one column for line numbers followed by a vertical line, a horizontal line under assumptions ("A" also means assumption) and a third column explaining the derivation rule I used with the corresponding line numbers. Without the subderivation I can do it with tables like this:
\begin{tabular}{l | l l}
1 & P & Assumption \\
2 & Q & Assumption \\ [0.5ex] \cline{2-2} \\ [-1.9ex]
3 & P v Q & 1, 2 vI \\
\end{tabular}
For a little more detail, the vertical bars and their associated horizontal bar should be connected and the vertical bars for the subderivations should be spaced so they're pretty close to being underneath the first character of the line above it. I thought about making a new table inside the whole table for each subderivation, but I feel like that would mess up the line numbering since it would only occupy a single cell. Any suggestions as to how I should lay this out are greatly appreciated.
Here's an image of the desired layout (added by Gonzalo Medina, from an image linked in a comment):
Best Answer
The site
LaTeX for logicians
mentions various packages availables; the following example was obtained usingfitch.sty
by Johan Klüwer (the package is not on CTAN, but following the link I provided you can download it). To get the desired horizontal rule I defined a\fgh
command similar to the original\fh
command; the mandatory argument for\fgh
gives the rule length:An here's the code for the deduction in the image: