package - LaTeX \usepackage{forest} 不工作,显然是由于 .sty 文件?
问题描述
我正在尝试使用 TeX 包森林来绘制一个简单的树形图。但是,由于某种原因不想使用该软件包。我尝试从两个不同的镜像安装,并从 CTAN 网站手动安装,但仍然无法正常工作。导致错误的行是\usepackage{forest}
,因为没有此行文件编译得很好。根据下面的日志,错误出在forest.sty
文件本身,但是似乎没有其他人遇到这个问题 - 除非它是由于新的 TeX 更新?
有人知道这里发生了什么吗?
! Missing \endcsname inserted.
<to be read again>
\unhbox
l.1061 }
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1061 }
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! Extra \endcsname.
\pgf@arrow@letter@ ...l@arrow@name@end \endcsname
#1
l.1061 }
I'm ignoring this, since I wasn't doing a \csname.
...
! Missing \endcsname inserted.
<to be read again>
\unhbox
l.1087 \csdef{forestmath@convert@from@n@to@_}
#1{\unexpanded{#1}}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing \endcsname inserted.
<to be read again>
\unhbox
l.1088 \csdef{forestmath@convert@from@d@to@_}
#1{\unexpanded{#1}}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
...
这持续了一段时间,从 1061 到 6309 行。错误列表显示了许多与此类似的行:
C:\...tex/latex/forest/forest.sty | Error line 1087 !Missing \endcsname inserted. <to be read again>\unhbox ...
第forest.sty
1086-8 行的文件是
1086: \def\forestmathzero{\forestmath@convert@from\forestmathtype@count{0}}
1087: \csdef{forestmath@convert@from@n@to@_}#1{\unexpanded{#1}}
1088: \csdef{forestmath@convert@from@d@to@_}#1{\unexpanded{#1}}
编辑:如下面的回答,问题出在 package underscore
,即 line \usepackage[strings]{underscore}
。因此,一个最小的例子是
\documentclass[a4paper]{article}
\usepackage[strings]{underscore}
\usepackage{forest}
\begin{document}
This won't work
\end{document}
解决方案
原来冲突的包是underscore
,即行\usepackage[strings]{underscore}
。删除此行可以解决问题。
推荐阅读
- python - use ValueProvider to format a BigQuery in Dataflow
- php - 联系表格 7 提交后调用 PHP 函数
- google-apps-script - 使用谷歌应用脚本设置文件共享权限的到期日期
- php - url重写:域名后的id
- java - 将参数类型绑定到多个候选者之一
- date - Neo4j 日期和日期时间比较问题
- python - python过滤散点图基准日期
- objective-c - 在 AppDelegate 中未调用 applicationShouldTerminate 并且未发送 NSApplicationWillTerminateNotification
- python - openpyxl 将查询添加到 excel 连接表
- fluid - 如何在另一个页面中呈现 pageuid?