%
% linalg.sty
%
% Style file for producing double-column exams and solution sets.
% For solutions, use switch "\solutionstrue" or "\solutionsfalse"
% Sets \small\rm, empty page style. Use with "\begin{multicols}{2}"
% to make double-column output.
%
%\pagestyle{empty}
%\small\rm
%\setlength{\oddsidemargin}{-0.4in}
%\setlength{\evensidemargin}{-0.4in}
%\setlength{\textwidth}{7.2in}
%\setlength{\textheight}{9.5in}
%\setlength{\parskip}{1pt}
%\setlength{\topmargin}{-1in}
%\setlength{\parindent}{0pt}
%%
%% \begin{exercises} \prob{1.}{(Area)} ... \end{exercises}
%%
%\newenvironment{exercises}{\begin{list}{}{}}{\end{list}}
%\newcounter{probl}\setcounter{probl}{0}
%\newcounter{xprobl}\setcounter{xprobl}{0}
%\def\prob#1#2{%
%\stepcounter{probl}\setcounter{xprobl}{0}%
%\global\def\LASTPROB{\arabic{probl}}%
%\item[{\normalsize\bf \LASTPROB}.] {\footnotesize\bf #2}}
%\def\probx#1#2{%
%\stepcounter{xprobl}
%\global\def\LASTPROB{\arabic{probl}\alph{xprobl}}%
%\item[{\normalsize\bf \LASTPROB}.] {\footnotesize\bf #2}}
%
% Old environments, once used.
%
%\newenvironment{problem}[1]{\protect\par\bigskip\noindent{\theproblem{}{\large\bf #1}~}\normalsize\rm}{\protect\par\smallskip}
%\newenvironment{solution}[1]{\protect\par{\large\bf Notes on Problem #1}.~}{\protect\par}

%
% Special symbols
%
\def\L{{\cal L}}
\def\dd{\displaystyle}
\def\cents{\hbox{\rm\rlap/c}}
\def\Cos{\mathop{\bf Cos}\nolimits}
\long\def\choose#1#2{\left(\begin{array}{r} #1 \\ #2 \end{array}\right)}
\def\div{\mathop{\bf div}\nolimits}
\def\RR{{\bf R}}
\def\CC{{\bf C}}
\def\Nn{{\cal N}}
\def\Rr{{\cal R}}
\def\span{\mathop{\bf span}\nolimits}
\def\adjoint{\mathop{\bf adjoint}\nolimits}
\def\AUG{\mathop{\bf aug}\nolimits}
\def\nullity{\mathop{\bf nullity}\nolimits}
\def\aug#1#2{\left(#1\,:\,#2\right)}
\def\FF{\mbox{\fbox{$1$}}}
\def\erf{\mathop{\bf erf}\nolimits}
\def\rref{\mathop{\bf rref}\nolimits}
\def\grad{\mathop{\bf grad}\nolimits}
\def\rank{\mathop{\bf rank}\nolimits}
\def\text#1{\mbox{#1}}
\def\barone{\medskip\rule{\textwidth}{0.2em}}
\def\bartwo{\rule{\textwidth}{0.2em}\medskip}
\def\MOUSELEFT{\framebox{\tt Mouse Left Button}}
\def\MOUSERIGHT{\framebox{\tt Mouse Right Button}}
\def\MOUSEMIDDLE{\framebox{\tt Mouse Middle Button}}

%
% Macro for keeping problems and solutions together in the LaTeX source.
% The solutions are printed if "\solutionstrue" appears in the source.
%
%\newif\ifsolutions \solutionsfalse
%\long\def\SOL#1#2{\ifsolutions
%\par {\bf Solution to \LASTPROB}. #2%
%\else
%\fi
%}
%%
%\newif\ifnotes \notesfalse
%\long\def\NOTES#1{\ifnotes #1 \else \fi}
% Often in source files, I use this:
%\ifnotes\global\def\NOTES{}\else\global\def\NOTES#1{}\fi
% Reason: The last one handles verbatim material.
%
%
% Define \WRAPFIG{\AA}{\BB}{1.0in} for wrapping text /w figures.
%        This puts \AA on the left, \BB on the right in box width \DIM
% Usage: \def\DIM{1.0in}\def\AA{...}\def\BB{...}
%        \WRAPFIG{\AA}{\BB}{\DIM}
%
\newdimen\miniFIGwidth
\newdimen\miniTXTwidth
\long\def\WRAPFIG#1#2#3{%
\miniFIGwidth=#3\relax
\miniTXTwidth=\hsize\relax
\addtolength{\miniTXTwidth}{-\miniFIGwidth}
\addtolength{\miniTXTwidth}{-0.3in}
\begin{tabular}{@{}p{\miniTXTwidth}@{\hspace{0.1in}}p{\miniFIGwidth}}%
\begin{minipage}{\miniTXTwidth}%
#1
\end{minipage} &
\begin{minipage}{\miniFIGwidth}%
#2
\end{minipage}
\end{tabular}%
}
%
% Macro to gobble space, used for alignment of formulas.
%
\long\def\hidem#1{\mbox{\phantom{$#1$}}}
%
% Linear algebra definitions for matrices and vectors.
%
\long\def\colvector#1{\left(\begin{array}{r}#1\end{array}\right)}
\long\def\colvectorC#1{\left(\begin{array}{c}#1\end{array}\right)}
\long\def\rowvector#1{\left(\begin{array}{l}#1\end{array}\right)}
\long\def\rowvectorC#1{\left(\begin{array}{c}#1\end{array}\right)}
\def\cof{\mathop{\bf cof}\nolimits}
\def\adj{\mathop{\bf adj}\nolimits}
\def\span{\mathop{\bf span}\nolimits}
\def\SPAN{\mathop{\bf span}\nolimits}
\def\augment#1#2{\left(#1\,:\,#2\right)}

\long\def\WORKUP#1{
\begin{tabular}{@{}p{2.4in}p{1.0in}}
#1
\end{tabular}
}
\long\def\WORKUPaMatrix#1#2{
\begin{tabular}{@{}ll}
& \\
\parbox[t]{2.1in}{#1} & \parbox{1.2in}{#2}
\end{tabular}
}

\def\.#1{\mbox{\bf #1}}
\def\diag{\mathop{\bf diag}\nolimits}


\long\def\colvector#1{\left(\begin{array}{r}#1\end{array}\right)}
\long\def\colvectorC#1{\left(\begin{array}{c}#1\end{array}\right)}
\long\def\minicolvector#1{\left(\begin{array}{@{}r@{}}#1\end{array}\right)}
\long\def\minicolvectorC#1{\left(\begin{array}{@{}c@{}}#1\end{array}\right)}
\long\def\rowvector#1{\left(\!\begin{array}{llllll}#1\end{array}\!\right)}
\long\def\rowvectorC#1{\left(\!\begin{array}{cccccc}#1\end{array}\!\right)}
\def\twobytwo#1#2{%
\left(\begin{array}{rr}
#1 \\ #2
\end{array}\right)
}
\def\threebythree#1#2#3{%
\left(\begin{array}{rrr}
#1 \\ #2 \\ #3
\end{array}\right)
}
\def\fourbyfour#1#2#3#4{%
\left(\begin{array}{rrrr}
#1 \\ #2 \\ #3 \\ #4
\end{array}\right)
}
\def\fivebyfive#1#2#3#4#5{%
\left(\begin{array}{rrrrr}
#1 \\ #2 \\ #3 \\ #4 \\ #5
\end{array}\right)
}
\def\minitwobytwo#1#2{%
\left(\begin{array}{@{}r@{\hspace{0.6ex}}r@{}}
#1 \\[-0.75ex] #2
\end{array}\right)
}
\def\minitwobytwoC#1#2{%
\left(\begin{array}{@{}c@{\hspace{0.6ex}}c@{}}
#1 \\[-0.75ex] #2
\end{array}\right)
}
\def\minithreebythree#1#2#3{%
\left(\begin{array}{@{}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{}}
#1 \\ #2 \\ #3
\end{array}\right)
}
\def\minifourbyfour#1#2#3#4{%
\left(\begin{array}{@{}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{}}
#1 \\ #2 \\ #3 \\ #4
\end{array}\right)
}
\def\minifivebyfive#1#2#3#4#5{%
\left(\begin{array}{@{}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{}}
#1 \\ #2 \\ #3 \\ #4 \\ #5
\end{array}\right)
}
\def\minisixbysix#1#2#3#4#5#6{%
\left(\begin{array}{@{}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{}}
#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ #6
\end{array}\right)
}
\def\minicolvector#1{\left(\begin{array}{@{}r@{}}#1\end{array}\right)}
\def\minicolvectorC#1{\left(\begin{array}{@{}c@{}}#1\end{array}\right)}
\def\Threebythree#1#2#3{%
\left(\begin{array}{@{}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{}} #1 \\ #2 \\
#3
\end{array}\right)
}
\def\DETtwobytwo#1#2{%
\left|\begin{array}{rr}
#1 \\ #2
\end{array}\right|
}\def\DETthreebythree#1#2#3{%
\left|\begin{array}{rrr}
#1 \\ #2 \\ #3
\end{array}\right|
}
\def\DETfourbyfour#1#2#3#4{%
\left|\begin{array}{rrrr}
#1 \\ #2 \\ #3 \\ #4
\end{array}\right|
}
\def\DETminitwobytwo#1#2{%
\left|\begin{array}{@{}r@{\hspace{0.6ex}}r@{}}
#1 \\[-0.75ex] #2
\end{array}\right|
}
\def\DETminithreebythree#1#2#3{%
\left|\begin{array}{@{}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{}}
#1 \\ #2 \\ #3
\end{array}\right|
}
\def\DETminifourbyfour#1#2#3#4{%
\left|\begin{array}{@{}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{}}
#1 \\ #2 \\ #3 \\ #4
\end{array}\right|
}
