当我包含 pgfplots 时无法使用 pdflatex 进行编译,pgf/math/pgfmathparser.code.tex 出现错误(缺少插入的 \endcsname。)

当我包含 pgfplots 时无法使用 pdflatex 进行编译,pgf/math/pgfmathparser.code.tex 出现错误(缺少插入的 \endcsname。)

我有一个包含少量输入的大文档,因此无法显示所有内容,但我遇到了这个奇怪的错误。没有 pgfplots,一切都很顺利,没有警告。

\usepackage{usenix}
\usepackage{endnotes,epsfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{url,color,fancyvrb}
\usepackage{times}
\usepackage{subfigure}
\usepackage{array}
\usepackage{xspace}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{program}
\usepackage[ruled]{algorithm2e}
\usepackage{algpseudocode}
%\usepackage{mdwlist}
\usepackage{enumitem}
\usepackage{listings}
\usepackage{booktabs}

我一追加

\usepackage{pgfplots}

我明白了:

(/usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty
(/usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg))
(/usr/share/texlive/texmf-dist/tex/latex/booktabs/booktabs.sty) (./pgfplots.sty
 (/usr/share/texlive/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex)
(/usr/share/texlive/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty
(/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
(/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.t
ex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
(/usr/share/texlive/texmf-dist/tex/latex/ms/everyshi.sty))
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex))
(/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
(/usr/share/texlive/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.t
ex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.de
f)))
(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.
tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.
tex)) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg))
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
! Missing \endcsname inserted.
<to be read again> 
                   \relax 
l.794 ...eoperator{||}{or}        {2}{infix} {200}

我的软件包坏了吗?我正在使用 Debian,如何重新安装它?我以前从未遇到过 pgfplots 的这个问题。

梅威瑟:

\documentclass[letterpaper,twocolumn,10pt]{article}
\usepackage{epsfig,endnotes}

\usepackage{endnotes,epsfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{url,color,fancyvrb}
\usepackage{times}
\usepackage{subfigure}
\usepackage{array}
\usepackage{xspace}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{program}
\usepackage[ruled]{algorithm2e}
\usepackage{algpseudocode}
%\usepackage{mdwlist}
\usepackage{enumitem}
\usepackage{listings}
\usepackage{booktabs}
\usepackage{pgfplots}


\begin{document}

\date{}

\title{\Large \bf Title}

\author{
\small ..
}
\maketitle
\thispagestyle{empty}

\section{bleh}
Something.
\end{document}

运行 $pdflatex mwe.tex 并出现同样的错误。

答案1

删除

\usepackage{program}

或者最后移动它,它会使之处于|活动状态,这将导致使用任何其他代码的问题|

请注意,您还应该删除epsfig(本世纪撰写的任何文档都不应使用该文档)。

相关内容