我刚刚将do_release_upgrade
我的 Ubuntu 从 Ubuntu 18 升级到了 Ubuntu 20,当然也更新了很多 TeX。从那时起,以下最小示例
\documentclass{article}
% \def\pgfversion{42} %% Adding this doen't help
\usepackage{pstricks}
\begin{document}
\end{document}
结果如下
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/pstricks/pstricks.sty
(/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/tools/shellesc.sty)
(/usr/share/texmf/tex/latex/xcolor/xcolor.sty
(/etc/texmf/tex/latex/config/color.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def))
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/pst-xkey.tex
(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))))
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pstricks.tex
(/usr/share/texlive/texmf-dist/tex/generic/pstricks/pst-fp.tex
`pst-fp' v0.05, 2010/01/17 (hv))
(/usr/share/texmf/tex/generic/pgf/utilities/pgfutil-common.tex)
(/usr/share/texmf/tex/generic/pgf/utilities/pgfkeys.code.tex
(/usr/share/texmf/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex))
(/usr/share/texmf/tex/generic/pgf/utilities/pgffor.code.tex
Loading [
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.10 \ProvidesPackageRCS[v
\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf...
?
显然,\pgfversion
在需要时(在)尚未定义\usepackage{pstricks}
。
问:出了什么问题?似乎没有包需要更新。
作为一种解决方法,我尝试添加\def\pgfversion{42}
,但这并没有改变任何东西,即在里面\usepackage
,\pgfversion
仍然未定义。
编辑:我使用的是 TeX-live。为了方便起见,我用更直接的 pstricks 替换了 pst-text,并添加了完全的输出上述内容,以使使用的文件名清晰易懂。
答案1
执行相同的升级时我遇到了同样的问题。
我可以通过编辑文件/path/to/texmf/tex/generic/pgf/utilities/pgffor.code.tex
并注释掉该行来修复它\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/utilities/pgffor.code.tex,v 1.25 2013/12/13 11:40:27 tantau Exp $