\usepackage{mathptmx,graphicx,epsf}
\usepackage{fancyhdr}
\usepackage[hmargin={1cm,1cm}, vmargin={1.6cm,0.5cm}]{geometry}
%\usepackage{amsmath,amsthm,amssymb,amsfonts,eucal,amsbsy}
\usepackage{amsmath,amsthm,amssymb,amsbsy,bbding}
\input{usmpream}
%\input{usm_colors}

\usepackage{cancel}

%SPECIALTY FONTS
%\font\zingb=zd scaled 1200
\newcommand{\zingb}{{
     \fontfamily{ding}\fontencoding{U}\fontsize{10}{20pt}\selectfont
\CircleSolid}}
\font\ftn=ptmr scaled 5000
\font\ftl=ptmr scaled 7000

%\font\fhbs=phvb scaled 1200
%\font\fhbn=phvb scaled 1500
%\font\fhbl=phvb scaled 2400
%\font\fhbh=phvb scaled 3500

%\font\ftbs=ptmb scaled 1200
%\font\ftbn=ptmb scaled 1500
%\font\ftbl=ptmb scaled 2400
%\font\ftbh=ptmb scaled 3500


%SET MARKERS
\newcommand{\str}{\raisebox{12pt}{\nzingb \color{red} l  \hspace*{-10pt}}   }
\newcommand{\strs}{\raisebox{10pt}{\lzingb \color{red} D \hspace*{-20pt}}   }
\newcommand{\smbl}{\color{gray70}{\zingb }}
\newcommand{\smba}{\color{gray80}{\zingb }}


\newcommand{\slidecolor}{\color{black}}
%SET FONTS
% titlefont  - USED ON PAGE TITLES.
% headerfont - USED ON LEAD PAGES.
% slidefont  - THE TEXT OF THE SLIDES.
\newcommand{\mathfont}{
%     \fontfamily{phv}\fontsize{17}{20pt}\selectfont}
     \fontsize{17}{20pt}\selectfont}
\newcommand{\titlefont}{%\usefont{OT1}{phv}{m}{n}
     \fontsize{25.0}{30pt}\selectfont}
\newcommand{\headerfont}{%\usefont{OT1}{phv}{m}{n}
     \fontsize{35.0}{45pt}\selectfont \color{darkred}}
\newcommand{\slidefont}{%\usefont{OT1}{phv}{m}{n}
     \fontsize{21.0}{30pt}\selectfont \slidecolor}
\newcommand{\capfont}{%\usefont{OT1}{phv}{m}{n}
     \fontsize{20.0}{28pt}\selectfont \slidecolor}
\newcommand{\smallfont}{%\usefont{OT1}{phv}{m}{n}
     \fontsize{16.0}{25pt}\selectfont \slidecolor}
\newcommand{\ttcolor}{\tt \color{gray30}}


%CUSTOMIZE MATH TEXT COLOR AND FONTS
\newcommand{\refcolor}{\color{darkblue}}
\newcommand{\mathcolor}{\color{blue}}
\newcommand{\mathcolorgray}{\color{gray40}}
\newcommand{\mathcolorgreen}{\color{blue}}
\newcommand{\mc}{\mathfont \color{blue}}
\newcommand{\ec}{\slidefont \mathcolor}
\newcommand{\ecg}{\ec \mathcolorgray}
\newcommand{\ecgr}{\ec \mathcolorgreen}
% SET MATH FONT TO TEXT FONT COMMAND
\newcommand{\ecn}{\slidefont \slidecolor}

%SET THEOREM ENVIRONMENT
\newtheorem{thm}{\slidefont \color{gray20}  Theorem}
\newtheorem*{thm*}{\slidefont \color{gray20} Theorem}
\newtheorem{lem}{\slidefont \color{gray20}  Lemma}
\newtheorem*{lem*}{\slidefont \color{gray20} Lemma}
\newtheorem{dfn}{\slidefont \color{gray20} Definition}
\newtheorem*{dfn*}{\slidefont \color{gray20} Definition}
\newtheorem{cor}{\slidefont \color{gray20}  Corollary}
\newtheorem*{cor*}{\slidefont \color{gray20} Corollary}

