I've been typesetting a competition paper using the exam class, which has options for nice headers and cover pages.
Now, this competition has two different age categories, 'Junior' and 'Senior', and three different rounds: 'MCQ', 'Team', and 'Observation'. I'd like the title page and the headers to all reflect any one of the six resulting combinations by specifying options to a command, in the manner of key-value pairs. For instance, \setcatround[category=jnr, round=mcq] should set these variables appropriately, and these should be reflected in both the header and the title/cover page of the exam.
I have selected pgfkeys as my key-value package of choice. I passed over keyval, xkeyval, and kvoptions, because I find their syntax to be particularly esoteric compared to the relative straightforwardness of pgfkeys. Furthermore, Mr Wright (of siunitx fame) recommends pgfkeys or l3keys versus the others, here.
An M(N)WE [minimum (not) working example]:
\documentclass{exam}
\usepackage{pgfkeys}
\pgfkeys{
/ac/.is family, /ac,
category/.estore in = \category,
round/.estore in = \round
}
\newcommand*{\setcatround}[1]{\pgfqkeys{/ac}{#1}}
\setcatround{category=senior, round=mcq}
\header{My Exam}{}{\category{} \round{} Round}
\title{Competition}
\begin{document}
\maketitle
\centering
\LARGE{\category{} \round{} Round}
\thispagestyle{headandfoot}
\end{document}
Now, this MWE works okay, but my idea was to:
Print the competition Category And Round In Title Case, like so:
Junior MCQ Round, orSenior Team Round;Print the category and round together using only one command; for instance,
\catround{}should yieldJunior MCQ Roundwhen the appropriate options are set with\setcatround{...};Allow users to specify either of
jnr/junior, orsnr/seniorand output the appropriate results.
How might I go about specifying these, and possibly make it easily extensible for any future additions?
