% -----------------------------*- LaTeX -*------------------------------
%   SCRIBE.STY -- Make scribe notes
%
%  Francis Bach, 2007; shamelessly taken from Laurent El Ghaoui
%
%   Martin Wainwright;  August, 2004
%
%   Modified from a version by Jeff Erickson (jeffe@cs.uiuc.edu), July 29, 1998
%
%   Loosely based on the MIT/Berkeley scribe notes macros, but
%   written from scratch.
%
% ----------------------------------------------------------------------
%   USAGE:
%
%   \documentstyle[12pt]{report}		NOT article!
%   \usepackage{scribe}
%   ...
%   \begin{document}
%   \course{EECS 227} 				optional
%   \coursetitle{Optimization}	optional
%   \semester{Fall 2004}			optional
%   \lecturer{Jeff Erickson}			optional
%   \scribe{Joe. A Student}			required
%   \lecturenumber{17}				required (must be a number)
%   \lecturedate{October 12}			required (omit year)
%   \maketitle
% ----------------------------------------------------------------------
%   The stuff before \maketitle can be in any order, but it has to go
%   before \maketitle.
%
%   The lecture number appears in all page, section, theorem, figure,
%   table, and equation numbers.  It must be a single positive
%   integer; ranges like 3--5 are not (yet) properly supported.
%
%   Automatically loads the amsmath package, which is a Good Thing,
%   especially if you're going to use a lot of math.  See ``The LaTeX
%   Companion'' for details!
%
%   To get a proof, use \begin{proof}...\end{proof}.  You can attach
%   an optional argument, just as with the standard latex theorem
%   environment.  You can also define new proof-like environments with
%   \newproof{foo}{bar}, just like \newthe\orem.
% ----------------------------------------------------------------------
\RequirePackage{amsmath,amssymb}

\def\course#1{\def\@course{#1}}
\course{ }

