Is there a simple and intuitive way to drawn with latex this kind of tree?

I tried to check in the site "LATEX for LOGICIANS", but I can't find this kind of tree, with this kind of layout. Thank you

  • 2
    Section 4 of the LaTeX for Logicians site appears to have exactly this type of tree.
    – Thruston
    Commented Dec 8, 2015 at 10:56
  • I saw it, but I would like to find the latex code of that kind of type...
    – Matteo
    Commented Dec 8, 2015 at 11:26
  • Well, if you look at the packages listed on that page, you will find plenty of examples. There are also examples on this site. This is just standard. You don't even need numbers or labelling, which is where the complications begin.
    – cfr
    Commented Dec 8, 2015 at 14:40

2 Answers 2


Here's a forest style, smullyan tableaux. The key closed can be used when the style is active to close the current branch.

One advantage of forest is the concise bracket syntax used to specify trees.

\newcommand*\lif{\mathbin{\to}}% added thanks to egreg's suggestion
  smullyan tableaux/.style={
    for tree={
      math content
    where n children=1{
      !1.before computing xy={l=\baselineskip},
      !1.no edge
  smullyan tableaux
  [\lnot(\lnot(A \land B) \lif (\lnot A \lor \lnot B))
    [\lnot(A \land B)
      [\lnot(\lnot A \lor \lnot B)
        [\lnot\lnot A
          [\lnot\lnot B
                [\lnot A, closed]
                [\lnot B, closed]

Smullyan tableaux

Note that it is more usual in logic, as far as I know, to draw trees so that branches start from a common point:

common branch point

This can be achieved, if necessary, by adding

      parent anchor=south,
      child anchor=north,

to the style.

  • I usually define \newcommand{\lto}{\mathbin{\to}} so the arrow is treated as a binary operation (which it is, in this case).
    – egreg
    Commented Dec 8, 2015 at 22:45
  • @egreg I don't think it is really the correct arrow. When I had to draw these, I was using the horseshoe so it wasn't a problem.
    – cfr
    Commented Dec 9, 2015 at 0:58
  • @egreg Is that better? I think \lif is better than \lto because it can be redefined to \supset if necessary. (I know \lto could be also, but \lif is semantic whereas \lto is format.)
    – cfr
    Commented Dec 9, 2015 at 1:08

Here is a simple code with pstricks, and more specifically with pst-tree:


\usepackage{pst-node, pst-tree, auto-pst-pdf}
\def\noedge{\ncline[linestyle = none]}
\renewcommand\psedge{\ncline[arrows =-]}


\[ \psset{levelsep=1.2cm, treesep=2cm, nodesepA=10pt, nodesepB=2pt}
    {\TR[vref =-1.25]{%
        \makebox[0pt]{$ \begin{matrix}\neg(\neg(A\wedge B)\to(\neg A\vee\neg B))\\
            \neg(A\wedge B)\\
            \neg(\neg A\vee\neg B) \\
            \neg\neg A\\
            \neg\neg B\\
            A\\B\end{matrix} $}}}%
        \TR[vref=1, href=2]{$ \begin{matrix} \neg A\\ \times\end{matrix}$}
        \TR[vref=1, href=-2]{$ \begin{matrix} \neg B\\ \times \end{matrix}$}
        } \]

enter image description here

  • You're welcome. Always glad to help!
    – Bernard
    Commented Dec 8, 2015 at 12:12

You must log in to answer this question.

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