2
\documentclass[oneside,12pt]{article}
\usepackage{geometry}
\usepackage{microtype}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage{enumitem}
\setlist[enumerate,1]{label=\bfseries\Alph*,align=left,leftmargin=*,
  labelsep=1.5em}
\setlist[enumerate,2]{label=\arabic*.,labelindent=1em,labelsep=1.5em,
  leftmargin=*}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem*{sol}{Solution}

\usepackage{forest}
\forestset{
  ass/.append style={
    before computing xy={l=\baselineskip},
    no edge
  },
  prooftree/.style={
    for tree={
      child anchor=north,
      parent anchor=south
    }
  },
  default preamble={
    prooftree,
    for root={baseline},
    for tree={%
      if n children={1}{for children={ass}}{},
      math content
    }
  }
}

\begin{document}
\subsection*{Exercises 28}
\begin{enumerate}
\item Let's use `$\vDash$' now to abbreviate `q-entails'. Which of the
  following claims are true? Provide arguments in the style of 28.2 and 28.6
  to defend your answers.
  \begin{enumerate}
  \item $\forall x(Fx\supset Gx)\vDash\forall x(Gx\supset Fx)$
    \begin{sol}
      Try the following q-valuation:
      \begin{quote}
        Domain = all people\\
        Extension of `F' = all singers\\
        Extension of `G' = all people who know how to sing
      \end{quote}
      Then, the premiss is true, but the conclusion is false.
    \end{sol}
  \item $\forall x(Fx\supset Gx)\vDash\forall x(\neg Gx\supset\neg Fx)$
    \begin{sol}
      \begin{forest}
        [$\forall x(Fx\supset Gx)$
        [$\forall x$]]
      \end{forest}
    \end{sol}
  \end{enumerate}
\end{enumerate}
\end{document}

produces

enter image description here

But, I expected to see.

enter image description here

How can I have default preamble applied to forest environment?

  • Does that compile without error for you? For me, it does not. But the default preamble is definitely applied. Indeed, that is precisely why I get a compilation error! – cfr Feb 25 '16 at 03:29
  • To compile it, I must remove the $s in the tree. Then it compiles and I get precisely the output you expect - not the output you say you're getting. – cfr Feb 25 '16 at 03:30
  • On my computer, I get errors if I remove $s in the tree. With $s, I don't get an error, and default preamble is ignored. –  Feb 25 '16 at 03:33
  • You are using version 1 of Forest. You need to update or not use default preamble. See my answer below. – cfr Feb 25 '16 at 03:36
  • Did you get this sorted? – cfr Feb 25 '16 at 22:53
  • @cfr I just decided to wait. Installing texlive manually involves more work than I want. –  Feb 27 '16 at 07:13

1 Answers1

3

You are using version 1 of Forest. default preamble is provided in version 2. To make this work you must:

  1. update Forest to version 2 (preferably 2.0.1, preferably by updating your TeX distribution);
  2. remove the $ signs from the final tree.

    \begin{forest}        
      [\forall x(Fx\supset Gx)
        [\forall x]
      ]
    \end{forest}
    

image

You cannot use default preamble if you have access to only version 1 of the package. If I revert to version 1 and replace the $ signs, then I get the same output as you.

cfr
  • 198,882
  • How do I update forest to version 2? I already have the latest stable texlive from archlinux. –  Feb 25 '16 at 03:50
  • Install vanilla TeX Live from upstream, uninstall Arch's version and install a dummy package to keep pacman happy (so that you can install stuff which requires TL without pacman installing TL from Arch's repos). – cfr Feb 25 '16 at 03:52
  • See http://tex.stackexchange.com/questions/1092/how-to-install-vanilla-texlive-on-debian-or-ubuntu?s=7|1.2095. The question is about Debian/Ubuntu, but the principle is exactly the same for any Linux distro. If you want to use the latest CTAN versions, this is the way to go. Just don't end up with 2 versions installed as that way lies madness. (It is OK to have multiple upstream TLs installed from different years, though.) Note that if you do this, you can avoid installing and managing TL as a privileged user. – cfr Feb 25 '16 at 03:54
  • PKGBUILD: pkgname=texlive-dummy-crocket pkgver=1.0 pkgrel=1 pkgdesc="TeX typesetting program" arch=(i686 x86_64) license=('custom') provides=('tetex' 'texlive-bin' 'texlive-core' 'texinfo') conflicts=('tetex' 'texlive-bin' 'texlive-core') build() { /bin/true } (May need updating for latest syntax.) – cfr Feb 25 '16 at 03:58
  • Not everything has to be done through package managers. You can download the package from CTAN, put it somewhere in your file system, and add that location to the head of the TEXINPUTS environment variable. – Victor Eijkhout Mar 29 '22 at 16:03