%% 
%% This is file `lect2.cls',
%% generated with the docstrip utility.
%% 
%% The original source files were:
%% 
%% lect2.dtx  (with options: `class')
%% 
%% Package to create lecture notes and slides. 
%% 
%% Nick Urbanik. 
%% 
%% This file was generated automatically. 
%% Do not edit this file; edit the original source, lect2.dtx instead. 
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{lect2}%
      [1996/01/26 For VTC microprocessor lectures; with framed slides]
\DeclareOption{slides}{%
   %\PassOptionsToClass{12pt}{article}
   \PassOptionsToClass{article}{seminar}
   \AtEndOfClass%
   {%
      \setmarginsrb{15mm}% leftmargin---was 7mm,%
                   {4mm}%  topmargin
                   {7mm}%  rightmargin
                   {12mm}% bottommargin --- was 8mm
                   {5mm}%  headheight
                   {12pt}% headsep
                   {0pt}%  footheight---not defined in LaTeX 2e.
                   {10.25mm}% footsep
      \articlemag{2}%
      \addtolength{\headheight}{6.6pt}
      \renewcommand{\headwidth}{\textwidth}%
   \renewcommand{\footrulewidth}{0.4pt}
      \lhead[%
               \fancyplain{}%
               {%
                  \rmfamily\bfseries \thepage%
               }%
            ]%
            {%
               \fancyplain{}%
               {%
                  \footnotesize\bfseries \subjectNumber\hspace{0.5em}
                  \subject%
               }%
            }%
      \rhead[%
               \fancyplain{}%
               {%
                  \footnotesize\bfseries \subjectNumber\hspace{0.5em}
                  \subject%
               }%
            ]%
            {%
               \fancyplain{}%
               {\rmfamily\bfseries \thepage}%
            }%
      \lfoot[\fancyplain{}{}]%
            {%
               \fancyplain{\tiny\revision}%
               {%
                  \footnotesize\bfseries\rightmark%
                  \mdseries\tiny\mbox{}\\%
                  \protect\revision%
               }%
            }
      \rfoot[%
               \fancyplain{}%
               {%
                  \footnotesize\bfseries\leftmark%
                  \mdseries\tiny\mbox{}\\%
                  \protect\revision%
               }%
            ]%
            {\fancyplain{}{}}
      \renewcommand{\lectureHead}%
      {%
         \thispagestyle{plain}
         \begin{center}
         \bfseries\large
         \subjectNumber\hspace{0.6em}\subject
         \end{center}

         \vspace{4ex}
      }%
   \setboolean{makeSLIDES}{true}
   \excludeversion{notes}%
   \includeversion{slides}%
   \typeout{^^JMaking SLIDES}
   \typeout{To get readable slides, either use the 12pt option
            or insert the command}
   \typeout{\protect\slidesmag{3} into the preamble
            of the lecture notes file.^^J}
   }%
}
\DeclareOption{notes}{%
   \PassOptionsToClass{twoside,article,12pt}{seminar}
   \AtEndOfClass%
   {%
      \setmarginsrb{30mm}%  leftmargin
                   {20mm}%  topmargin
                   {15mm}%  rightmargin
                   {20mm}%  bottommargin
                   {5mm}%  headheight
                   {8mm}% headsep
                   {0pt}%  footheight---not defined in LaTeX 2e.
                   {13mm}% footskip
      \renewcommand{\headwidth}{\textwidth}%
      \newlength{\markWidth}
      \setlength{\markWidth}{\textwidth}
      \addtolength{\markWidth}{-3.5em}
      \addtolength{\headheight}{1.92ex}
\slideplacement{float}
      \lhead[%
               \fancyplain{}%
               {%
                  \footnotesize\bfseries \college%
               }%
            ]%
            {%
               \fancyplain{}%
               {%
                  \footnotesize\bfseries \subjectNumber\\
                  \subject%
               }%
            }%
      \rhead[%
               \fancyplain{}%
               {%
                  \footnotesize\bfseries \subjectNumber\\
                  \subject%
               }%
            ]%
            {%
               \fancyplain{}%
               {%
                  \footnotesize\bfseries \college%
               }%
            }%
      \lfoot[%
               \fancyplain{}%
               {%
                  \parbox[t]{\markWidth}%
                  {%
                     \raggedright%
                     \renewcommand{\baselinestretch}{1.2}%
                     \footnotesize\bfseries\leftmark%
                     \mdseries\tiny\mbox{}\\%
                     \protect\revision%
                  }%
               }%
            ]%
            {%
               \fancyplain{\tiny\revision}%
               {%
                  \rmfamily\bfseries \thepage%
               }%
            }
      \rfoot[%
               \fancyplain{}%
               {%
                  \rmfamily\bfseries \thepage%
               }%
            ]%
            {%
               \fancyplain{}%
               {%
                  \parbox[t]{\markWidth}%
                  {%
                     \raggedleft%
                     \renewcommand{\baselinestretch}{1.2}
                     \footnotesize\bfseries\rightmark%
                     \mdseries\tiny\mbox{}\\%
                     \protect\revision%
                  }%
               }%
            }
   \renewcommand{\footrulewidth}{0.4pt}
   \slidestyle{bottom}
   \renewcommand{\slidelabel}{Slide \theslide}
   \slidesmag{3}
      \setboolean{makeSLIDES}{false}
      \excludeversion{slides}%
      \includeversion{notes}%
      \typeout{^^JMaking NOTES^^J}
   }%
}
\DeclareOption{booklet}{%
  \PassOptionsToClass{twoside,article,10pt,Ha5paper}{seminar}
   \AtEndOfClass%
   {%
      % Half A4 size:
      \special{papersize=148.5mm,210mm}% Tell DVIPS this is a5.
      \geometry{reset, a5paper, portrait, twoside=true, left=10mm,
                     right=15mm, top=9mm, bottom=10.5mm, footskip=8mm,
                     headheight=12pt, headsep=4mm, includemp=false}
      \renewcommand{\headwidth}{\textwidth}%
      \newlength{\markWidth}
      \setlength{\markWidth}{\textwidth}
      \addtolength{\markWidth}{-3.5em}
%%     Enough room for 2 lines in head:
%%    \begin{macrocode}
%%      \addtolength{\headheight}{1.92ex}
%%    \end{macrocode}
\slideplacement{float}
      \lhead[%
               \fancyplain{}%
               {%
               }%
            ]%
            {%
               \fancyplain{}%
               {%
                  \footnotesize\bfseries \college%
               }%
            }%
      \rhead[%
               \fancyplain{}%
               {%
                  \footnotesize\bfseries \subjectNumber \
                  \subject%
               }%
            ]%
            {%
               \fancyplain{}%
               {%
               }%
            }%
      \lfoot[%
               \fancyplain{}%
               {%
                  \parbox[t]{\markWidth}%
                  {%
                     \raggedright%
                     \renewcommand{\baselinestretch}{1.2}%
                     \footnotesize\bfseries\rightmark%
                     \mdseries\tiny\mbox{}\\%
                     \protect\revision%
                  }%
               }%
            ]%
            {%
               \fancyplain{\tiny\revision}%
               {%
                  \rmfamily\bfseries \thepage%
               }%
            }
      \rfoot[%
               \fancyplain{}%
               {%
                  \rmfamily\bfseries \thepage%
               }%
            ]%
            {%
               \fancyplain{}%
               {%
                  \parbox[t]{\markWidth}%
                  {%
                     \raggedleft%
                     \renewcommand{\baselinestretch}{1.2}
                     \footnotesize\bfseries\leftmark%
                     \mdseries\tiny\mbox{}\\%
                     \protect\revision%
                  }%
               }%
            }
   \renewcommand{\footrulewidth}{0.4pt}
   \slidestyle{bottom}
   \renewcommand{\slidelabel}{Slide \theslide}
   \slidesmag{3}
      \setboolean{makeSLIDES}{false}
      \excludeversion{slides}%
      \includeversion{notes}%
      \typeout{^^JMaking BOOKLET-style notes^^J}
   }%
}
\DeclareOption{slidesonly}{%
   \PassOptionsToClass{slidesonly,12pt}{seminar}
   \AtEndOfClass%
   {%
      \typeout{^^JMaking FRAMED SLIDES^^J}
      \renewcommand{\college}{HKTC(TY)}
      \renewcommand{\headwidth}{\textwidth}%
      \renewcommand{\slideleftmargin}{9.5mm}
      \renewcommand{\sliderightmargin}{9.5mm}
      \renewcommand{\slidetopmargin}{17mm}
      \renewcommand{\slidebottommargin}{14mm}
      \setlength{\slideheight}%
                      {\paperwidth-50mm}
      \setlength{\slidewidth}%
                      {\paperheight-\slideleftmargin-2\sliderightmargin}
   \renewcommand{\footrulewidth}{0pt}
   \renewcommand{\headrulewidth}{0pt}
      \lhead{%
               \fancyplain{}%
               {%
                  \scriptsize\bfseries \college \ \subjectNumber \
                  \subject%
               }%
            }%
      \rhead{%
               \fancyplain{}%
               {%
                  \scriptsize\bfseries \theslide%
               }%
            }%
      \lfoot{%
               \fancyplain{\tiny\revision}%
               {%
                  \mdseries\tiny\protect\revision%
               }%
            }
      \rfoot{}
      \setboolean{makeSLIDES}{false}
   \excludeversion{slides}%
   }%
}
\DeclareOption{mechEng}{%
   \AtEndOfClass%
   {%
      \renewcommand{\subject}{Digital Electronics and Microprocessors}
      \renewcommand{\subjectNumber}{ME219}
      \setboolean{mechEng}{true}
      \setboolean{compSc}{false}
      \setboolean{logic}{false}
      \setboolean{elecEng}{false}
      \includeversion{mechEng}%
      \excludeversion{compSc}%
      \excludeversion{elecEng}%
      \excludeversion{logic}%
   }%
}

