Forest 包根本不起作用

Forest 包根本不起作用

我已经使用该forest软件包好几年了,直到现在我都没有遇到任何问题。它只是停止工作了。我使用 Texstudio,但我尝试使用 TeXShop 处理同一个文件并得到同样的错误,所以我认为问题与 TeX 安装有关。我重新安装了 MacTeX,更新了所有软件包,但仍然没有运气。这是 MWE 和我得到的错误。

\documentclass{article}
\usepackage{forest}

\begin{document}

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

\end{document}

日志:

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.8.16)  16 AUG 2022 15:57
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**Test.tex
(./Test.tex
LaTeX2e <2022-06-01> patch level 5
L3 programming layer <2022-08-05>
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@section=\count186
\c@subsection=\count187
\c@subsubsection=\count188
\c@paragraph=\count189
\c@subparagraph=\count190
\c@figure=\count191
\c@table=\count192
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
) (./forest.sty
Package: forest 2013/01/28 v1.03 Drawing (linguistic) trees

(/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.te
x
\pgfutil@everybye=\toks16
\pgfutil@tempdima=\dimen139
\pgfutil@tempdimb=\dimen140

还有更多行,并且(就在错误之前):

(/usr/local/texlive/2022/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count293
\scratchdimen=\dimen196
\scratchbox=\box84
\nofMPsegments=\count294
\nofMParguments=\count295
\everyMPshowfont=\toks36
\MPscratchCnt=\count296
\MPscratchDim=\dimen197
\MPnumerator=\count297
\makeMPintoPDFobject=\count298
\everyMPtoPDFconversion=\toks37
) (/usr/local/texlive/2022/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
85.

(/usr/local/texlive/2022/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
e
))
! Undefined control sequence.
<argument> \locbox 
                   \forest@temp@box \forestolet {box}\forest@temp@box 
l.11 \end{forest}

             

我在 macOS Monterey 上使用 TeXstudio。

答案1

您的日志显示

(/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls

所以你的 TeX 根植于/usr/local/texlive/2022/texmf-dist/tex/

所以你将forest 2017/07/14 v2.1.5安装在

/usr/local/texlive/2022/texmf-dist/tex/latex/forest/forest.sty

然而 TeX 使用

(./forest.sty
Package: forest 2013/01/28 v1.03 Drawing (linguistic) trees

也就是说,一个真正古老的版本在工作目录中

删除./forest.sty之后TeX就会找到使用texlive 2022安装的版本。

相关内容