1

Possible Duplicate:
Spaces in pfgopts options

I have read Joseph Wright's excellent article on key-value systems, as well as questions on this site about how to pass arguments to class options. My understanding is that key names used to pass arguments to classes or packages must not have any spaces. (I'm just getting familiar with the key value systems).

But how about key values? I'm trying to create a class based on the exam class, but specific to my university. I'd like to be able to include arguments with spaces in the values, and (maybe I'm reading this wrong) it's not clear to me why this doesn't work

 \RequirePackage{filecontents}
 \begin{filecontents}{nusexam.cls}
 \ProvidesClass{nusexam}[18/12/12]
 \RequirePackage {pgfopts}
 \def\module@name {{\color {red} NO NAME}}
 \pgfkeys{
  /module/.cd,
    module-name/.store in=\module@name
  }
 \ProcessPgfOptions{/module}
 \DeclareOption*{%                                                                                                 
   \PassOptionsToClass{\CurrentOption}{exam}%                                                                   
 } 
 \ProcessOptions\relax
 \LoadClass [a4paper] {exam}
 \renewcommand{\maketitle}{
   \begin{center}
     \Large
     An exam cover sheet 

     Module: \textbf {\module@name}
   \end{center}
   \vspace {2in} %% normally this would be a \clearpage
 }
 \end{filecontents}

 \documentclass[module-name=A course with spaces in the name]{nusexam}

 \begin{document}
 \maketitle
 now we start with the questions
 \end{document}
GTK
  • 1,510

0 Answers0