CPC模板改变了 的定义\@pushfilename
,因此与 不兼容hypperref
。
现在我已经找到问题所在,我无法对模板文件进行任何更改。(在最小示例中,它被 . 包围% I cannot change the ... code
。)因此我必须通过它外面的命令来完成错误修复。
我能完成这个任务吗?或者这是一个不可能完成的任务?
就我所努力而言,最接近的问题是Latex 连续表格编号和 \tbl 宏。(希望可以帮到你。)
这是一个最小的例子,我已经将类内容移到了主文件中:
%% This is file `cpc.cls'
%% Version 1.0
%% CUP Journal - Combinatorics, Probability and Computing (CPC) document class
%% Copyright 2018 Cambridge University Press
% \NeedsTeXFormat{LaTeX2e}
% \ProvidesClass{cpc}[2020/04/17 v1.0 CUP CPC LaTeX document class]
% This is file `cpcguide.tex`
% v1.0, released 31 Jan 2019
% Copyright 2019 Cambridge University Press
% I cannot change the following code
\documentclass{article}
\makeatletter
\def\@pushfilename{%
\xdef\@currnamestack{%
{\@currname}%
{\@currext}%
{\the\catcode`\@}%
\@currnamestack}}%
\makeatother
\usepackage{hyperref}
% I cannot change the above code
\begin{document}
hello
\end{document}
这是编译日志(仅复制前 6 个错误。)
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.11.4) 9 NOV 2022 19:29
entering extended mode
%&-line parsing enabled.
**CPCguide.tex
(./CPCguide.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-24> (/usr/local/texlive/2022/texmf-dist/tex/latex
/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@section=\count186
\c@subsection=\count187
\c@subsubsection=\count188
\c@paragraph=\count189
\c@subparagraph=\count190
\c@figure=\count191
\c@table=\count192
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
) (/usr/local/texlive/2022/texmf-dist/tex/latex/hyperref/hyperref.sty
Package: hyperref 2022-02-21 v7.00n Hypertext links for LaTeX
(/usr/local/texlive/2022/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty
Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
)
! LaTeX hooks Error: Extra \PopDefaultHookLabel.
(hooks) This command will be ignored.
Type <return> to continue.
...
l.107 \RequirePackage{ltxcmds}[2010/11/12]
LaTeX does not know anything more about this error, sorry.
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! Undefined control sequence.
\GenericError ...
#4 \errhelp \@err@ ...
l.175 \def\Hy@@VersionCheck #1#2 #3 #4\@nil
{%
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GenericError ...
\let \@err@ ...
l.175 \def\Hy@@VersionCheck #1#2 #3 #4\@nil
{%
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GenericError ...
\@empty \def \MessageBreak...
l.175 \def\Hy@@VersionCheck #1#2 #3 #4\@nil
{%
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GenericError ...
\endgroup
l.175 \def\Hy@@VersionCheck #1#2 #3 #4\@nil
{%
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GenericError ...
#4 \errhelp \@err@ ...
l.175 \def\Hy@@VersionCheck #1#2 #3 #4\@nil
{%
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
<Some lines are omitted here since the log is too long.>
........................
........................
........................
<Some lines are omitted here since the log is too long.>
(That makes 100 errors; please try again.)
Here is how much of TeX's memory you used:
5680 strings out of 478268
85445 string characters out of 5846353
371147 words of memory out of 5000000
23901 multiletter control sequences out of 15000+600000
469259 words of font info for 28 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
63i,0n,84p,189b,44s stack positions out of 10000i,1000n,20000p,200000b,200000s
! ==> Fatal error occurred, no output PDF file produced!