%BOXED THEOREM ENVIRONMENTS
\usepackage{framed}
\definecolor{shadecolor}{rgb}{0.8,.8,.9}
\newenvironment{algorithm}[1][{}]
	{\begin{center}\begin{minipage}{8.75in}\begin{shaded}\noindent\textbf{Algorithm:}\ \emph{#1} }
	{\end{shaded}\end{minipage}\end{center}}
\newenvironment{theorem}[1][{}]
	{\begin{center}\begin{minipage}{8.75in}\begin{shaded}\noindent\textbf{Theorem:}\ \emph{#1} }
	{\end{shaded}\end{minipage}\end{center}}
\newenvironment{corollary}[1][{}]
	{\begin{center}\begin{minipage}{8.75in}\begin{shaded}\noindent\textbf{Corollary:}\ \emph{#1} }
	{\end{shaded}\end{minipage}\end{center}}
\newenvironment{definition}[1][{}]
	{\begin{center}\begin{minipage}{8.75in}\begin{shaded}\noindent\textbf{Definition:}\ \emph{#1} }
	{\end{shaded}\end{minipage}\end{center}}
\newenvironment{question}[1][{}]
	{\begin{center}\begin{minipage}{8.75in}\begin{shaded}\noindent\textbf{Question:}\ \emph{#1} }
	{\end{shaded}\end{minipage}\end{center}}
\newenvironment{explanation}
	{\begin{center}\begin{minipage}{6.5in}\definecolor{shadecolor}{rgb}{0.85,0.85,0.85}\begin{shaded}\begin{center}\dims(}
	{)\end{center}\end{shaded}\definecolor{shadecolor}{rgb}{0.8,0.8,0.9}\end{minipage}\end{center}}
\newenvironment{method}[1][{}]
	{\begin{center}\begin{minipage}{8.75in}\definecolor{shadecolor}{rgb}{0.7,0.8,0.7}\begin{shaded}\noindent\textbf{#1}}
	{\end{shaded}\definecolor{shadecolor}{rgb}{0.8,0.8,0.9}\end{minipage}\end{center}}

%SET HILITE COLORS
\newcommand{\hilite}{\color{red}}
\newcommand{\hiliteg}{\color{lightgreen}}
\newcommand{\hilitegray}{\color{gray50}}
\newcommand{\dims}{\color{gray50}}
\newcommand{\necg}{\color{gray70}}

%SET PAGE, FIGURE, AND EQUATION REFERENCES.
\newcommand{\RefPage}[1]{{\refcolor page\,\pageref{#1}}}
\newcommand{\RefFig}[1]{{\refcolor Fig.\,\ref{#1}}}
\newcommand{\RefEq}[1]{{\mathcolor (\ref{#1})}}
\renewcommand\figurename{\capfont \refcolor Figure }

%SET COMMAND COLORS
\newcommand{\SymAlg}{\textbf{\color{blue}$\langle$SymAlg$\rangle$}}
\newcommand{\SymDif}{\textbf{\color{blue}$\langle$SymDif$\rangle$}}
\newcommand{\SymInt}{\textbf{\color{blue}$\langle$SymInt$\rangle$}}
\newcommand{\CalcText}{\textbf{\color{blue}$\langle$CalcText$\rangle$}}
\newcommand{\GoogleCalc}{\textbf{\color{blue}$\langle$GoogleCalc$\rangle$}}
\newcommand{\Plot}{\textbf{\color{blue}$\langle$Plot$\rangle$}}
\newcommand{\Print}{\textbf{\color{blue}$\langle$Print$\rangle$}}
\newcommand{\Home}{\textbf{\color{darkgreen}$\langle$Back to Calc I$\rangle$}}
\newcommand{\Next}{\textbf{\hilite$\langle$Next$\rangle$}}
\newcommand{\Prev}{\textbf{\hilite$\langle$Prev$\rangle$}}
\newcommand{\Index}{\textbf{\hilite$\langle$Index$\rangle$}}
\newcommand{\Feedback}{\textbf{\color{blue}$\langle$Feedback$\rangle$}}
\newcommand{\Sage}{\textbf{\color{blue}$\langle$Sage$\rangle$}}

\renewcommand\refname{\color{black} \smallslidefont References}


%SET HEAD AND FEET.
\newcommand{\FancyHead}[1]{
\setlength{\headheight}{15pt}
%\footskip=1.35cm
%\textheight=22.3cm
\pagestyle{fancy}
\renewcommand{\headrulewidth}{2pt}
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\plainheadrulewidth}{0pt}
%\renewcommand{\headrule}{\color{yellow}\hrulefill}
%\renewcommand{\footrule}{\color{yellow}\hrulefill}
\cfoot{\fancyplain{}{\color{black} \hrulefill \hspace*{1em} {} \hspace*{1em} \hrulefill }}
%\cfoot{\fancyplain{}{\color{black} \ftbs \hrulefill \hspace*{1em} {} \hspace*{1em} \hrulefill }}
%\lfoot{\fancyplain{}{}}
%\rfoot{\fancyplain{}{\thepage}}
%\lhead[\fancy{}{}]{\fancyplain{}{}}
\lhead[\fancy{}{}]{\fancyplain{}{ \color{fontcolor} #1}}
%\lhead[\fancy{}{}]{\fancyplain{}{\fhbn \color{fontcolor} #1}}
%\rhead[\fancy{}{}]{\fancyplain{\thepage}{\ftbn \color{whitecolor} \hrulefill \hspace*{1cm} \thepage}}
%\rhead[\fancy{}{}]{\fancyplain{\thepage}{\ftbn \color{whitecolor} \thepage}}
\rhead[\fancy{}{}]{\fancyplain{\thepage}{ \color{fontcolor} \thepage}}
%\rhead[\fancy{}{}]{\fancyplain{\thepage}{\ftbn \color{fontcolor} \thepage}}
}


%DEFINE USER COMMANDS FOR SLIDE ADVANCEMENT.
\newcommand{\NewSlide}[1]{\newpage \slidefont
%\begin{center} {\titlefont \color{gold} \textbf{#1}} \end{center} 
{\centering \titlefont \color{darkred} \textbf{#1}\\} 
\vspace*{0.0em}} 

\newcommand{\StartOverlaySlide}[1]{\clearpage \slidefont
%\begin{center} {\titlefont \color{gold}  \textbf{#1}} \end{center}
{ \centering \titlefont \color{darkred}  \textbf{#1}\\} 
\vspace*{0.0em}} 

\newcommand{\OverlaySlide}[1]{\clearpage \slidefont \addtocounter{page}{-1}
%\begin{center}{\titlefont \color{gold}  \textbf{#1}}\end{center}
{\centering \titlefont \color{darkred}  \textbf{#1}\\}
\vspace*{0.0em}}

\newcommand{\StartSlide}[2]{\clearpage \FancyHead{#1} \setcounter{page}{1}
\slidefont
%\begin{center} {\titlefont \color{gold} \textbf{#2}} \end{center}
{\centering \titlefont \color{darkred} \textbf{#2}\\}
\vspace*{0.0em}}

\newcommand{\BlankSlide}[1]{\newpage \slidefont \color{black} \thispagestyle{empty}
%\begin{center} {\headerfont \color{yellow} \textbf{#1}} \end{center}
{\centering \headerfont \color{darkred} \textbf{#1}\\}
\vspace*{0.0em}}
\newcommand{\TitleSlide}[1]{\newpage \slidefont \color{black} \thispagestyle{empty}
{\centering \headerfont \color{darkred} \textbf{#1}\\}
\vspace*{0.0em}}





% LISTS USING itemdef FOR COLORED ITEMIZED LISTS
\newcounter{beancitem}
\newcommand{\itemdef}[1]{
\begin{list}
{\raisebox{3pt}{{#1}}} {\usecounter{beansymbol}
\setlength{\parsep}{3pt}
%\setlength{\rightmargin}{0.0cm} \setlength{\leftmargin}{1.8cm}}
\setlength{\rightmargin}{0.0cm} \setlength{\leftmargin}{0.8cm}}
                        }
% SET SYMBOL FOR COLOR ITEMIZED LISTS
\newcommand{\ECitem}{\end{list}}
\newcommand{\BCitem}{\itemdef{\smbl}}


\pagenumbering{arabic}


%SET PAGE SIZE FOR MAXIMUM FIGURES
\renewcommand\floatpagefraction{1.0}
\renewcommand\topfraction{1.0}
\renewcommand\bottomfraction{1.0}
\renewcommand\textfraction{0.0}




%SET MATHEMATICS DEFINITIONS
\newcommand{\Bmat}{\begin{pmatrix}}
\newcommand{\Emat}{\end{pmatrix}}


%DEFINE BOLD SCRIPT LETTERS
\newcommand{\Ba}{\textbf{\em a}}
\newcommand{\Bb}{\textbf{\em b}}
\newcommand{\Bc}{\textbf{\em b}}
\newcommand{\Be}{\textbf{\em e}}
\newcommand{\Bf}{\textbf{\em f}}
\newcommand{\Bp}{\textbf{\em p}}
\newcommand{\Bs}{\textbf{\em s}}
\newcommand{\Bx}{\textbf{\em x}}
\newcommand{\By}{\textbf{\em y}}
\newcommand{\Bzero}{\textbf{\em 0}}
\newcommand{\Bone}{\textbf{\em 1}}

\newcommand{\bnm}{$\ec}
\newcommand{\enm}{$}


%CHOOSE COLOR, GRAY, OR MONOCHROME {usm_colors} {usm_monochrome} 
\newcommand{\boxfile}{./sfiles/boxgray.jpg}
\newcommand{\splashpage}{./sfiles/domes.jpg}
\newcommand{\sidebars}{./sfiles/lilacbars.jpg}
\newcommand{\splashthanks}{./sfiles/domes_bn.jpg}
\newcommand{\splashthanksw}{./sfiles/boxwhite.jpg}

\newcommand{\comment}[1]{{\color{black} #1}}
%\newcommand{\wcomment}[1]{\vspace*{-0.5em}{\centering \parbox[t]{21.5cm}{\color{white} #1}\\}}
\newcommand{\wcomment}[1]{\vspace*{-0.5em}\begin{center}\parbox[t]{21.5cm}{\color{darkred} #1}\end{center}}