\def\coursetitle#1{\def\@coursetitle{#1}}
\coursetitle{Introduction aux mod\`eles graphiques}

\def\semester#1{\def\@semester{#1}}
\semester{2007/2008}

\def\lecturer#1{\def\@lecturer{#1}}
\lecturer{Francis Bach}

\def\scribe#1{\def\@scribe{#1}}
% \@scribe intentionally undefined

\def\lecturenumber#1{\def\@lecturenumber{#1}}
% \@lecturenumber intentionally undefined

\def\lecturedate#1{\def\@lecturedate{#1}}
% \@lecturedata intentionally undefined

\def\xxx{\vphantom{()}}
\def\maketitle
{
\def\@oddhead{\underline{\hbox to\textwidth{\textbf{%
	\rlap{\@course\phantom{()}}\hfil
	Cours~\@lecturenumber~--- \@lecturedate
	\hfil\llap{\@semester}}}}}
\def\@oddfoot{\hfil\@lecturenumber-\thepage\hfil}
\def\ps@myfirst{\ps@plain\def\@oddfoot{\hfil\@lecturenumber-\thepage\hfil}}
\thispagestyle{myfirst}
\noindent
\framebox[\textwidth]{\vbox to 0.75in{
\hbox to\textwidth{~\textbf{\rlap{\@course\@coursetitle\xxx}
	\hfil\llap{\@semester}}~}
\vss
\hbox to \textwidth{\Large\hfill Cours \@lecturenumber~--- \@lecturedate\hfill}
\vss
\hbox to \textwidth{~\textsl{\rlap{Enseignant: \@lecturer\xxx}
	\hfill\llap{Scribe: \@scribe}}~}
}}
\setcounter{chapter}{\@lecturenumber}
\bigskip
}


\newcommand{\BlackBox}{\rule{1.5ex}{1.5ex}}  % end of proof
\newenvironment{proof}{\par\noindent{\bf D\'emonstration\ }}{\hfill\BlackBox\\[2mm]}



% ----------------------------------------------------------------------
%  Standard lemma, theorem, and corollary environments.
% ----------------------------------------------------------------------
\newtheorem{lemma}{Lemme}[chapter]
\newtheorem{theorem}[lemma]{Th\'eor\`eme}
\newtheorem{corollary}[lemma]{Corollaire}
\newtheorem{proposition}[lemma]{Proposition}
\newtheorem{definition}[lemma]{D\'efinition}

 
 
% ----------------------------------------------------------------------
%  Make captions smaller than the text, make their titles bold.
%  Arguments:   #1 == figure name: "Figure 5"
%               #2 == caption: "Papers by \Erdos, 1900--2000 (projected)"
%  Put less space after floats, since captions are smaller
% ----------------------------------------------------------------------
\long\def\@makecaption#1#2{
   \vskip 10pt
   \setbox\@tempboxa\hbox{{\small \textbf{#1.} #2}}
   \ifdim \wd\@tempboxa >\hsize         % IF longer than one line:
       {\footnotesize \textbf{#1.} #2\par}% THEN set as ordinary paragraph.
     \else                              %   ELSE  center.
       \hbox to\hsize{\hfil\box\@tempboxa\hfil}
   \fi}
\dbltextfloatsep 18pt plus 2pt minus 4pt   % was 20pt plus 2pt minus 4pt
\textfloatsep 18pt plus 2pt minus 4pt      % was 20pt plus 2pt minus 4pt

% ----------------------------------------------------------------------
%  Dangerous bend environments, stolen from TeXbook and slightly
%  massaged.
%
%  Invoke as \begin{[d]danger}...\end{[d]danger}.  The enclosed text
%  is offset just like any other list (theorem, proof, etc.)  Puts
%  sign[s] in front of first two lines of first paragraph, which are
%  (supposedly) never split by a page boundary.  Does NOT shrink or
%  otherwise modify the text.
% ----------------------------------------------------------------------
%  The dangerous bend signs are the correct size to match two lines of
%  Computer Modern 9pt type.   We really ought to scale them up to
%  fit whatever size we're using, but we don't.  Unfortunately, manfnt
%  is actually a 10pt font, so if we want to match 11pt Computer
%  Modern, we have to scale manfnt to 12.222222pt!  Thanks, Don. 
% ----------------------------------------------------------------------
\font\manual=manfnt
\def\dbend{{\manual\char127}} % dangerous bend sign

% Danger, Will Robinson!
\def\danger{\begin{trivlist}\item[]\noindent%
\begingroup\hangindent=3pc\hangafter=-2%\clubpenalty=10000%
\def\par{\endgraf\endgroup}%
\hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces}
\def\enddanger{\par\end{trivlist}}

% Danger! Danger!
\def\ddanger{\begin{trivlist}\item[]\noindent%
\begingroup\hangindent=3pc\hangafter=-2%\clubpenalty=10000%
\def\par{\endgraf\endgroup}%
\hbox to0pt{\hskip-\hangindent\dbend\kern2pt\dbend\hfill}\ignorespaces}
\def\endddanger{\par\end{trivlist}}



% Formatting
\oddsidemargin .00in
\evensidemargin .00in
\marginparwidth 0.07 true in
\addtolength{\headsep}{0.25in}
\textheight 8.5 true in
\textwidth 6.5 true in
\clubpenalty=10000






% some traditional defintions that can be blamed on craig barratt
\newcommand{\BEAS}{\begin{eqnarray*}}
\newcommand{\EEAS}{\end{eqnarray*}}
\newcommand{\BEA}{\begin{eqnarray}}
\newcommand{\EEA}{\end{eqnarray}}
\newcommand{\BEQ}{\begin{equation}}
\newcommand{\EEQ}{\end{equation}}
\newcommand{\BIT}{\begin{itemize}}
\newcommand{\EIT}{\end{itemize}}
\newcommand{\BNUM}{\begin{enumerate}}
\newcommand{\ENUM}{\end{enumerate}}

% arash added these two
\newcommand{\BA}{\begin{array}}
\newcommand{\EA}{\end{array}}

% text abbrevs
\newcommand{\cf}{{\it cf.}}
\newcommand{\eg}{{\it e.g.}}
\newcommand{\ie}{{\it i.e.}}
%\newcommand{\etc}{{\it etc.}}

\newcommand{\ones}{\mathbf 1}

% std math stuff
\newcommand{\reals}{{\mbox{\bf R}}}
\newcommand{\integers}{{\mbox{\bf Z}}}
\newcommand{\eqbydef}{\mathrel{\stackrel{\Delta}{=}}}
\newcommand{\complex}{{\mbox{\bf C}}}
\newcommand{\symm}{{\mbox{\bf S}}}  % symmetric matrices


