5

I want to draw logic proof trees in ConTeXt. Specifically, I want to be able to draw trees like this: proof tree

I am aware that there are nice ways of doing this in LaTeX, and that the question What is the best package out there to typeset proof trees? already shows how. Are there clean ways to do it with ConTeXt?

1 Answer 1

7

As a quick workaround (in easy cases, MKIV-only), you could use Aditya's wonderful filter module to make use of the LaTeX package (I picked bussproofs). This is explained in the documentation, I just minimally altered it:

\usemodule[filter]
\defineexternalfilter
   [prooftree]
   [filter=pdflatex,
    output=\externalfilterbasefile.pdf,
    readcommand=\readPDFfile,
   ]

\def\readPDFfile#1{\externalfigure[#1]}
\startbuffer[prooftree::before]
  \documentclass{minimal}
  \usepackage{bussproofs}
  \usepackage[active,tightpage]{preview}

  \begin{document}
  \begin{preview}
  \begin{prooftree}
\stopbuffer

\startbuffer[prooftree::after]
  \end{prooftree}
  \end{preview}
  \end{document}
\stopbuffer

\setupexternalfilter
  [prooftree]
  [bufferbefore={prooftree::before},
   bufferafter={prooftree::after}]

\starttext

This is a {\em bussproofs} prooftree in \Context:

\startprooftree
\AxiomC{$\Gamma, A \vdash B$}
\LeftLabel{Conditional Proof:}
\UnaryInfC{$\Gamma \vdash A \rightarrow B$}
\stopprooftree

\stoptext

This could be made more convenient (by writing better ConTeXt macros, I suppose) to include references to the trees-as-pictures.

1
  • FWIW, the filter module works with MkII as well.
    – Aditya
    Commented Aug 16, 2012 at 17:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .