% HMC Math dept HW class file
% v0.04 by Eric J. Malm, 10 Mar 2005
% Custom commands added by Liz Fedak, 2015
%%% IDENTIFICATION --------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}[1995/01/01]
\ProvidesClass{lizpset}
    [2005/03/10 v0.04 HMC Math Dept problem set class]

%%% INITIAL CODE ----------------------------------------------------------

% test whether the document is being compiled with PDFTeX
\RequirePackage{ifpdf}


%%% DECLARATION OF OPTIONS ------------------------------------------------
%% Header Options: header*, no header
\newif\ifhmcpset@header

% no header block in upper right hand corner
\DeclareOption{noheader}{%
    \hmcpset@headerfalse%
}

% do print header block
\DeclareOption{header}{%
    \hmcpset@headertrue%
}

%% Font Options: palatino*, cm
\newif\ifhmcpset@palatino

% use palatino fonts
\DeclareOption{palatino}{%
    \hmcpset@palatinotrue%
}

% use compuer modern fonts
\DeclareOption{cm}{%
    \hmcpset@palatinofalse%
}

%% Problem Boxing: boxed*, unboxed
\newif\ifhmcpset@boxed

% box problem statements
\DeclareOption{boxed}{%
    \hmcpset@boxedtrue%
}
   
% don't box problem statements
\DeclareOption{unboxed}{%
    \hmcpset@boxedfalse%
}
   
% pass remaining options to article class
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}

%%% EXECUTION OF OPTIONS --------------------------------------------------
%% default to:
% including header, 
% loading mathpazo package for palatino fonts,
% boxing problem statements
\ExecuteOptions{header,palatino,boxed}

\ProcessOptions

%%% PACKAGE LOADING -------------------------------------------------------
%% based on std article class
\LoadClass{article}


%% Font loading: Palatino text/math fonts
\ifhmcpset@palatino
    \RequirePackage{mathpazo}
\fi

%% AMSLaTeX math environments and symbols
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{txfonts}

%% boxed minipage for boxed problem environment
\RequirePackage{boxedminipage}

%%% MAIN CODE -------------------------------------------------------------
%% Tell dvips/pdflatex correct page size
\ifpdf
  \AtBeginDocument{%
    \setlength{\pdfpageheight}{\paperheight}%
    \setlength{\pdfpagewidth}{\paperwidth}%
  }
\else
  \AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}%
\fi


