我正在尝试使用计算语言学期刊的 latex 模板。在编译他们的手册示例“COLI-manual3.tex”时,我得到以下内容:!额外的\endgroup。\document ->\endgroup \ifx @unusedoptionlist @empty \else @latex@warning@... l.27 \begin{document}
这里我报告一个更简单的代码示例:
\documentclass{clv3}
\usepackage{hyperref}
\usepackage{xcolor}
\definecolor{darkblue}{rgb}{0, 0, 0.5}
\hypersetup{colorlinks=true,citecolor=darkblue, linkcolor=darkblue, urlcolor=darkblue}
\bibliographystyle{compling}
% test compatibility with algorithmic.sty
%\usepackage{algorithmic}
\issue{1}{1}{2016}
%Document Head
\dochead{CLV3 Class File Manual}
\runningtitle{How to Use CLV3 \LaTeX\ Class File}
\runningauthor{Odi\'e N. Gementera}
\begin{document}
\end{document}
有谁知道如何修理它?
谢谢
答案1
重新clv3.cls
定义\document
并\enddocument
做了一些补充,用标准钩子可以更好地完成。
% save the kernel \document and \enddocument
\let\latexdocument\document
\let\latexenddocument\enddocument
%%%
\documentclass{clv3}
% restore the original
\let\document\latexdocument
\let\enddocument\latexenddocument
% add to the standard hooks
\makeatletter
\AtBeginDocument{%
\if@filesw
\immediate\openout\@mainqry=\jobname.qry
\fi
}
\AtEndDocument{%
\ifx\@biography\@empty\else{\par\ifbrief\vskip10pt\fi\biofont\noindent\@biography\par}\fi
\immediate\closeout\@mainqry
%\ifquery
% \process@queries\clearpage
%\else
\ifodd\c@page\clearpage\thispagestyle{empty}\null\clearpage\else\clearpage\fi
%\fi
%\ifquery\clearpage\else\ifodd\c@page\clearpage\thispagestyle{empty}\null\clearpage\else\clearpage\fi\fi
}
\makeatother
\usepackage{xcolor}
\usepackage{hyperref}
\definecolor{darkblue}{rgb}{0, 0, 0.5}
\hypersetup{colorlinks=true,citecolor=darkblue, linkcolor=darkblue, urlcolor=darkblue}
\bibliographystyle{compling}
% test compatibility with algorithmic.sty
%\usepackage{algorithmic}
\issue{1}{1}{2016}
%Document Head
\dochead{CLV3 Class File Manual}
\runningtitle{How to Use CLV3 \LaTeX\ Class File}
\runningauthor{Odi\'e N. Gementera}
\biography{Some data}
\begin{document}
Text for the document
\end{document}
输出与通过 TeX Live 2019 编译的未添加附加兼容性代码的文档相同。
我猜这些query
东西是为了在准备阶段与作者互动。唯一真正用到的部分是打印传记材料。
答案2
感谢@Marjin 的建议。它对我有用!
无论如何,我已经通过从 clv3.cls 中删除以下内容解决了该问题。
%%%%%%%%%%%%%%%%%%%%%%%%%%%% Document & End Document %%%%%%%%%%%%%%%%%%%%%
%
%\def\@watermark{\offinterlineskip\vbox to 0pt{\setlength\overfullrule{0pt}\vskip12pc\hskip2pc\begin{turn}{45}\hbox to \textheight{\hss\grayColor{{\sffamily\fontsize{107.5}{107.5pt}\selectfont\bfseries spi}\hskip16pt\raise10pt\hbox{\sffamily\fontsize{50}{50}\selectfont\bfseries publisher services}}\hss}\end{turn}}\vskip0pt}
%
\def\@questionmark{\vbox to 0pt{\vskip13pc\hskip-5pc
\hbox to \textwidth{\fontsize{570}{570}\selectfont ?\hss}}}
\def\questionmark#1{\xdef\@questionmark{#1}}%
%
%\def\draftnote{\vbox to 0pt{\offinterlineskip%
%\hbox to \trimwidth{\hfill\footnotesize\jobname\vphantom{q}\qquad\today\qquad\currenttime\hfill}\par\@questionmark}}%
%
\def\document{\endgroup
\ifx\@unusedoptionlist\@empty\else
\@latex@warning@no@line{Unused global option(s):^^J%
\@spaces[\@unusedoptionlist]}%
\fi
\@colht\textheight
\@colroom\textheight \vsize\textheight
\columnwidth\textwidth
\@clubpenalty\clubpenalty
\if@twocolumn
\advance\columnwidth -\columnsep
\divide\columnwidth\tw@ \hsize\columnwidth \@firstcolumntrue
\fi
\hsize\columnwidth \linewidth\hsize
\begingroup\@floatplacement\@dblfloatplacement
\makeatletter\let\@writefile\@gobbletwo
\global \let \@multiplelabels \relax
\@input{\jobname.aux}%
\endgroup
\if@filesw
\immediate\openout\@mainaux\jobname.aux
\immediate\openout\@mainqry=\jobname.qry
\immediate\write\@mainaux{\relax}%
\fi
\process@table
\let\glb@currsize\@empty %% Force math initialisation.
\normalsize
\everypar{}%
\@noskipsecfalse
\let \@refundefined \relax
\let\AtBeginDocument\@firstofone
\@begindocumenthook
\ifdim\topskip<1sp\global\topskip 1sp\relax\fi
\global\@maxdepth\maxdepth
\global\let\@begindocumenthook\@undefined
\ifx\@listfiles\@undefined
\global\let\@filelist\relax
\global\let\@addtofilelist\@gobble
\fi
\gdef\do##1{\global\let ##1\@notprerr}%
\@preamblecmds
\global\let \@nodocument \relax
\global\let\do\noexpand
\ignorespaces}
%
\def\enddocument{%
\ifx\@biography\@empty\else{\par\ifbrief\vskip10pt\fi\biofont\noindent\@biography\par}\fi
\@enddocumenthook
\@checkend{document}%
\immediate\closeout\@mainqry
%\ifquery
% \process@queries\clearpage
%\else
\ifodd\c@page\clearpage\thispagestyle{empty}\null\clearpage\else\clearpage\fi
%\fi
% \ifquery\clearpage\else\ifodd\c@page\clearpage\thispagestyle{empty}\null\clearpage\else\clearpage\fi\fi
\begingroup
\if@filesw
\immediate\write\@mainaux{\string\questionmark{}}%
\immediate\closeout\@mainaux
\let\@setckpt\@gobbletwo
\let\@newl@bel\@testdef
\@tempswafalse
\makeatletter \input\jobname.aux
\fi
\@dofilelist
\ifdim \font@submax >\fontsubfuzz\relax
\@font@warning{Size substitutions with differences\MessageBreak
up to \font@submax\space have occured.\@gobbletwo}%
\fi
\@defaultsubs
\@refundefined
\if@filesw
\ifx \@multiplelabels \relax
\if@tempswa
\@latex@warning@no@line{Label(s) may have changed.
Rerun to get cross-references right}%
\fi
\else
\@multiplelabels
\fi
\fi
\endgroup
\deadcycles\z@\@@end}
%