\DeclareOption{compSc}{%
   \AtEndOfClass%
   {%
      \renewcommand{\subject}{Introduction to Digital \mbox{Technology} and
        \mbox{Processors}}%
      \renewcommand{\subjectNumber}{CMFD\,113}%
      \setboolean{mechEng}{false}%
      \setboolean{logic}{false}%
      \setboolean{elecEng}{false}%
      \setboolean{compSc}{true}%
      \includeversion{compSc}%
      \excludeversion{mechEng}%
      \excludeversion{elecEng}%
      \excludeversion{logic}%
   }%
}
\DeclareOption{logic}{%
   \AtEndOfClass%
   {%
      \renewcommand{\subjectNumber}{EE271}
      \renewcommand{\subject}{Digital Logic and Microprocessors}
      \setboolean{mechEng}{false}
      \setboolean{logic}{true}
      \setboolean{elecEng}{false}
      \setboolean{compSc}{false}
      \excludeversion{compSc}%
      \excludeversion{mechEng}%
      \excludeversion{elecEng}%
      \includeversion{logic}%
   }%
}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{seminar}}
\ProcessOptions
\LoadClass[a4]{seminar}
\RequirePackage{%
   fancyhdr,%
   calc,%
   xspace,%
   lgrind,%
   float,%
   varioref,%
   emlines2,%
   vmargin,%
   geometry,%
   array,%
   nick,%
   ifthen,%
   verbatim,%
   rcs,%
   slidesec,%
   fancybox,%
   version,%
   alltt}
 \RequirePackage[dvips]{graphicx}
