% \iffalse meta-comment
%
% Copyright 1989-2001 Johannes L. Braams and any individual authors
% listed elsewhere in this file.  All rights reserved.
% 
% This file is part of the Babel system release 3.7.
% --------------------------------------------------
% 
% It may be distributed under the terms of the LaTeX Project Public
% License, as described in lppl.txt in the base LaTeX distribution.
% Either version 1.2 or, at your option, any later version.
% \fi
% \iffalse meta-comment
%
% This package can be used for writing a thesis in the Hebrew/English
% languages, at the Technion --- Israel Institute of Technology.
% 
% Copyright 1994 Irina Abramovici, Taub Computer Center, Technion ---
% Israel Institute of Technology, e-mail ccaiire@tx.technion.ac.il.
%
% Copyright 1997-2000 Boris Lavva, e-mail lavva@tx.technion.ac.il.
% 
% For further copyright information see any other copyright notices in 
% this file.
% 
% This file is contributed to the Babel system release 3.7.
% ---------------------------------------------------------
%   This system is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% 
%   For error reports concerning UNCHANGED versions of this file no
%   more than one year old, see bugs.txt.
% 
%   Please do not request updates from me directly.  Primary
%   distribution is through the CTAN archives.
% 
% 
% IMPORTANT COPYRIGHT NOTICE:
% 
% You are NOT ALLOWED to distribute this file alone.
% 
% You are allowed to distribute this file under the condition that it
% is distributed together with all the files listed in manifest.txt.
% 
% If you receive only some of these files from someone, complain!
% 
% Permission is granted to copy this file to another file with a
% clearly different name and to customize the declarations in that
% copy to serve the needs of your installation, provided that you
% comply with the conditions in the file legal.txt from the LaTeX2e
% distribution.
% 
% However, NO PERMISSION is granted to produce or to distribute a
% modified version of this file under its original name.
%  
% You are NOT ALLOWED to change this file.
% 
% Babel package for LaTeX version 2e
% Copyright (C) 1989 -- 2000 by Johannes Braams,
%                            TeXniek
%                            All rights reserved.
%
%% LaTeX2e hebtech class, derived by Boris Lavva from original hebtech
%% macros created for LaTeX 2.09.
%% 
%% Copyright 1994 Irina Abramovici, Taub Computer Center, Technion ---
%% Israel Institute of Technology, e-mail ccaiire@tx.technion.ac.il.
%%
%% This package can be used for writing a thesis in the Hebrew/English
%% languages, at the Technion --- Israel Institute of Technology.
%%
%% Bugs reports and suggestions should be addressed to 
%% Irina Abramovici, Taub Computer Center, Technion, tel: 04-8293690,
%% e-mail: ccaiire@tx.technion.ac.il 
%% OR 
%% to Boris Lavva, tel: 04-8294659, e-mail: lavva@tx.technion.ac.il.
%% 
%% This package is an experimental meant to answer to the demands of
%% the Graduate School of the Technion --- Israel Institute of
%% Technology.
%% 
% \fi
%
% \CheckSum{1266}
%
% \iffalse
%<hebtech>\NeedsTeXFormat{LaTeX2e}[1996/06/01]
%<hebtech>\ProvidesClass{hebtech}
%<*driver>
\ProvidesFile{hebtech.drv}
%</driver>
% \fi
% \ProvidesFile{hebtech.dtx}
        [1997/12/09 v.1.0a Technion thesis class]
%
% \iffalse
% \subsection{A driver for this document}
%
% The next bit of code contains the documentation driver file for
% \TeX{}, i.e., the file that will produce the documentation you are
% currently reading. It will be extracted from this file by the \dst{}
%  program.
%
%    \begin{macrocode}
%<*driver>
\documentclass{ltxdoc}
\title{Hebrew/English thesis class for \LaTeXe}
\author{Boris Lavva\\%
        Original version for \LaTeX2.09 by Irina Abramovici}
\date{Printed \today}
\begin{document}
   \maketitle
   \DocInput{hebtech.dtx}
\end{document}
%</driver>
%    \end{macrocode}
% \fi
%
% \providecommand\scrunch{\setlength{\itemsep}{-.05in}}
% \providecommand\babel{\textsf{babel}}
% \providecommand\file[1]{\texttt{#1}}
% \providecommand\pkg[1]{\texttt{#1}}
% \GetFileInfo{hebtech.dtx}
%
% \changes{hebtech~0.1}{1994/??/??}{%
%    Initial version. Provides \texttt{hebtech.sty} style file for
%    \LaTeX 2.09 with support for old 7-bit encoding only. Only
%    English language thesis with Hebrew cover, title and abstract
%    pages is supported (by Irina Abramovici)} 
% \changes{hebtech~1.0a}{1998/12/09}{%
%    \LaTeXe\ changes and updates. Now it is \texttt{hebtech.cls}
%    \LaTeXe\ document class, which supports all available input and
%    font encodings and thesis written both in Hebrew and English
%    (by Boris Lavva)}
%
% \section{Writing Hebrew/English thesis with \LaTeXe}^^A
% \label{sec:hebtech}
%
%    The file \file{\filename}\footnote{The Hebrew/English thesis
%    class for \LaTeXe{} described in this section have version number
%    \fileversion\ and were last revised on \filedate.} can be useful
%    for writing a thesis or dissertation in both Hebrew and English
%    languages, at the Technion --- Israel Institute of Technology.
%    This package is an experimental meant to answer to the demands of
%    the Graduate School of the Technion, but can be easily adjusted
%    (I hope) for writing theses at other academic institutions at
%    Israel.
%
%    Original version of this style (called \pkg{hebtech.sty}) for
%    \LaTeX2.09 was written in April 1994 by Irina Abramovici from the
%    Taub Computer Center, Technion and was updated for \LaTeXe{} with
%    \babel{} support by Boris Lavva. The thesis class can be used for
%    English documents with a number of Hebrew parts, and for Hebrew
%    documents with a number of English parts. In addition, any other
%    languages supported by \babel\ can be used freely in thesis.
%
% \StopEventually{}
%
% \subsection{Common definitions}
%
%    We use standard \LaTeXe{} \pkg{report} class as the base of our
%    \pkg{hebtech} class. A thesis should be printed in A4 paper,
%    using $12pt$ fonts, one-sided.
%    \begin{macrocode}
%<*hebtech>
\ExecuteOptions{a4paper,12pt,oneside,onecolumn,final,openany}
%    \end{macrocode}
%    Sometimes, during thesis writing, one want to print a draft
%    version. So, the \texttt{draft} option is provided:
%    \begin{macrocode}
\DeclareOption{draft}{%
  \PassOptionsToPackage{all,light}{draftcopy}
  \PassOptionsToClass{draft}{report}
  \AtEndOfClass{\RequirePackage{draftcopy}}}
%    \end{macrocode}
%    We pass all options to the \pkg{report} class and load it.
%    \begin{macrocode}
\DeclareOption*{%
  \PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions
\LoadClass{report}
%    \end{macrocode}
%    Double spacing is required by the Graduate School, so we include
%    \pkg{setspace} package. This is supported \LaTeXe{} package and
%    can be found on CTAN.
%    \begin{macrocode}
\RequirePackage{setspace}
\AtBeginDocument{\doublespacing}
%    \end{macrocode}
%    Thesis should be bilingual and use Hebrew and English by
%    default. If you want to add other languages, pass them as options
%    to class, for example:
%    \begin{quote}
%    |\documentclass[russian,spanish,greek]{hebtech}|
%    \end{quote}
%    Note, that hebrew is the last language in |\RequirePackage| line,
%    and will be used by default at the beginning of document.
%    \begin{macrocode}
\RequirePackage[english,hebrew]{babel}
%    \end{macrocode}
%    We have to print Jewish date in addition to Gregorian one. Hence,
%    the \pkg{hebcal} package will be used.
%    \begin{macrocode}
\RequirePackage{hebcal}
%    \end{macrocode}
%
%  \begin{macro}{\Hebrewdate}
%  \begin{macro}{\FormatForEnglish}
%  \begin{macro}{\FormatForHebrew}
%  \begin{macro}{\HebrewMonthNameInEnglish}
%    |\HebrewDate{|\emph{day}|}{|\emph{month}|}{|\emph{year}|}| macro
%    and two additional macros |\Format|\-|For|\-|English| and
%    |\FormatForHebrew| from the \pkg{hebcal} package should be
%    redefined to print ``short'' date (without day).
%
%    We found that |\MakeUppercase| command for \LaTeXe does not work
%    with |hebcal| macros, so we have to redefine
%    |\HebrewMonthNameInEnglish| to print Hebrew months in uppercase.
%    \begin{macrocode}
\renewcommand{\Hebrewdate}[3]{% 
  \HebrewFromGregorian{#1}{#2}{#3}
     {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
  \if@rl%           Hebrew (right-to-left) mode 
     \FormatForHebrew{\Hebrewmonth}{\Hebrewyear}% 
  \else%            English mode 
     \FormatForEnglish{\Hebrewmonth}{\Hebrewyear}%
  \fi}
\renewcommand{\FormatForEnglish}[2]{% 
  \HebrewMonthNameInEnglish{#1}{#2}, \space\number#2}
\renewcommand{\FormatForHebrew}[2]{% 
  \HebrewMonthName{#1}{#2} \space\HebrewYearName{#2}}
\renewcommand{\HebrewMonthNameInEnglish}[2]{%
  \ifnum #1 = 7%
     \CheckLeapHebrewYear{#2}%
     \if@HebrewLeap ADAR II\else ADAR\fi%
  \else%
     \ifcase #1%
        % nothing for 0
        \or TISHREI%
        \or HESHVAN%
        \or KISLEV%
        \or TEBETH%
        \or SHEBAT%
        \or ADAR I%
        \or ADAR II%
        \or NISAN%
        \or IYAR%
        \or SIVAN%
        \or TAMMUZ%
        \or AV%
        \or ELUL%
     \fi
  \fi}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\engmonth}
%  \begin{macro}{\Gregoriandate}
%    Gregorian date will be printed with the aid of new macro
%    |\Gregoriandate{|\emph{day}|}| |{|\emph{month}|}{|^^A
%    \emph{year}|}|
%    which is similar to |\Hebrewdate| defined above. The name of
%    Gregorian month in English is created by |engmonth| macro,
%    defined below, and in Hebrew -- by |hebmonth| macro, defined in
%    the \pkg{hebrew.ldf} Hebrew language definition file.
%    \begin{macrocode}
\newcommand\engmonth[1]{%
  \ifcase#1\or January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi}
\newcommand{\Gregoriandate}[3]{%
  \if@rl%
     \hebmonth{#2} \space{\beginL\number#3\endL}%
  \else%
     \engmonth{#2}, \space{\number#3}%
  \fi}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\date}
%    To provide the automatic calculation of Gregorian and Hebrew
%    dates, we define 3 new counts: |\dd| for `day', |\mm| for `month',
%    and |\yy| for `year'. Their initial value will be |\today|'s day,
%    month and year. An user can provide his/her own date with changed
%    command |\date{|\emph{day}|}{|\emph{month}|}{|\emph{year}|}|.
%    \begin{macrocode}
\newcount\dd \newcount\mm \newcount\yy
\dd=\number\day \mm=\number\month \yy=\number\year
\renewcommand{\date}[3]{\dd=#1 \mm=#2 \yy=#3}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\captionsenglish}
%  \begin{macro}{\captionshebrew}
%    Here we provide the default acknowledgment name in English and
%    Hebrew for use in thesis acknowledgment pages, change the
%    default bibliography name to ``References'' and add a number of
%    useful captions in English and Hebrew for use in mathematical
%    manuscripts with \LaTeX\ and \AmSTeX.
%    \begin{macrocode}
\addto\captionsenglish{%
  \def\acknowledgmentname{Acknowledgment}%
  \def\bibname{References}%
  \def\continuedname{Cont'd}%
  \def\definitionname{Definition}%
  \def\theoremname{Theorem}%
  \def\lemmaname{Lemma}%
  \def\claimname{Claim}%
  \def\corollaryname{Corollary}%
  \def\axiomname{Axiom}%
  \def\assumptionname{Assumption}%
  \def\examplename{Example}%
  \def\propertyname{Property}%
  \def\remarkname{Remark}%
  \def\problemname{Problem}%
  \def\algorithmname{Algorithm}%
}
%    \end{macrocode}
%
%    \begin{macrocode}
\addto\captionshebrew{%
  \def\acknowledgmentname{\he\kaf\resh\tav\ \tav\vav\dalet\he}%
  \def\bibname{\resh\shin\yod\mem\tav\ \mem\qof\vav\resh\vav\tav}%
  \def\continuedname{\he\mem\shin\finalkaf}%
  \def\definitionname{\he\gimel\dalet\resh\he}%
  \def\theoremname{\mem\shin\pe\tet}%
  \def\lemmaname{\lamed\mem\he}%
  \def\claimname{\tet\ayin\nun\he}%
  \def\corollaryname{\mem\samekh\qof\nun\he}%
  \def\axiomname{\alef\qof\samekh\yod\vav\mem\he}%
  \def\assumptionname{\he\nun\het\he}%
  \def\examplename{\dalet\vav\gimel\mem\he}%
  \def\propertyname{\tav\kaf\vav\nun\he}%
  \def\remarkname{\he\ayin\resh\he}%
  \def\problemname{\bet\ayin\yod\he}%
  \def\algorithmname{\alef\lamed\gimel\vav\resh\yod\tav\finalmem}%
}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\@makeschapterhead}
%    Let unnumbered |\chapter*|'s header be centered.
%    \begin{macrocode}
\def\@makeschapterhead#1{%   % Heading for \chapter* command
  \vspace*{50\p@}%           % Space at top of text page.
  {\parindent \z@ \centering % Center the header
    \normalfont
    \interlinepenalty\@M
    \huge \bfseries #1\par   % Title.
    \nobreak                 % TeX penalty to prevent page break.
    \vskip 40\p@             % Space between title and text.
  }}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\bchapternn}
%    For writer's convenience: unnumbered |\chapter*| will write to
%    English (\texttt{.toc}) and Hebrew (\texttt{.cot}) table of
%    contents.
%    \begin{macrocode}
\renewcommand{\bchapternn}[2]{\chapter*{%
    \protect\if@rl #1\protect\else #2\protect\fi%
    \@mkboth{\MakeUppercase{\protect\if@rl #1\protect\else 
                                           #2\protect\fi}}%
            {\MakeUppercase{\protect\if@rl #1\protect\else 
                                           #2\protect\fi}}}
  \addcontentsline{toc}{chapter}{%
    \protect\hspace{-1.5em}\protect\numberline{}%
    \protect\if@rl #1\protect\else #2\protect\fi}
  \addcontentsline{cot}{chapter}{%
    \protect\hspace{-1.5em}\protect\numberline{}%
    \protect\if@rl #1\protect\else #2\protect\fi}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\thebibliography}
%    For writer's convenience too: bibliography chapter will write to
%    English (\texttt{.toc}) and Hebrew (\texttt{.cot}) table of
%    contents.
%    \begin{macrocode}
\let\@@thebibliography\thebibliography
\def\thebibliography{%
  \addcontentsline{toc}{chapter}{\protect\hspace{-1.5em}\protect{%
      \bfseries\protect\numberline{}\protect\bibname}}
  \addcontentsline{cot}{chapter}{\protect\hspace{-1.5em}\protect{%
      \bfseries\protect\numberline{}\protect\bibname}}
  \@@thebibliography}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\bcaptionf}
%    We define a bilingual Hebrew and English caption for figures.
%
%    Usage: |\bcaptionf{|\emph{Heb caption}|}{|\emph{Eng caption}|}|.
%    \begin{macrocode}
\newcommand{\bcaptionf}[2]{%
  \caption[\protect\if@rl \R{#1}\protect\else \L{#2}\protect\fi]{%
    \if@rl\R{#1} \protect\\ \L{Figure~\thefigure: #2}
    \else\L{#2} \protect\\ \R{\alef\yod\vav\resh~\thefigure: #1}
    \fi}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\bcaptionff}
%    Extended bilingual Hebrew and English caption for figures.
%
%    Usage: |\bcaptionff{|\emph{to Heb LOF}|}{|\emph{to Eng LOF}^^A
%           |}{|\emph{Heb caption}|}{|\emph{Eng caption}|}|.
%    \begin{macrocode}
\newcommand{\bcaptionff}[4]{%
  \caption[\protect\if@rl \R{#1}\protect\else \L{#2}\protect\fi]{%
    \if@rl\R{#3}\protect\\ \L{Figure~\thefigure: #4}
    \else\L{#4}\protect\\ \R{\alef\yod\vav\resh~\thefigure: #3}
    \fi}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\bcaptiont}
%    Bilingual Hebrew and English caption for tables (short variant).
%
%    Usage: |\bcaptiont{|\emph{Heb caption}|}{|\emph{Eng caption}|}|.
%    \begin{macrocode}
\newcommand{\bcaptiont}[2]{%
  \caption[\protect\if@rl \R{#1}\protect\else \L{#2}\protect\fi]{%
    \if@rl\R{#1} \protect\\ \L{Table~\thetable: #2}
    \else\L{#2} \protect\\ \R{\tet\bet\lamed\he~\thetable: #1}
    \fi}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\bcaptiontt}
%    Extended bilingual Hebrew and English caption for tables.
%
%    Usage: |\bcaptiontt{|\emph{to Heb LOT}|}{|\emph{to Eng LOT}^^A
%           |}{|\emph{Heb caption}|}{|\emph{Eng caption}|}|.
%    \begin{macrocode}
\newcommand{\bcaptiontt}[4]{%
  \caption[\protect\if@rl \R{#1}\protect\else \L{#2}\protect\fi]{%
    \if@rl\R{#3} \protect\\ \L{Table~\thetable: #4}
    \else\L{#4} \protect\\ \R{\tet\bet\lamed\he~\thetable: #3}
    \fi}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{thestype}
%    The meaning of |thestype| counter is:
%    \begin{description}\scrunch^^A
%       \item[1] for a research thesis,
%       \item[2] for a project thesis,
%       \item[3] for a final paper.
%    \end{description}  
%    \begin{macrocode}
\newcounter{thestype}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{grade}
%    The meaning of |grade| counter is:
%    \begin{description}\scrunch^^A
%       \item[1] for master of science, 
%       \item[2] for master,
%       \item[3] for master of technology, 
%       \item[4] for doctor of science.
%    \end{description}  
%    \begin{macrocode}
\newcounter{grade}
%    \end{macrocode}
%  \end{macro}
%
% \subsection{Parameters for title pages}
%
%     All following macros are defined with 2 obligatory parameters:
%     first is the Hebrew version and second is the English one. For
%     example, for |\title| macro:
%     \begin{quote}
%     |\title{Hebrew title}{English title}|
%     \end{quote}
% 
%  \begin{macro}{\title}
%    Thesis or dissertation's title.
%    \begin{macrocode}
\def\title#1#2{\gdef\@@titleh{#1}\gdef\@@title{#2}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\author}
%    The author(s) of thesis or dissertation.
%    \begin{macrocode}
\def\author#1#2{\gdef\@@authorh{#1}\gdef\@@author{#2}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\dept}
%    The name of faculty, for example, ``Electrical Engineering
%    Department''.
%    \begin{macrocode}
\def\dept#1#2{\gdef\@@depth{#1}\gdef\@@dept{#2}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\dom}
%    The domain of research, for example, ``Computer Engineering''.
%    \begin{macrocode}
\def\dom#1#2{\gdef\@@domh{#1}\gdef\@@dom{#2}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\advisori}
%    The name of advisor (or the main advisor if there are two).
%    \begin{macrocode}
\def\advisori#1#2{\gdef\@@advisorih{#1}\gdef\@@advisori{#2}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\advisorii}
%    The name of the second advisor, if exists.
%    \begin{macrocode}
\def\advisorii#1#2{\gdef\@@advisoriih{#1}\gdef\@@advisorii{#2}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\donori}
%    The name of the person or institution which granted help in the
%    form of scholarship, if any.
%    \begin{macrocode}
\def\donori#1#2{\gdef\@@donorih{#1}\gdef\@@donori{#2}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\donorii}
%    The name of the second person or institution which granted help
%    in the form of scholarship, if any.
%    \begin{macrocode}
\def\donorii#1#2{\gdef\@@donoriih{#1}\gdef\@@donorii{#2}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\donor}
%    User-defined line to replace the default one: ``The generous
%    financial help of \ldots{} is gratefully acknowledged''. If no
%    scholarship or other financial help need to be acknowledged, this
%    macro should be included and empty, i.e.\ |\donor{}{}|.
%    \begin{macrocode}
\def\donor#1#2{\gdef\@donorh{#1}\gdef\@donor{#2}}
%    \end{macrocode}
%  \end{macro}
%
% \subsection{English part}
%
%    Here we define all internal macros that will be needed for cover,
%    title, and acknowledgment pages in the English language version.
%    The |\@line|\ldots{}, |\@thestype| and |\@donor| macros are very
%    Technion-related and should be redefined when adjusting this
%    class for another academic institution.
%    \begin{macrocode}
\def\@@title{}
\def\@@author{}
\def\@@dom{}
\def\@@advisori{}
\def\@@advisorii{}
\def\@@donori{}
\def\@@donorii{}
\def\@donor{}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@thestype{%
   \ifcase\value{thestype}%
   \or \MakeUppercase{Research Thesis}%
   \or \MakeUppercase{Project Thesis}%
   \or \MakeUppercase{Final Paper} \else {}\fi}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@linei{%
  \MakeUppercase{Submitted in Partial Fulfillment 
                 of the Requirements}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@lineii{%
   \ifcase\value{grade}%
        \or \MakeUppercase{For the Degree of Master of Science}
        \or \MakeUppercase{For the Degree of Master}
        \or \MakeUppercase{For the Degree of Master of Technology}
        \or \MakeUppercase{For the Degree of Doctor of Science} 
        \else {}\fi}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@lineiii{%
  \if\@@dom\else%
     \ifcase\value{grade}%
        \or \MakeUppercase{in} \MakeUppercase{\@@dom}%
        \or \MakeUppercase{in} \MakeUppercase{\@@dom}%
        \or \MakeUppercase{in} \MakeUppercase{\@@dom}%
        \else{}\fi%
  \fi}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@lineiv{\mbox{\hspace{-.2in}\footnotesize\MakeUppercase{%
      Submitted to the Senate of the Technion --- %
      Israel Institute of Technology}}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@linev{\footnotesize{\Hebrewdate{\dd}{\mm}{\yy}%
            \hfill\MakeUppercase{Haifa}\hfill%
            \MakeUppercase{\Gregoriandate{\dd}{\mm}{\yy}}}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@linevi{\MakeUppercase{This}\ 
             \@thestype\
             \MakeUppercase{was supervised by}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@linevii{\MakeUppercase{under the auspices of the}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@donor{%
  \MakeUppercase{The generous financial help of}\ %
  \MakeUppercase{\@@donori}\ %
  \ifx\empty\@@donorii\else\MakeUppercase{and \@@donorii{} }\fi%
  \MakeUppercase{is gratefully acknowledged}}
%    \end{macrocode}
%
% \subsection{Hebrew part}
%
%    Here we define all internal macros that will be needed for cover,
%    title, and acknowledgment pages in the Hebrew language version.
%    The |\@line|\ldots|h|, |\@thestypeh| and |\@donorh| macros are
%    very Technion-related and should be redefined when rewriting this
%    class for another academic institution.
%    \begin{macrocode}
\def\@@titleh{}
\def\@@authorh{} 
\def\@@depth{}
\def\@@domh{} 
\def\@@advisorih{}
\def\@@advisoriih{} 
\def\@@donorih{}
\def\@@donoriih{} 
\def\@donorh{}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@thestypeh{% 
   \ifcase\value{thestype}% 
   \or \het\yod\bet\vav\resh\ \ayin\lamed\ \mem\het\qof\resh%
   \or \het\yod\bet\vav\resh\ \ayin\lamed\ \pe\resh\vav\yod\qof\tet%
   \or \ayin\bet\vav\dalet\tav\ \gimel\mem\resh \else {}\fi} 
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@lineih{%
  \lamed\shin\finalmem\ \mem\yod\lamed\vav\yod\ \het\lamed\qof\yod\ %
  \shin\lamed\ \he\dalet\resh\yod\shin\vav\tav\ %
  \lamed\qof\bet\lamed\tav\ \tav\vav\alef\resh{}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@lineiih{% 
   \ifcase\value{grade}% 
        \or \mem\gimel\yod\samekh\tet\resh\ %
            \lamed\mem\dalet\ayin\yod\finalmem%
        \or \mem\gimel\yod\samekh\tet\resh% 
        \or \mem\gimel\yod\samekh\tet\resh\ %
            \bet\tet\kaf\nun\vav\lamed\vav\gimel\yod\he%
        \or \dalet\qof\tet\vav\resh\ %
            \lamed\mem\dalet\ayin\yod\finalmem%
        \else {}\fi} 
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@lineiiih{% 
   \ifcase\value{grade}% 
     \or \@@domh% 
     \or \@@domh% 
     \or \@@domh% 
     \else{}\fi} 
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@lineivh{\he\vav\gimel\shin\ \lamed\samekh\nun\tet\ %
             \he\tet\kaf\nun\yod\vav\finalnun\ \textemdash\ %
             \mem\kaf\vav\finalnun\ %
             \tet\kaf\nun\vav\lamed\vav\gimel\yod\ %
             \lamed\yod\shin\resh\alef\lamed}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@linevh{\Hebrewdate{\dd}{\mm}{\yy}%
             \hfill\het\yod\pe\he\hfill%
             \Gregoriandate{\dd}{\mm}{\yy}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@linevih{% 
   \ifcase\value{thestype}% 
   \or \@thestypeh{} \nun\ayin\shin\he% 
   \or \@thestypeh{} \nun\ayin\shin\he% 
   \or \@thestypeh{} \nun\ayin\shin\tav\he\else{}\fi} 
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@lineviih{\bet\he\dalet\resh\kaf\tav{}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@donorh{\alef\nun\yod\ \mem\vav\dalet\he{}
  \lamed\@@donorih{}
  \ifx\empty\@@donoriih\else\vav\lamed\@@donoriih{} \fi
  \ayin\lamed\ \he\tav\mem\yod\kaf\he\ \he\kaf\samekh\pe\yod\tav\ %
  \he\nun\dalet\yod\bet\he\ \bet\he\shin\tav\lamed\mem\vav\tav\yod}%
%    \end{macrocode}
%
% \subsection{User-level commands and macros}
%
%    The following 3 macros: |\frontmatter|, |\mainmatter| and
%    |\backmatter| should be used to divide a thesis to 3 parts:
%    \begin{enumerate}\scrunch
%       \item Hebrew cover, title, acknowledgment, TOC, LOF, LOT when
%             the main language of the document will be Hebrew
%             \textbf{OR}
%             English cover, etc.\ when the main language of the
%             document will be English.\\ This part will be with hebrew
%             page numbering if in Hebrew and with roman page
%             numbering if in English.
%       \item The main part (in Hebrew or in English) will be with
%             arabic page numbering.
%       \item The opposite to the first part:\\
%             English cover, title, acknowledgment, TOC, LOF, LOT when
%             the main language of the document was Hebrew 
%             \textbf{OR} Hebrew
%             cover, etc.\ when the main language of the document was
%             English.\\ This part will be with roman page numbering
%             if in English and with hebrew page numbering if in
%             Hebrew.
%    \end{enumerate}
%
%  \begin{macro}{\frontmatter}
%    Should be used at the beginning of the first part
%    (for example, after the Hebrew |\makecover|).
%    \begin{macrocode}
\newcommand\frontmatter{%
  \if@openright\cleardoublepage\else\clearpage\fi%
  \if@rl\pagenumbering{alph}\else\pagenumbering{roman}\fi}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\mainmatter}
%    Should be used at the beginning of the second part
%    (for example, after the Hebrew \emph{abstract}).
%    \begin{macrocode}
\newcommand\mainmatter{%
  \if@openright\cleardoublepage\else\clearpage\fi%
  \pagenumbering{arabic}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\backmatter}
%    Should be used at the beginning of the third part
%    (for example, after the English |\makecover|).
%    \begin{macrocode}
\let\backmatter\frontmatter
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\makecover}
%    This command is similar to |\maketitle| and builds a standard
%    thesis cover with title and author. The cover will be in Hebrew
%    when in Hebrew mode, and in English when in English mode.
%    \begin{macrocode}
\newcommand{\makecover}{%
  \begin{titlepage}
    \thispagestyle{empty}
    \null\vskip.8truein
    \begin{doublespace}
      \begin{center}
        \bfseries\if@rl\Huge\@@titleh
        \else\LARGE\MakeUppercase{\@@title}\fi
        \vskip2.7truein
        \if@rl\huge\@@authorh
        \else\LARGE\MakeUppercase{\@@author}\fi
      \end{center}
    \end{doublespace}
    \vfill\null
  \end{titlepage}
  \thispagestyle{empty}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\maketitle}
%    This updated command builds a standard thesis title page. It will
%    be in Hebrew when in Hebrew mode, and in English when in English
%    mode.
%    \begin{macrocode}
\renewcommand{\maketitle}{%
  \if@openright\cleardoublepage\else\clearpage\fi
  \thispagestyle{empty}
  \begin{doublespace}
    \begin{center}
      \bfseries\if@rl\huge\@@titleh
      \else\Large\MakeUppercase{\@@title}\fi
    \end{center}
    \vfill
    \begin{center}
      \if@rl\Large\@thestypeh\else\large\@thestype\fi
    \end{center}
    \vfill 
    \begin{center}
      \if@rl\large
         \@lineih\\
         \@lineiih\\
         \@lineiiih
      \else\large
         \@linei\\
         \@lineii\\
         \@lineiii\fi
    \end{center}
    \vfill%
    \begin{center}
      \bfseries\if@rl\LARGE\@@authorh
      \else\Large\MakeUppercase{\@@author}\fi
    \end{center}
    \vfill 
    \begin{center}
      \if@rl\large
         \@lineivh\\ 
         \@linevh
      \else
         \@lineiv\\
         \@linev\fi
    \end{center}
  \end{doublespace}
  \newpage\thispagestyle{empty}}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{environment}{acknowledgment}
%    The acknowledgment environment is defined to help a writer to
%    add his/her customized acknowledgment to the third page (after
%    the cover and title pages). The acknowledgment will be in Hebrew
%    when in Hebrew mode, and in English when in English mode.
%
%    For example:
%    \begin{verbatim}
%       \begin{acknowledgment}
%          I want to ``thank'' my committee,\\
%          without whose ridiculous demands,\\
%          I would have graduated so, so, very much faster.
%       \end{acknowledgment}
%    \end{verbatim}
%    \begin{macrocode}
\newenvironment{acknowledgment}{%
  \if@openright\cleardoublepage\else\clearpage\fi
  \thispagestyle{empty}% 
  \begin{center}
    \if@rl\large
      \@linevih{}
      \@lineviih{}
      \@@advisorih{}
      \ifx\empty\@@advisoriih\else\vav\@@advisoriih{} \fi\\
      \@@depth
    \else
      \@linevi{}
      \MakeUppercase{\@@advisori}\ %
      \ifx\empty\@@advisorii\else\MakeUppercase{and \@@advisorii{} }\fi
      \@linevii{}
      \MakeUppercase{\@@dept}
    \fi
  \end{center}
  \vfill
  \begin{center}%
    \if@rl\LARGE\acknowledgmentname%
    \else\Large\MakeUppercase{\acknowledgmentname}\fi
  \end{center}
  \vspace{2\baselineskip}
  \begingroup\large}
{\endgroup\vfill
  \begin{center}
    \if@rl\large\@donorh\else\@donor\fi
  \end{center}
  \newpage\normalsize\thispagestyle{empty}}
%    \end{macrocode}
%  \end{environment}
%
%  \begin{environment}{dedication}
%    The dedication environment is similar to the previous one and
%    defined to help a writer to add his/her dedication page (fourth
%    page -- after the cover, title and acknowledgment  pages). 
%    The dedication will be in Hebrew when in Hebrew mode, and in
%    English when in English mode.
%
%    For example:
%    \begin{verbatim}
%       \begin{dedication}
%          To myself,\\
%          John W. Smith,\\
%          the only person worthy of my company.
%       \end{dedication}
%    \end{verbatim}
%    \begin{macrocode}
\newenvironment{dedication}{%
  \thispagestyle{empty}% 
  \vspace*{2\baselineskip}
  \begin{center}\large}
  {\end{center}
  \newpage\normalsize\thispagestyle{empty}}
%    \end{macrocode}
%  \end{environment}
%
%  \begin{environment}{abstract}
%    Builds standard abstract and adds title in Hebrew when in Hebrew
%    mode, and in English when in English mode.
%    \begin{macrocode}
\renewenvironment{abstract}{%
  \if@openright\cleardoublepage\else\clearpage\fi%
  \if@rl\bchapternn{\abstractname}{Hebrew Abstract}
  \else\bchapternn{\tav\qof\tsadi\yod\resh\ %
                   \bet\alef\nun\gimel\lamed\yod\tav}
                  {\abstractname}\fi%
  \begingroup}{%
  \newpage\endgroup}
%    \end{macrocode}
%  \end{environment}
%
%
%  \begin{macro}{\ps@thesis}
%    Define the ``thesis'' page style which is based on the standard
%    |\ps@headings|, but adds a thick horisontal rule to running
%    headings. The following line should be added to the document's
%    preamble:
%    \begin{quote}
%       |\pagestyle{thesis}|
%    \end{quote}
%    \begin{macrocode}
\def\ps@thesis{%
  \def\headeven{\protect\rule[-4pt]{\textwidth}{.5pt}\kern-\textwidth%
                \protect\if@rl\beginR\thepage\hfil{%
                              \bfseries\rightmark}\endR%
                \protect\else\thepage\hfil{%
                             \bfseries\leftmark}\protect\fi}
  \def\headodd{\protect\rule[-4pt]{\textwidth}{.5pt}\kern-\textwidth%
               \protect\if@rl\beginR{\bfseries\leftmark}%
                             \hfil\thepage\endR%
               \protect\else{\bfseries\rightmark}%
                             \hfil\thepage\protect\fi}
  \ps@headings}
%    \end{macrocode}
%  \end{macro}
%
%    Set up page layout.
%
%  \begin{macro}{\textheight}
%  \begin{macro}{\textwidth}
%    Height and width of the main body of the text.
%    \begin{macrocode}
\setlength{\textheight}{8.25in}
\setlength{\textwidth}{6.0in}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\topmargin}
%    Margin on top of page.
%    \begin{macrocode}
\setlength{\topmargin}{0pt}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\headsep}
%    Space between header and top of body (for more details, see 
%    \emph{``The \LaTeX{} Companion''} book, p.~85).
%    \begin{macrocode}
\setlength{\headsep}{.5in}
\addtolength{\headsep}{-\headheight}
%    \end{macrocode}
%  \end{macro}
%
%  \begin{macro}{\oddsidemargin}
%  \begin{macro}{\evensidemargin}
%    Margins on the left for odd pages and on the right for even
%    pages.
%    \begin{macrocode}
\setlength{\oddsidemargin}{.25in}
\setlength{\evensidemargin}{.25in}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\marginparwidth}
%  \begin{macro}{\marginparsep}
%    Parameters for marginal notes: width of marginal notes and space
%    between marginal notes and text. 
%    \begin{macrocode}
\setlength{\marginparwidth}{40pt}
\setlength{\marginparsep}{10pt}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%    \begin{macrocode}
\brokenpenalty=10000
%</hebtech>
%    \end{macrocode}
%
% \Finale
%%
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
\endinput
