%%
%% 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%
   {%
%%                                   now 15mm to allow for holes.
%%                  Strange: set |footskip| to 10.25\,mm, get too much
%%                  space between text and footer.  Set it to 10.24
%%                  and get way too little!  This looks like a bug\ldots
%%                  no, maybe moves a line to the next page\ldots
     \geometry{a4paper, twoside=false, portrait, left=15mm, top=4mm,
       right=10mm, bottom=12mm, headheight=5mm, headsep=12pt,
       footskip=10.25mm}
      \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,dvips,article,12pt}{seminar}
   \AtEndOfClass%
   {%
\geometry{a4paper, left=26mm, top=20mm, right=26mm, bottom=18mm,
  headheight=5mm, headsep=8mm, footskip=13mm, twosideshift=0pt}
      \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,10pt,article,a5paper}{seminar}
   \AtEndOfClass%
   {%
      % Half A4 size:
      \special{papersize=148.5mm,210mm}% Tell DVIPS this is a5.
      \geometry{reset, a5paper, portrait, twoside=true, left=20mm,
                     right=10mm, top=9mm, bottom=10.5mm, footskip=8mm,
                     headheight=12pt, headsep=4mm, includemp=false,
                     verbose=true, twosideshift=0pt}
      \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\bfseries
     \shadowbox{#1}%
  \end{center}
  \vspace{1ex minus 1ex}%
}
\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 Institute of Vocational
        Education (Tsing Yi)}
\providecommand{\subject}{Systems and Network Management}
\providecommand{\subjectNumber}{CMT3321}
\providecommand{\department}%
      {Department of Information and Communication Technology}
\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}% <=========== For EPS
\newcommand*{\eelogo}{%
  {%
     \includegraphics[height=22.3mm]{tylogo1}% height / \sqrt{2} <= EPS
  }%
}%
\settowidth{\eelogoWidth}{\eelogo}% <==== FOR EPS
\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]
}%
%%    \begin{macrocode}
%%\newcommand*{\eelogoWidth}{\tylogoaw}%
%% See p. 458 of the Companion:
%%\newcommand*{\eelogo}{%
%%  {%
%%    \setlength{\fboxsep}{0pt}%
%%    \fbox{\rule{\eelogoWidth}{0pt}\rule{0pt}{\eelogoWidth}}%
%%  }%
%%}
%%
%%    \fbox{\raisebox{15mm}[0pt][\eelogoWidth]{\settylogoa}}
%%    \raisebox{15mm}[0pt][0pt]{\settylogoa}
%%    \includegraphics[height=31.5mm]{eelogo3.eps}%
%%    \end{macrocode}
\floatstyle{ruled}
\newfloat{Figure}{htbp}{lop}
\setcounter{tocdepth}{5}
\renewcommand\@pnumwidth{3.55em}
\renewcommand\@tocrmarg {4.55em}
\endinput
%%
%% End of file `lect2.cls'.