\DeclareRobustCommand{\makeslideheading}[1]%
{%
  \begin{center}
     \large\bf
     \shadowbox{#1}%
  \end{center}
  \vspace{1ex minus 1ex}%
}
\setpapersize{A4}
\shiftmargins
\renewcommand{\slidefonts}{\sffamily}
\newcounter{rememberEquation}
\newcounter{slideEquation}
\renewcommand{\everyslide}{\setcounter{rememberEquation}{\value{equation}}%
                           \setcounter{equation}{\value{slideEquation}}}
\addto@hook%
   \after@slide%
   {%
      \setcounter{slideEquation}{\value{equation}}%
      \setcounter{equation}{\value{rememberEquation}}%
   }%
\newboolean{makeSLIDES}
\newboolean{elecEng}
\newboolean{mechEng}
\newboolean{compSc}
\newboolean{logic}
\setboolean{elecEng}{true}
\setboolean{mechEng}{false}
\setboolean{compSc}{false}
\setboolean{logic}{false}
      \excludeversion{compSc}%
      \excludeversion{mechEng}%
      \includeversion{elecEng}%
      \excludeversion{logic}%
\providecommand{\college}{Hong Kong Technical College (Tsing Yi)}
\providecommand{\subject}{Digital Systems and Microprocessors}
\providecommand{\subjectNumber}{EE270}
\providecommand{\department}%
      {Department of Electrical and Communications Engineering}
\providecommand{\up}{microprocessor\xspace}
\providecommand{\Up}{Microprocessor\xspace}
\providecommand{\ie}{i.e.,\xspace}
\providecommand{\eg}{e.g.,\xspace}
\providecommand{\hex}{$_{16}$\xspace}
\providecommand{\overbar}[1]{\ensuremath{\overline{\mathrm{#1}}}}
\pagestyle{fancyplain}
\renewcommand*{\sectionmark}[1]%
{\markboth{\thesection\ #1}{\thesection\ #1}}
\renewcommand*{\subsectionmark}[1]{\markright{\thesubsection\ #1}}
\renewcommand{\thepage}{L\lectureNum-\arabic{page}}
   \renewcommand{\theslide}{\expandafter L\lectureNum\,S-\arabic{slide}}
\newcommand{\LectureTitle}[2]%
{%
   \newcommand{\lectureNum}{{#1}}%
   \newcommand{\lecTitle}{{#2}}
}
\newcommand{\MakeLectureTitle}[1][Lecture]%
{%
   {\LARGE #1 \lectureNum: \lecTitle}%
}
\newcommand{\lectureTitle}[3][Lecture]%
{%
   \newcommand{\lectureNum}{#2}%
   \textbf{\Large #1 #2: #3}%
}
\cfoot{}




\newcommand{\lectureHead}{%
\newlength{\eelogoWidth}%
\newcommand*{\eelogo}{%
  {%
    \includegraphics[height=22.3mm]{eelogo3.eps}% height / \sqrt{2}
  }%
}%
\settowidth{\eelogoWidth}{\eelogo}%
\newlength{\sideWidth}%
\newlength{\logoSep}%
\setlength{\logoSep}{0em}%
\setlength{\sideWidth}{\textwidth}%
\addtolength{\sideWidth}{-\eelogoWidth}%
\addtolength{\sideWidth}{-\logoSep}%
\thispagestyle{plain}%
\noindent\eelogo\hspace{\logoSep}%
\begin{minipage}[b]{\sideWidth}%
  \centering%
  {%
    \large%
    \noindent%
    {\normalsize \college}% Was \Large.
  }\\[1ex]
  {\normalsize \department}\\[1.5ex]\mbox{}
  \subjectNumber\hspace{1em}\subject\par\vspace*{1.5ex}
\end{minipage}\\[2ex]
}%
\floatstyle{ruled}
\newfloat{Figure}{htbp}{lop}
\setcounter{tocdepth}{5}
\renewcommand\@pnumwidth{3.55em}
\renewcommand\@tocrmarg {4.55em}
\endinput
%% 
%% End of file `lect2.cls'.
