How can I achieve a result similar to the image below?

I tried a mixture of boxes and tabular, but the box didn't allow the tabular enviroment.
Thank you

Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Code: Select all
\documentclass{article}
\usepackage{KMcalc}
\renewcommand{\KMproveword}{}
\renewcommand{\KMProveword}{}
\newlength{\linelength}
\setlength{\linelength}{2cm}
\newcommand{\myline}[2]{\KMline{\qquad\makebox[\linelength][l]{$#1$}#2}{}}
\newcommand{\mylineboxunder}[2]{\KMprove{\qquad\makebox[\linelength][l]{$#1$}#2}{}}
\begin{document}
\begin{KMcalc}
%
\mylineboxunder{\lnot p \lor q}{}
\mylineboxunder{\lnot p}{premise}
\myline{p}{assumption}
\myline{\bot}{$\lnot$e 3,\,2}
\myline{q}{$\bot$e 4}
\KMclose
\myline{p \rightarrow q}{~~$\rightarrow$i 3--5}
\KMclose
\myline{p \rightarrow q}{}
%
\end{KMcalc}
\end{document}
Code: Select all
\documentclass[]{article}
\usepackage{KMcalc}
\renewcommand{\KMproveword}{}
\renewcommand{\KMProveword}{}
\newlength{\linelength}
\setlength{\linelength}{2cm}
\newcommand{\myline}[2]{\KMline{\qquad\makebox[\linelength][l]{$#1$}#2}{}}
\newcommand{\mylineboxunder}[2]{\KMprove{\qquad\makebox[\linelength][l]{\hspace{-0.27cm}$#1$}#2}{}}
\begin{document}
\begin{KMcalc}
%
\myline{p \rightarrow q}{premissa}
\mylineboxunder{r \rightarrow s}{premissa}
\myline{p}{hipótese}
\myline{q}{$\rightarrow_e 1,3$}
\myline{q \lor s}{$\lor_{i_1} 4$}
\KMclose
\mylineboxunder{p \rightarrow q \lor s}{$\rightarrow_i$ 3--5}
\myline{r}{hipótese}
\myline{s}{$\rightarrow_e$ 2,7}
\myline{q \lor s}{$\lor_{i_2}$ 8}
\KMclose
\myline{r \rightarrow q \lor s}{$\rightarrow_i$ 7--9}
\myline{p \lor r \rightarrow q \lor s}{\hspace{0.5cm}$\lor_e$ 3-5, 7-9}
%
\end{KMcalc}
\end{document}

Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis