%% This package formats student papers for
%% Harvard Math 126, Fall 1998
%%
%% by Nils Barth
%% nbarth@fas.harvard.edu
%%
%% Please excuse the following comments; .dtx would be better,
%% but I'd have to learn it.
%% For more information on writing class files in LaTeX, see
%% http://www.tifr.res.in/~space/LaTeX/guides/clsguide.html

%% First, say which version of TeX to use.
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
%% This is a class file, so give its name and description
\ProvidesClass{126-pap}[1998/12/16 Harvard Math 126 -- Student Papers]

% --------------------------------------------------------------------
%%% Options
%% We begin by declaring the options.
%% For instance, if someone wants to use Black Board Bold
%% in their paper, they can write:
%% \documentclass[bbb]{126-pap}

% Euler -- to use Euler math font
%%%%% Note: fix this so that it uses Concrete Roman
%%%%% for running text.
\DeclareOption{euler}{\AtEndOfClass{\RequirePackage{euler}}}

% Black Board Bold
\DeclareOption{bbb}{\renewcommand{\mathbf}{\mathbb}}
% --------------------------------------------------------------------

%%% Pass options to amsart, and load amsart
%% Here we pass the remaining options to AMS article,
%% the class on which 126-pap is based (so I don't need
%% to reinvent the wheel and drive train etc. when I only
%% want to change the dashboard layout, to slaughter a metaphor)
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{amsart}}
\ProcessOptions
\LoadClass[oneside]{amsart}

%% This is so that people can write \day31\month2\year1967
%% and have the date displayed as the country desires,
%% rather than February 31, 1967 or 31 February 1967 or whatever.
\date{\today}

%% This automatically uses 126-srcs.bib as the bibliography,
%% and formats it as amsplain
\AtEndDocument{\bibliographystyle{amsplain}%
  \bibliography{126-srcs}}

%% These are included for:
%% float -- nice floating figures, like character tables
%% amssymb -- a few weird symbols, like \nexists, \nsubseteq, etc.
%% amsthm -- Theorems, lemmata, etc.
\RequirePackage{float, amssymb, amsthm}

%% These are my own formating for character tables.
%%% Character tables
\floatstyle{plain}
\newfloat{CharTable}{ht}{aux}
\floatname{CharTable}{\textsc{Character Table}}

%% This was in case people had lots of character tables and
%% wanted to number them within each section.
% Note: Add the following if you want numbering within.
% \numberwithin{CharTable}{section}
% \numberwithin{equation}{section}

%% To get good spacing in a table, you should write:
%% $\SP 1$ \\ $-1$ \\ etc. (to get quasi right-justification)
%% or
%% $1$ \\ $-1\SP$ \\ etc. (to get centering)
%% (okay, so I'm _really_ picky).
% Use \SP to get correct spacing for negative signs
\newlength{\negativesign}
\settowidth{\negativesign}{$-$}
\newcommand{\SP}{\hspace{\negativesign}}

%% This sets operators as if they were \sin, \log, etc.
%%% Operators
\DeclareMathOperator{\Hom}{Hom}         % Homomorphisms
\DeclareMathOperator{\Aut}{Aut}         % Automorphisms
\DeclareMathOperator{\End}{End}         % Endomorphisms

\DeclareMathOperator{\Res}{Res}         % Restriction
\DeclareMathOperator{\Ind}{Ind}         % Induced

\DeclareMathOperator{\tr}{tr}           % Trace
\DeclareMathOperator{\sgn}{sgn}         % Sign

%% This is so that all normal subgroups are set the same way
% Normal subgroup
\newcommand{\normsub}{\vartriangleleft}
\newcommand{\subnorm}{\vartriangleright}

%% Normally you might use | or \vert for divides -- but
%% TeX doesn't know a priori that this is a binary operator,
%% so certain things go wrong. For instance, if you write
%% a|\dots|b, the \dots will be \ldots, not \dotsb. This fixes that.
%% Also, you really should say \divides when you mean \divides, not
%% |a| or f|_{x=0} etc. (horrors!)
% Divides
\DeclareMathSymbol{\divides}{\mathbin}{symbols}{"6A}

%% This is so you can write \set{a, b, c} instead of
%% \left\{a, b, c\right\} and so forth -- it's _much_
%% nicer and easier to read, and even pretty standard.
%%% Delimiters
\newcommand{\set}[1]{\left\{#1\right\}}
\newcommand{\seq}[1]{\left<#1\right>}
\newcommand{\abs}[1]{\left\lvert#1\right\rvert}
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}

%% AMS-LaTeX includes bmatrix, pmatrix, etc. environments,
%% but doesn't do the same for small matricies. I fix that here.
%%% Small matricies
\newenvironment{psmallmatrix}
{\left(\begin{smallmatrix}}
{\end{smallmatrix}\right)}
\newenvironment{bsmallmatrix}
{\left[\begin{smallmatrix}}
{\end{smallmatrix}\right]}
\newenvironment{Bsmallmatrix}
{\left\{\begin{smallmatrix}}
{\end{smallmatrix}\right\}}
\newenvironment{vsmallmatrix}
{\left\lvert\begin{smallmatrix}}
{\end{smallmatrix}\right\rvert}
\newenvironment{Vsmallmatrix}
{\left\lVert\begin{smallmatrix}}
{\end{smallmatrix}\right\rVert}

%% This allows you to write \begin{thm}...\end{thm}
%% to set theorems etc., and numbers them as
%% Lemma 2.1, Theorem 2.2, Corollary 2.3, etc.
%%% Theorems
% Theorems and related are numbered together, within section
\theoremstyle{plain}
\newtheorem{thm}{Theorem}[section]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{cor}[thm]{Corollary}

%% Definitions aren't usually numbered (much as I like to number them).
\theoremstyle{definition}
\newtheorem*{defn}{Definition}

%% AMS-LaTeX comes with \eqref as a nice way of referencing equations;
%% this does the same for theorems etc.
% Referencing
\newcommand{\thmref}[1]{Theorem~\ref{#1}}
\newcommand{\lemref}[1]{Lemma~\ref{#1}}
\newcommand{\propref}[1]{Proposition~\ref{#1}}
\newcommand{\corref}[1]{Corollary~\ref{#1}}

%% This is just a list of definitions, so you can write
%% \fA for a Fraktur A etc. I don't use the usual \C, \R etc.
%% for bold C, bold R etc. because of conflicts for O, P, S
%% (and maybe some others).
%%% Alphabets
%%% Bold Face
\newcommand{\bA}{{\mathbf A}}
\newcommand{\bB}{{\mathbf B}}
\newcommand{\bC}{{\mathbf C}}
\newcommand{\bD}{{\mathbf D}}
\newcommand{\bE}{{\mathbf E}}
\newcommand{\bF}{{\mathbf F}}
\newcommand{\bG}{{\mathbf G}}
\newcommand{\bH}{{\mathbf H}}
\newcommand{\bI}{{\mathbf I}}
\newcommand{\bJ}{{\mathbf J}}
\newcommand{\bK}{{\mathbf K}}
\newcommand{\bL}{{\mathbf L}}
\newcommand{\bM}{{\mathbf M}}
\newcommand{\bN}{{\mathbf N}}
\newcommand{\bO}{{\mathbf O}}
\newcommand{\bP}{{\mathbf P}}
\newcommand{\bQ}{{\mathbf Q}}
\newcommand{\bR}{{\mathbf R}}
\newcommand{\bS}{{\mathbf S}}
\newcommand{\bT}{{\mathbf T}}
\newcommand{\bU}{{\mathbf U}}
\newcommand{\bV}{{\mathbf V}}
\newcommand{\bW}{{\mathbf W}}
\newcommand{\bX}{{\mathbf X}}
\newcommand{\bY}{{\mathbf Y}}
\newcommand{\bZ}{{\mathbf Z}}

%%% Caligraphic
\newcommand{\cA}{{\mathcal A}}
\newcommand{\cB}{{\mathcal B}}
\newcommand{\cC}{{\mathcal C}}
\newcommand{\cD}{{\mathcal D}}
\newcommand{\cE}{{\mathcal E}}
\newcommand{\cF}{{\mathcal F}}
\newcommand{\cG}{{\mathcal G}}
\newcommand{\cH}{{\mathcal H}}
\newcommand{\cI}{{\mathcal I}}
\newcommand{\cJ}{{\mathcal J}}
\newcommand{\cK}{{\mathcal K}}
\newcommand{\cL}{{\mathcal L}}
\newcommand{\cM}{{\mathcal M}}
\newcommand{\cN}{{\mathcal N}}
\newcommand{\cO}{{\mathcal O}}
\newcommand{\cP}{{\mathcal P}}
\newcommand{\cQ}{{\mathcal Q}}
\newcommand{\cR}{{\mathcal R}}
\newcommand{\cS}{{\mathcal S}}
\newcommand{\cT}{{\mathcal T}}
\newcommand{\cU}{{\mathcal U}}
\newcommand{\cV}{{\mathcal V}}
\newcommand{\cW}{{\mathcal W}}
\newcommand{\cX}{{\mathcal X}}
\newcommand{\cY}{{\mathcal Y}}
\newcommand{\cZ}{{\mathcal Z}}

%%% Fraktur
\newcommand{\fA}{{\mathfrak A}}
\newcommand{\fB}{{\mathfrak B}}
\newcommand{\fC}{{\mathfrak C}}
\newcommand{\fD}{{\mathfrak D}}
\newcommand{\fE}{{\mathfrak E}}
\newcommand{\fF}{{\mathfrak F}}
\newcommand{\fG}{{\mathfrak G}}
\newcommand{\fH}{{\mathfrak H}}
\newcommand{\fI}{{\mathfrak I}}
\newcommand{\fJ}{{\mathfrak J}}
\newcommand{\fK}{{\mathfrak K}}
\newcommand{\fL}{{\mathfrak L}}
\newcommand{\fM}{{\mathfrak M}}
\newcommand{\fN}{{\mathfrak N}}
\newcommand{\fO}{{\mathfrak O}}
\newcommand{\fP}{{\mathfrak P}}
\newcommand{\fQ}{{\mathfrak Q}}
\newcommand{\fR}{{\mathfrak R}}
\newcommand{\fS}{{\mathfrak S}}
\newcommand{\fT}{{\mathfrak T}}
\newcommand{\fU}{{\mathfrak U}}
\newcommand{\fV}{{\mathfrak V}}
\newcommand{\fW}{{\mathfrak W}}
\newcommand{\fX}{{\mathfrak X}}
\newcommand{\fY}{{\mathfrak Y}}
\newcommand{\fZ}{{\mathfrak Z}}
