3

I am trying to use the Computational Linguistic journal's latex template. In compiling their manual example "COLI-manual3.tex" I get the following: ! Extra \endgroup. \document ->\endgroup \ifx @unusedoptionlist @empty \else @latex@warning@... l.27 \begin{document}

Here I report a simpler code example:

\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}

Does anyone know how to fix it?

Thanks

1
  • 2
    I can reproduce the error with TeX Live 2021, but it works without errors using TeX Live 2020 or before. So as a workaround you could compile your paper using an older version or by switching on backwards compatibility with \RequirePackage[2019/01/01]{latexrelease} as the first line in your .tex file (of course you can adjust the date if needed).
    – Marijn
    Commented Dec 18, 2021 at 16:42

2 Answers 2

3

The clv3.cls redefines \document and \enddocument to make a few additions, which can be better done with standard hooks.

% 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}

The output is the same as with the document compiled without the additional compatibility code through TeX Live 2019.

I guess that the query stuff is for interaction with the authors during the preparatory phase. The only part that's actually used is the printing of the biography material.

0

Thanks @Marjin for your suggestion. It worked for me!

Anyway, I have walked around the problem by eliminating the following from the 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}
%
1
  • Welcome to TeX.SE! Do not change an original class file!
    – Mensch
    Commented Dec 20, 2021 at 15:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .