2

I want to make my tree look like the default tree in the forest documentation, like below:enter image description here

As you can see, there is some spacing between the edges, and their endpoints are not connected to each other.

However, I am not able to replicate this in my code:

\begin{forest} for tree={
    s sep=1cm, 
    }
    [
        $(p \land (\lnot q))$
        [
            $p$, s sep=1cm, 
        ]
        [
            $(\lnot q)$
        ]
    ]
\end{forest}

This is the graph I'm getting, where the parent anchors are all touching each other.

How do you make it not touch? Thanks in advance!

enter image description here

3
  • 1
    Welcome! This is due to code you've not shown. Just to say that for logical tableaux, you usually would want them to touch but, if you don't, forest's defaults don't touch. I assume you have set something earlier which changes this. For example, perhaps you've loaded a library.
    – cfr
    Commented May 19 at 16:06
  • 1
    Ohh, I have found the issue. I was using \usepackage[linguistics]{forest} instead of \usepackage{forest}. Haha oops, thanks for the help!
    – l0uis
    Commented May 19 at 16:17
  • 1
    That'll do it ;). As you see, that was my guess. There are other ways, but that seemed most likely.
    – cfr
    Commented May 19 at 16:20

1 Answer 1

5

By default, the parent anchors don't touch. For example,

\documentclass{standalone}
\usepackage{forest}
\begin{document}
\begin{forest} for tree={
  s sep'=1cm, 
  math content,
  }
  [(p \land (\lnot q)
    [p
    ]
    [(\lnot q)
    ]
  ]
\end{forest}
\end{document}

produces

non-touching parent anchors

Apologies for the poor quality images. Okular on X has a bug right now and I'm not very good with convert.

If, however, you change

\usepackage{forest}

to

\usepackage[linguistics]{forest}

you obtain

parent anchors joined

In general, this is what you want in a logical tableau. For example, prooftrees would produce the following by default,

prooftrees default with anchors joined

But you can override this in the tableau's preamble. For example,

\documentclass{standalone}
\usepackage[tableau]{prooftrees}
\begin{document}
\begin{tableau}{%
  for tree={%
    s sep'=1cm,
    not line numbering,
    parent anchor=,
  }, 
  }
  [(p \land (\lnot q)
    [p
    ]
    [(\lnot q)
    ]
  ]
\end{tableau}
\end{document}

produces

tableau with non-default non-joined anchors

You must log in to answer this question.

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