2

I'm trying to write a package for personal use that takes custom arguments as follows:

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ZTPS}[2014/15/10 v1.0 Zach Taylor Problem Set]

\RequirePackage[margin=1in]{geometry} % Put BEFORE fancyheader!
\RequirePackage{datetime}
\RequirePackage{fancyhdr}
\pagestyle{fancy}

\usdate

\usepackage{kvoptions}

\DeclareStringOption [Zachary Taylor]{name}
\DeclareStringOption [\today]{date}
\DeclareStringOption [MTH 265]{course}
\DeclareStringOption [Untitled]{title}

\lhead{\ztps@name}
\chead{\ztps@course}
\rhead{\ztps@date}

\title{\ztps@title}
\author{\ztps@name}
\date{\ztps@date}
...

If I invoke it as follows, everything works fine and the header/footer include the default option values (My name, "MTH 265", and the date.):

\documentclass[14]{Article}

\usepackage{ztps}

\begin{document}

test

\end{document} 

However, if I try:

\documentclass[14]{Article}

\usepackage[name=test]{ztps}

\begin{document}

test

\end{document} 

I get

"Unknown Option: 'name=test' for package 'zpts'".

If I just put [name] I get the same error

"Unknown Option: 'name' for package 'zpts'".

I'm probably missing something simple but I've searched extensively and can't find it.

2
  • 2
    I don't see a line to process options in your short demo file: we'll need to see that. Also (not linked to the issue): you've got \ProvidesClass but the code seems to be a package, which should be corrected.
    – Joseph Wright
    Commented Oct 15, 2014 at 7:40
  • That turned out to be my problem, actually-- thanks for pointing it out. Commented Oct 19, 2014 at 10:08

1 Answer 1

2

Options are processed (by kvoptions) only when you give the command

\ProcessKeyvalOptions

which is missing in your input. As such, whilst you've declared lots of options none of them are ever 'activated'.

0

You must log in to answer this question.

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