%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% k124-macros.tex
%%
%% Macros for Koblitz's 124 notes   (AMS-LaTeX)
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\oddsidemargin= 0.75in
\evensidemargin= 0.25in
\textwidth=5.5in
\topmargin= -0.25in
\textheight=8.75in

\renewcommand{\thechapter}{\arabic{chapter}}
\renewcommand{\theequation}{\thechapter.\arabic{equation}}
\numberwithin{equation}{chapter}
%%
\newcommand\note{\item[\ ]}
\renewcommand\part[1]{\noindent{\bf(#1)}}
%%
%%%%%%%%%%%%%%%%
%%
\theoremstyle{definition}
%%
\newcounter{theexercise}
%%
\newtheorem{example}{\hspace{-\parindent}Example}[chapter]
%%
\newtheorem{homework}{\hspace{-\parindent}Homework\setcounter{theexercise}{0}}
%%
\newcommand\exercise{\stepcounter{theexercise}\noindent{\bf\arabic{theexercise}.~}}
%%
\newenvironment{answers}[1]{\medskip\noindent\setcounter{theexercise}{0}%
{\bf Answers to Homework~\ref{#1}}}{}
%%

%%%%%%%%%%%%%%%%%%%%%Macros%%%%%%%%%%%%%%%%

\renewcommand\bar[1]{\overline{#1}}
\renewcommand\Re{\textrm{Re}\,}
\renewcommand\Im{\\textrm{Im}\,}
\newcommand\disp{\displaystyle}
\newcommand\onehalf{\mbox{\Small 1/2}}
\newcommand\nth{n^{\mbox{\Small th}}}
\newcommand\ft{\textrm{ft}}
\newcommand\gal{\textrm{gal}}
\newcommand\degF{^{\circ}\textrm{F}}
\newcommand\degC{^{\circ}\textrm{C}}
\newcommand\cnt{\mbox{$\not\mbox{\kern-5pt}\textrm{c}$}}
\renewcommand\d[2]{\frac{d#1}{d#2}}
\newcommand\dd[2]{\frac{d^2#1}{d#2^2}}
\renewcommand\a{\alpha}
\newcommand\Dt{\Delta t}
\newcommand\p{\phi}
\renewcommand\t{\theta}
\renewcommand\r{\rho}
\newcommand\w{\omega}
\newcommand\lb{\textrm{lb}}
\newcommand\problem[2]{
\medskip

\noindent
\textbf{#1. (#2)}
}

\renewcommand\part[2]{\medskip\noindent{\textbf{(#1) (#2 points)}}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%-------------------------------------------------
% Macro for Assignment heading:
% usage:
%       assignment{course}{assignment number}{due date}
% example:
%       assignment{Math 124F, Autumn, 1992}{1}{Thursday, Oct 1, 1992}
% 
\newcommand\assignment[3]{
\noindent \begin{minipage}[t]{9cm} 
\bf #1
\end{minipage}
 \hfill  
\begin{minipage}[t]{7cm}
\bf
Assignment \##2\\
Due: #3
\end{minipage}
\medskip
}
%------------------------------------

%-------------------------------------------------
% Macro for worksheet:
% usage:
%       worksheet{course}{number}{date}
% example:
%       worksheet{Math 124F, Autumn, 1992}{1}{Thursday, Oct 1, 1992}
% 
\newcommand\worksheet[3]{
\noindent \begin{minipage}[t]{9cm} 
\bf #1

\medskip
\end{minipage}
 \hfill  
\begin{minipage}[t]{7cm}
\bf
Worksheet \##2\\
#3
\end{minipage}
\medskip
}
%

%-------------------------------------------------
% Macro for quiz heading:
% usage:
%       quiz{course}{number}{date}{length}
% example:
%       quiz{Math 124F, Autumn, 1992}{1}{Thursday, Oct 1, 1992}{30 min}
% 
\newcommand\quiz[4]{
\ \hfill \answerbox{1truecm}{0.5truecm}{}

\medskip

\noindent \begin{minipage}[t]{9cm} 
\bf #1

\medskip

\bf Name \underline{\hspace{8cm}} 

{\bf Student number} \underline{\hspace{2cm}}

{\bf Quiz Section:} \underline{\hspace{1cm}}
\end{minipage}
 \hfill  
\begin{minipage}[t]{7cm}
\bf
Quiz \##2,  #3\\
{\em(Time allowed: #4)}
\end{minipage}
\medskip
}
%
%------------------------------------
% Macros for midterm heading:
\newcommand\midterm[3]{
\ \hfill \answerbox{1truecm}{0.5truecm}{}

\medskip

\noindent \begin{minipage}[t]{9cm} 
\bf #1

\medskip

\bf Name \underline{\hspace{8cm}} 

{\bf Student number} \underline{\hspace{2cm}}

{\bf Quiz Section:} \underline{\hspace{1cm}}
\end{minipage}
 \hfill  
\begin{minipage}[t]{7cm}
\bf
Midterm \##2,  #3\\
\end{minipage}
\medskip
}
%

\newcommand\answerbox[3]{#3\fbox{\rule{#1}{0cm}\rule{0cm}{#2}}}

