[Tex/LaTex] Alignments in bussproofs package

horizontal alignmentlogic

I'm using bussproofs and would like my premises always to be left-aligned with the beginning of the inference line. So far when I have a single premise inference, I can only get the premise centered on the inference line, as in:

\documentclass{article}
\usepackage{bussproofs}
\begin{document}
\begin{prooftree} \AxiomC{$\neg A$} \UnaryInfC{$\neg A \lor \neg B$} \end{prooftree}
\end{document}

Is it possible to get the premise be left aligned with the line?

Best Answer

Here are two options:

  1. Set the smaller box (your premise \AxiomC) in a box of the same width as the larger box (your conclusion \UnaryInfC), only left-aligned. This can be achieved using \makebox[<width>][l]{...}; or

  2. Use \phantom{<stuff>} to remove <stuff> from the display but still have the appropriate space allocated for it.

enter image description here

\documentclass{article}
\usepackage{bussproofs}% http://ctan.org/pkg/bussproofs
\newlength{\mylen}
\begin{document}
\begin{prooftree}
  \settowidth{\mylen}{$\neg A \lor \neg B$}%
  \AxiomC{\makebox[\mylen][l]{$\neg A$}}
  \UnaryInfC{$\neg A \lor \neg B$}
\end{prooftree}

\begin{prooftree}
  \AxiomC{$\neg A \phantom{\:{\lor}\:\neg B}$}
  \UnaryInfC{$\neg A \lor \neg B$}
\end{prooftree}
\end{document}

In the first example, the width of the conclusion is stored in \mylen (a new length) via \settowidth. \mylen is then used to provide the box width for the premise.

In the second example, a minor correction for the spacing around the binary operator \lor is performed by adding \: around the now atomized {\lor}.

Related Question