%% Problem set environments
% boxed problem environment
\newenvironment{problem}[1][]{%
  \ifhmcpset@boxed\def\hmcpset@probenv{boxed}\else\def\hmcpset@probenv{}\fi%
  \bigskip% put space before problem statement box %
  \noindent\begin{\hmcpset@probenv minipage}{\columnwidth}%
  \def\@tempa{#1}%
  \ifx\@tempa\empty\else%
    \hmcpset@probformat{#1}\hspace{0.5em}%
  \fi%
}{%
  \end{\hmcpset@probenv minipage}%
}
% display optional argument to problem in bold
\let\hmcpset@probformat\textbf

% solution environment with endmark and optional argument
\newenvironment{solution}[1][]{%
  \begin{trivlist}%
  \def\@tempa{#1}%
  \ifx\@tempa\empty%
    \item[]%
  \else%
    \item[\hskip\labelsep\relax #1]%
  \fi%
}{%
  \mbox{}\penalty10000\hfill\hmcpset@endmark%
  \end{trivlist}%
}

% endmark is a heeeeart
\def\hmcpset@endmark{\ensuremath{\varheartsuit}}

%% Problem set list, for top of document
\newcommand{\problemlist}[1]{\begin{center}\large\sffamily{#1}\end{center}}

%% commands for upper-right id header block
\newcommand{\headerblock}{%
\begin{flushright}
\mbox{\hmcpset@name}\protect\\
\mbox{\hmcpset@class}\protect\\
\mbox{\hmcpset@assignment}\protect\\
\hmcpset@duedate%
\ifx\hmcpset@extraline\empty\else\protect\\\hmcpset@extraline\fi%
\end{flushright}%
}

% put id header block at start of document
\ifhmcpset@header\AtBeginDocument{\headerblock}\fi

% internal state for headerblock
\def\hmcpset@name{}
\def\hmcpset@class{}
\def\hmcpset@assignment{}
\def\hmcpset@duedate{}
\def\hmcpset@extraline{}

% commands to set header block info
\newcommand{\name}[1]{\def\hmcpset@name{#1}}
\newcommand{\class}[1]{\def\hmcpset@class{#1}}
\newcommand{\assignment}[1]{\def\hmcpset@assignment{#1}}
\newcommand{\duedate}[1]{\def\hmcpset@duedate{#1}}
\newcommand{\extraline}[1]{\def\hmcpset@extraline{#1}}

% Liz's command set

% Matrices
\newcommand{\minimatrix}[4]{\begin{bmatrix} #1 & #2 \\ #3 & #4 \end{bmatrix}  }
\newcommand{\megamatrix}[9]{\begin{bmatrix} #1 & #2 & #3 \\ #4 & #5 & #6 \\ #7 & #8 & #9\end{bmatrix}  }

\renewcommand{\vec}[1]{{\bf #1}}
\newcommand{\ovec}{\operatorname{vec}}
\renewcommand{\labelenumi}{(\roman{enumi})}
\renewcommand{\hat}{\widehat}

\newcommand{\tworowvector}[2]{[#1\,\,#2]}
\newcommand{\threerowvector}[3]{[#1\,\,#2\,\,#3]}
\newcommand{\fourrowvector}[4]{[#1\,\,#2\,\,#3\,\,#4]}
\newcommand{\fiverowvector}[5]{[#1\,\,#2\,\,#3\,\,#4\,\,#5]}
\newcommand{\sixrowvector}[6]{[#1\,\,#2\,\,#3\,\,#4\,\,#5\,\,#6]}

\newcommand{\twovector}[2]{\begin{bmatrix} #1\\#2 \end{bmatrix} }
\newcommand{\threevector}[3]{\begin{bmatrix} #1\\#2\\#3 \end{bmatrix} }
\newcommand{\fourvector}[4]{\begin{bmatrix} #1\\#2\\#3\\#4 \end{bmatrix} }
\newcommand{\fivevector}[5]{\begin{bmatrix} #1\\#2\\#3\\#4\\#5 \end{bmatrix} }

% Basic stuff
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\T}{\mathbb{T}}
\renewcommand{\H}{\mathcal{H}}
\newcommand{\F}{\mathcal{F}}
\newcommand{\M}{\mathcal{M}}
\renewcommand{\L}{\mathcal{L}}
\renewcommand{\O}{\mathcal{O}}

\newcommand{\nullset}{\varnothing}
\renewcommand{\ss}{\subseteq}
\renewcommand{\bar}[1]{\overline{#1}}
\newcommand{\abs}[1]{\lvert #1 \rvert}
\newcommand{\ip}[1]{\langle #1 \rangle}
\newcommand{\norm}[1]{\lVert#1\rVert}
\newcommand{\seq}[2]{\{{#1}_{#2}\}}

\newcommand{\ds}{\displaystyle}
\newcommand{\dlim}[1]{\displaystyle\lim_{{#1}\rightarrow\infty}}
\newcommand{\flim}[2]{\displaystyle\lim_{{#1}\rightarrow{#2}}}
\newcommand{\dsup}[1]{\displaystyle\limsup_{{#1}\rightarrow\infty}}
\newcommand{\dinf}[1]{\displaystyle\liminf_{{#1}\rightarrow\infty}}
\newcommand{\isum}[1]{\displaystyle\sum_{{#1}=1}^\infty}
\newcommand{\inn}{\!\in}
\newcommand{\weak}{\stackrel{w}{\to}}

\newcommand{\va}{\mathbf{a}}
\newcommand{\vb}{\mathbf{b}}
\newcommand{\vp}{\mathbf{p}}

\renewcommand{\Re}{\textrm{Re } }
\renewcommand{\Im}{\textrm{Im } }
\newcommand{\Arg}{\textrm{Arg } }
\renewcommand{\arg}{\textrm{arg } }
\newcommand{\Log}{\textrm{Log } }
\newcommand{\Res}{\textrm{Res} }
\newcommand{\erf}{\textrm{erf} }
\newcommand{\pv}{\textrm{p.v. } }
\newcommand{\spn}{\textrm{span } }
\newcommand{\tr}{\textrm{tr } }
\newcommand{\diag}{\textrm{diag } }
\newcommand{\fl}{\textrm{fl}}

%--%

\newcommand{\f}{\varphi}
\newcommand{\is}{\cong}
\newcommand{\aut}[1]{\text{Aut}({#1})}
\newcommand{\s}{\sigma}
\newcommand{\e}{\varepsilon}

% Extra formatting 

\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\usepackage{enumerate}
\usepackage{amsfonts}
\usepackage{verbatim}


\setlength{\parindent}{0in}