I am a newbie in LaTeX. I am now typesetting the formal proof from Begriffsschrift by Frege, which look like this:
As seen in the picture, I decide to put all the elements of the proof into a 3x3 table. Here is my code:
\documentclass{article}
%load package
\usepackage[utf8]{inputenc}
\usepackage[a4paper, hmargin=1cm, tmargin=1cm, bmargin=2cm]{geometry}
\usepackage{array, amsmath, amssymb, grundgesetze}
%set up counter
%set up command
\newcommand{\MP}{\noindent\rule{3cm}{0.5pt}}
\newcommand{\ThNum}[1]{\multicolumn{2}{l}{#1}\\}
%set up environment
\newenvironment{Frege}
{\begin{tabular}{lcr}}{\end{tabular}}
\newenvironment{Sub}
{\begin{tabular}{r|l}}{\end{tabular}}
\newenvironment{Begriff}
{\begin{minipage}{\linewidth}}{\end{minipage}}
\begin{document}
\begin{Frege}
\begin{Sub}
\ThNum{1}
$q$ &
\setlength{\GGlinewidth}{10pt}\GGconditional{\GGterm{q}}{\GGterm{p}}\\
$p$ &
\setlength{\GGlinewidth}{10pt}\GGconditional{\GGterm{p}}
{\GGconditional{\GGterm{q}}{\GGterm{p}}}\\
\end{Sub}
&
\begin{Begriff}
\setlength{\GGlinewidth}{10pt}\GGjudge\GGconditional{\GGterm{p}}
{\GGconditional{\GGterm{q}}{\GGterm{p}}}
\end{Begriff}
& \\
12 & \MP &\\
\end{Frege}
\end{document}
I use the macro grundgesetze to present the Frege's notation. I meet four problems:
The first line of the minor premise and the number of it doesn't align on the same line. How can I make it is?
I put all the substitutions in a table in order to take the advantage of inserting a vertical line easily. But the disadvantage of it is all the content in table are being too small in size. How can I fix it? Or is there any other method to insert a vertical line easily?
The cell with the number of major premise suddenly expands and ruins all my arrangement. What's wrong with it? And how can I fix it?
I have no idea on how to put the number of conclusion (new theorem) in the exact location in cell. Would you mind give me some suggestion?


grundgesetzewhich you seem to be using, have you looked at the LaTeX packagebegriff, and the plain-TeX packageGFnotation? For the latter, see e.g. this question, and the article Typesetting the “Begriffsschrift” by Gottlob Frege in plain TeX by Udo Wermuth. – ShreevatsaR Jan 24 '20 at 08:23