gi-ev / LNI

A LaTeX class for submissions to the “Lecture Notes in Informatics” (LNI) published by the German “Gesellschaft für Informatik” (GI)
https://www.ctan.org/pkg/lni
LaTeX Project Public License v1.3c
40 stars 33 forks source link

unknown option causes "Argument of \@iforloop has an extra }" #78

Closed muelli closed 5 years ago

muelli commented 5 years ago

I have a trivial document:

\documentclass[utf8,foo]{lni}
\begin{document}
    foo
\end{document}

and the unknown option causes havoc:

latexmk -pdf lni-author-template.tex
Latexmk: This is Latexmk, John Collins, 16 May 2017, version: 4.53a.
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': File changes, etc:
   Changed files, or newly in use since previous run(s):
      'lni-author-template.tex'
   Non-existent destination files:
      'lni-author-template.pdf'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -recorder  "lni-author-template.tex"'
------------
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./lni-author-template.tex
LaTeX2e <2017-04-15>
Babel <3.18> and hyphenation patterns for 38 language(s) loaded.
(./lni.cls
Document Class: lni 2019/04/18 v1.6BETA Official class for submissions to the `
`Lecture Notes in Informatics''
! Argument of \@iforloop has an extra }.
<inserted text> 
                \par 
l.62 \ProcessOptions\relax

?  
Runaway argument?
\on@line .
! Paragraph ended before \@iforloop was complete.
<to be read again> 
                   \par 
l.62 \ProcessOptions\relax

? 

Class Option `foo` is not supported! Warning: \par 
! Undefined control sequence.
<argument> \@nil 
                 ,\@nil 
l.62 \ProcessOptions\relax

? 

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.62 \ProcessOptions\relax

? 
! Undefined control sequence.
<argument> \@nil ,\@nil 

l.62 \ProcessOptions\relax

? 
! Undefined control sequence.
\@forloop ...fx #4\@nnil \else #5\@iforloop #3\@@ 
                                                  #4{#5}\fi \fi 
l.62 \ProcessOptions\relax

? 
! Argument of \ClassWarning has an extra }.
<inserted text> 
                \par 
l.62 \ProcessOptions\relax

? 
Runaway argument?
! Paragraph ended before \ClassWarning was complete.
<to be read again> 
                   \par 
l.62 \ProcessOptions\relax

? 

Overfull \hbox (20.0pt too wide) in paragraph at lines 62--62
[] 

That's very unfortunate, because I would like to use final or draft globally for other packages I'm using, e.g. todonotes. Now I can't use final, because then the class chokes.

sieversMartin commented 5 years ago

Thanks for the report. I will fix that next week.

sieversMartin commented 5 years ago

It has to be DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}

muelli commented 5 years ago

FWIW: It seem that this change makes it work for me:

diff --git a/lni.cls b/lni.cls
index d352582..302801f 100644
--- a/lni.cls
+++ b/lni.cls
@@ -51,7 +51,8 @@
 \nofontsfalse
 \DeclareOption{nofonts}{\nofontstrue}
 \ExecuteOptions{utf8}
-\DeclareOption*{\ClassWarning{Option `\CurrentOption` is not supported!}}
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
+% \DeclareOption*{\ClassWarning{Option `\CurrentOption` is not supported!}}
 \ProcessOptions\relax
 \RequirePackage{iftex}
 \ifPDFTeX
sieversMartin commented 5 years ago

Well yes, that's what I meant in my comment.