[Tex/LaTex] SF298 package giving undefined control sequence error

errorspackages

I am trying to use the SF298 package for latex and it gives an undefined control sequence error. The error is as follows:

! Undefined control sequence.
\ExecuteOptions ...eserved@a \CurrentOption \@nil
l.104 \ExecuteOptions{config,nofloatlongboxes}

The test latex file I am using is as follows:

\documentclass[titlepage]{article}
\usepackage{sf298}

\title{Test Title}
\author{author}

\ReportDate{10--06--1996}
\ReportType{Final}
\DatesCovered{1 June 1996 --- 31 May 1999}
\Title{Final Report Title}
\ContractNumber{DACA99--99--C--9999}
\Author{Uthor, Joe, A., and Ditor, Jane, E.}
\PerformingOrg{Test}
\SponsoringAgency{Test2}
\Abstract{Abstract}
\SubjectTerms{keywords; associated words; other words}
\AbstractLimitation{UU}
\ResponsiblePerson{Mr.\ Joe A. Uthor}
\RPTelephone{(412) 555--9999}

\begin{document}
  \maketitle

  \MakeRptDocPage

  \section{Introduction}     % section 1.1
  \subsection{History}       % subsection 1.1.1

  \section{Introduction}     % section 2.1
  \subsection{Usage}         % subsection 2.1.1

\end{document}

[David Carlisle]

the example can be reduced to

\begin{filecontents}{zz.sty}

  \usepackage{totpages}

\DeclareOption{config}{\def\sf@config{Y}}


\ExecuteOptions{config}
\end{filecontents}

\documentclass[titlepage]{article}
\usepackage{zz}

\stop

On the face of it, seems to be a bug in totpages or one of the packages it loads.

Best Answer

For some reasons, \CurrentOption is defined to expand \@nil and not to empty, as LaTeX expects.

This seems to ba a bug in totpages, which processes options in a personalized way.

The problem may be solved by loading totpages before any package that loads it and to add \def\CurrentOption{} after it.

\documentclass[titlepage]{article}

\usepackage{totpages}
\def\CurrentOption{} % fix bug in totpages

\usepackage{sf298}

In this way, sf298 will not load totpages again and the problem will not show.