我在我的论文中使用 algorithm2e 包,并且由于某种原因,TexStudio 报告了 algorithm2e.sty 中的这 2 个警告,但没有任何消息或行号。
当我启用Issues and Log
选项卡来查看这些警告的来源时,它们似乎指向日志文件中以下输出中包含星号的行。
********************************************************
Package `algorithm2e' Release 5.0 -- january 06 2013 --
- [email protected] mailing list for announcement about releases
- [email protected] mailing list for discussion about package
subscribe by emailing [email protected] with 'subscribe <list> <firstname name>'
- Author: Christophe Fiorio ([email protected])
********************************************************
我不知道是否存在实际警告,或者只是 TexStudio 误解了这些。
这些警告实际上是从别处发出的吗?还是这只是 TexStudio 的误解?
答案1
该消息是由于以下几行引起的algorithm2e.sty
:
1214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% Main Part %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1215 %
1216 \newcommand{\algocf@name}{algorithm2e}%
1217 \newcommand{\algocf@date}{january 06 2013}%
1218 \newcommand{\algocf@version}{Release 5.0}%
1219 \newcommand{\algocf@id}{\algocf@version\space -- \algocf@date\space --}%
1220 \typeout{********************************************************^^JPackage `\algocf@name'\space\algocf@id^^J%
1221 - [email protected] mailing list for announcement about releases^^J%
1222 - [email protected] mailing list for discussion about package^^J%
1223 subscribe by emailing [email protected] with 'subscribe <list> <firstname name>'^^J%
1224 - Author: Christophe Fiorio ([email protected])^^J********************************************************}%
不幸的是,如果不修改软件包代码或者使用一些恶意的技巧,是不可能删除该消息的,比如
\let\latextypeout\typeout\def\typeout#1{}
\usepackage{algorithm2e}
\let\typeout\latextypeout
我不推荐。
代码应该改用\PackageInfo
:
\PackageInfo{algorithm2e}{%
********************************************************\MessageBreak
Package `\algocf@name'\space\algocf@id\MessageBreak
- [email protected] mailing list for announcement about releases\MessageBreak
- [email protected] mailing list for discussion about package\MessageBreak
subscribe by emailing [email protected] with 'subscribe <list> <firstname name>'\MessageBreak
- Author: Christophe Fiorio ([email protected])\MessageBreak
********************************************************%
}
这会将信息仅写入日志文件中而不是终端输出中,这似乎会使 TeXStudio 的解析器感到困惑。