2

I'm trying to do a prooftrees tree like this:

\documentclass[letterpaper, 12pt]{article}
\usepackage{prooftrees}
\begin{document}
\begin{prooftree}
{
    to prove={ A \lor B \lor C \lor D \lor E }
}
    [ A ]
    [ B ]
    [ C ]
\end{prooftree}                                                                                                                     
\end{document}        

But it currently outputs this:

Current output

It's all on the same line while I'm trying to get a tree with branches on multiple lines. Can anyone tell me what I'm doing wrong?

EDIT: Tried a forest tree, it doesn't work either. Lines are drawn but the letters are all still crammed like in the picture.

4
  • 1
    welcome to the site, please could you make your example a complete document that makes the image, so people can reproduce, and test answers. Sep 17, 2017 at 20:40
  • 2
    [ A [ B [ C ] ] ] seems more reasonable input
    – egreg
    Sep 17, 2017 at 20:46
  • @DavidCarlisle Done, still doesn't work though :(
    – wofinoli
    Sep 17, 2017 at 20:47
  • @egreg That also doesn't work, it looks the same.
    – wofinoli
    Sep 17, 2017 at 20:49

2 Answers 2

2

It's a tree, so it needs one root and branches.

For instance

\documentclass{article}
\usepackage{prooftrees}

\begin{document}

\begin{prooftree}
{
    to prove={A \lor B \lor C \lor D \lor E}
}
[A
  [ B ]
  [ C
    [ D ]
  ]
]
\end{prooftree}

\end{document}

enter image description here

Note that, in order to see the real result, you have to look at a PDF output, either running pdflatex or latex+dvips+ps2pdf; the DVI file will not show the correct output, because TikZ/PGF, which prooftrees is based on, uses “specials” that DVI viewers are not able to show.

17
  • I copied your example but it still doesn't work, this is the new output. Did I do something wrong?
    – wofinoli
    Sep 17, 2017 at 20:56
  • @wofinoli Ensure to have the most recent version of prooftrees, namely version 0.6 released 2017/02/09.
    – egreg
    Sep 17, 2017 at 20:58
  • This is what's in my log file: prooftrees.sty 2017/02/09 v0.6 (SVN Rev: 5848)
    – wofinoli
    Sep 17, 2017 at 21:00
  • Also this is what it says for forest: forest.sty 2017/07/14 v2.1.5 Drawing (linguistic) trees
    – wofinoli
    Sep 17, 2017 at 21:06
  • @wofinoli That's the same. Did you compile the exact example?
    – egreg
    Sep 17, 2017 at 21:10
2

egreg is correct regarding the solution, but the diagnosis is wrong. The problem is not that the tree has no root. It has a perfectly good root. Moreover, it does not superimpose nodes if compiled with an appropriate engine (e.g. pdfTeX).

\documentclass[border=10pt]{standalone}
\usepackage{prooftrees}
\begin{document}
\begin{prooftree}
{
    to prove={ A \lor B \lor C \lor D \lor E }
}
    [ A ]
    [ B ]
    [ C ]
\end{prooftree} 
\end{document}

produces

proof with a strange beginning

Now, admittedly, this probably is not what you meant or want, but it is reasonably sensible output, given the input.

Suppose we instead try

\begin{forest}
    [ A ]
    [ B ]
    [ C ]
\end{forest}

which produces

Forest

This is because Forest takes [ A ] to be the root and, hence, the entire tree. Everything after the tree specification is passed to TikZ, but there are no relevant commands here, so [ B ] and [ C ] are parsed as text. Since we are inside a tikzpicture environment, we are using the null font and the text is ignored. Hence, we effectively have

\begin{forest}
  [ A ]
\end{forest}

The reason that the prooftree environment behaves differently is because the tree specified by the user is actually a sub-tree of the tree the environment typesets. prooftree embeds the user's tree specification in a larger tree which includes the line numbers, justifications and 'to prove' line, as appropriate. Hence, the inner forest environment reads

  [ A ]
  [ B ]
  [ C ]

as part of the tree specification, so these end up being nodes in the tikzpicture and get typeset in the normal font, which is switched back by TikZ for node text.

The user provided root in a prooftree is 'never' the root of the typeset tree. I'm not sure it is possible to make a prooftree attempt to set a rootless tree and, although I would not wish to rule this possibility out, I can say that it is most unlikely that anybody would do so by accident.

You must log in to answer this question.

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