% qbq2latex Created by Dan Schafer & Evan Silberman, 2006,
% Part of the ItALX project.

% Version 0.1 - Initial Public Release

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This file is part of the ItALX Project.
%
% ItALX is free software; you can redistribute it and/or modify
% it under the terms of the GNU Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
% 
% ItALX is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
% 
% You should have recieved a copy of the GNU General Public License
% along with ItALX; if not, write to the Free Software
% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{quizbowl}[2006/05/31 Typeset quiz bowl questions]

\LoadClass{article}

\RequirePackage{fullpage}
\RequirePackage{ifthen}

\newcounter{tnum}
\setcounter{tnum}{1}

\newcounter{bnum}
\setcounter{bnum}{1}

\newcommand{\tossup}[2]{}
\newenvironment{bonus}[1]{}{}
\newcommand{\bonusquestion}[2]{}
\newcommand{\bonusanswer}[2]{}
\newcommand{\listitem}[1]{}
\newcommand{\req}[1]{}
\newcommand{\pguide}[1]{}
\newcommand{\halftime}[1]{}
\newcommand{\powermark}{}

\DeclareOption{tjiat}{\tjiatformatting}

\newcommand{\tjiatformatting}
{
	\setlength{\parindent}{.25in}
	\ifthenelse{\isundefined{\bonuscolwidth}}{\newlength{\bonuscolwidth}}{\setlength{\bonuscolwidth}{0pt}}
	\addtolength{\bonuscolwidth}{\textwidth}
	\addtolength{\bonuscolwidth}{-2\parindent}
	
	\renewcommand{\maketitle}{
		\begin{titlepage}
			\begin{center}
				\textsc{\Huge{\@title}}
			\end{center}
		\end{titlepage}
	}
	
	\renewcommand{\tossup}[2]{
		\noindent \begin{minipage}{\textwidth}
			\setlength{\parindent}{.25in}
			\noindent TOSSUP \arabic{tnum} \newline
			##1 \newline
			\indent \indent \textbf{##2} \newline
		\end{minipage}
		\addtocounter{tnum}{1}
	}
	
	\renewenvironment{bonus}[1]{
		\noindent BONUS \arabic{bnum} \newline
		##1 \newline
		\begin{tabular}{p{\parindent}p{\bonuscolwidth}}
	}
	{
		\end{tabular}
		\newline \newline
		\addtocounter{bnum}{1}
	}
	
	\renewcommand{\bonusquestion}[2]{
		\\
		##1: & ##2 \\
	}
	
	\renewcommand{\bonusanswer}[1]{
		& \textbf{##1} \\
	}
	
	\renewcommand{\listitem}[1]{
		& \textbf{##1} \\
	}
	
	\renewcommand{\req}[1]{\underline{##1}}
	
	\renewcommand{\pguide}[1]{[\textit{##1}]}
	
	\renewcommand{\halftime}{
		\begin{center}
			\textsc{\Huge{Halftime}}
		\end{center}
	}	
}


\ProcessOptions

