用TexLive2021版成功,新版本编译则目录中作者的格式会出错

发布于 2025-10-03 11:26:44

https://www.latexstudio.net/index/details/index/mid/4546.html
网站上这个论文集模板编译失败!

用TexLive2021版成功,新版本编译则目录中作者的格式出错

Edited

MWE的压缩包👉 20250605173859.zip

查看更多

关注者
0
被浏览
246
2 个回答
Sagittarius Rover
Sagittarius Rover 2025-10-03
这家伙很懒,什么也没写!

P.S.你上面的提问内容意味着让「每一位潜在的回答者」都要花20积分下载,这会大大打击回答的热情,你显然应该上传文件。(帮你做了...)

注意,由于latexmk会同时进行多个操作,并不利于定位问题debug和简化问题,同时压缩包中包含的.latexmkrc命令默认的配置为pdflatex,这与模板不契合,且在这里恶行累累,做测试的时候务必不要使用这个.latexmkrc配置.(到底是哪里在流传这份.latemkrc配置...)

请说明你的两种情况下的编译命令,如有报错信息,也应该提供。由于链接中还包含了latexmkrc配置,使用latexmkxelatex编译在这个例子里是大不相同的.

  • 使用TL21编译成功
  • 使用新版本(具体是哪个版本),编译命令是?

Edited:

texpage平台使用xelatex测试的编译结果为:

TL21正常
TL22不正常
TL23不正常
TL24不正常
TL25不正常(不interrupt编译过程,但是编译效果也是不正确的)

Re-Edited:

Description

首先一个主要的观点是,conbine模块和combinet宏包已经和现在的latex2e内核格格不入,cfr在这里提到:

don't use combine with current latex.

combineCTAN主页上,这个包已经有十几年没有根据新的内核做适配和更新了...

This Package seems not to be maintaned anymore. It is not working with current distributions (since at least November 2020). See for instance the following comments on github: https://tex.stackexchange.com/questions/591145/extra-endgroup-error-when-using-the-combine-document-class

累累罪状

1.本问题OP遇到的\contentsline参数问题:

直接使用TL22及以上编译会得到如下错误:

LaTeX Error: Something's wrong--perhaps a missing \item.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.4 \contentsline
                  {coltocauthor}{\numberline {}钱学森 \hskip 1em\relax 乌家培}{8}
Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

可以看一下编译生成的main.toc文件:

% main.toc
\contentsline {coltoctitle}{\numberline {}组织管理的技术——系统工程}{1}
\contentsline {coltocauthor}{\numberline {}钱学森 \hskip 1em\relax 许国志 \hskip 1em\relax 王寿云}{1}
\contentsline {coltoctitle}{\numberline {}组织管理社会主义建设的技术——社会工程}{2}
\contentsline {coltocauthor}{\numberline {}钱学森 \hskip 1em\relax 乌家培}{2}
\contentsline {coltoctitle}{\numberline {}军事系统工程}{3}
\contentsline {coltocauthor}{\numberline {}钱学森 \hskip 1em\relax 王寿云 \hskip 1em\relax 柴本良}{3}

注意到这里的\contentsline只吞下3个参数:

  • {coltocauthor}
  • {\numberline {}钱学森 \hskip 1em\relax 乌家培}
  • {8}

而在source2e.pdf中提到,在2021-11以后,为了兼容hypperref\contentsline现在已经修改为四参数形式。这也正是在TL21之后不能正确编译的原因。

image.png

要想暂时patch这个问题也很简单,重新声明一个默认使用三参数(置第四个为空)的即可。

实现留做习题,读者自行实现不难🐶。

2.不能直接使用,需要对\begingroup做patch

这也正是上述模板中main.tex的Line20-22使用的patch:

\makeatletter
\let\document\c@ladocument\begingroup%
\makeatother

3.与fancyhdr的兼容性不好

参考链接:https://tex.stackexchange.com/a/348189/322482

\begin{papers}
\makeatletter\let\@makecol\latex@makecol\makeatother
\import{sub}
\end{papers}

4.与tikz/newtx/xcolor的兼容性同样不好

使用TL22及以上编译会得到:

! Undefined control sequence.
\set@color ...\@pdfcolorstack push{\current@color 
                                                  }\aftergroup \reset@color 
l.6 \end{document}

参考链接:https://tex.stackexchange.com/q/723346/322482


..

还有多少兼容性问题,需要多少patch呢?

一定非用这个combine不可吗?完全有很多方案实现类似的多个\maketitle的效果(^_^)建议不要再用这个模板,不要再用这个很久无人维护的文档类。

星空
星空 2025-10-03
这家伙很懒,什么也没写!

win11+TL2024+xelatex编译main.tex失败

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览