\NeedsTeXFormat{LaTeX2e}

\ProvidesClass{ntnu}[1996/05/08 Dokumentmaler for NTNU]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Opsjoner

\DeclareOption{moteinnk}{\def\@ramme{moteinnk}}\def\ntnu@moteinnk{moteinnk}
\DeclareOption{moteref}{\def\@ramme{moteref}}\def\ntnu@moteref{moteref}
\DeclareOption{telefax}{\def\@ramme{telefax}}\def\ntnu@telefax{telefax}
\DeclareOption{ark}{\def\@ramme{ark}}\def\ntnu@ark{ark}
\DeclareOption{notat}{\def\@ramme{notat}}\def\ntnu@notat{notat}
\DeclareOption{brev}{\def\@ramme{brev}}\def\ntnu@brev{brev}
\DeclareOption{ISOdato}{\def\idag{\ISOidag}}\def\idag{\NORidag}

\newcommand{\Surround}[3]{%
  \begingroup
    \toks1=\expandafter{#1}%
    \toks2={#2}%
    \toks3={#3}%
    \edef\act{\def\noexpand#1{\the\toks2 \the\toks1 \the\toks3 }}%
  \expandafter\endgroup\act}

\newcommand{\AtEndOf}[3]{%
  \expandafter\Surround\csname end#1\endcsname{#2}{#3}}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{letter}
                \PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Laste letter eller article
\ifx\@ramme\ntnu@brev
   \LoadClass{letter}
   \def\lastpage@ref{lastpage\the\count1}
   \AtEndOf{letter}{\label{\lastpage@ref}}{\global\advance\count1 1 }
   \def\AntallSider{\pageref{\lastpage@ref}}
   \advance\voffset by -0.6cm  % Hvorfor? Si det ... 
\else
   \LoadClass{article}
   \AtEndDocument{\label{lastpage@ref}}
   \def\AntallSider{\pageref{lastpage@ref}}
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Laste andre pakker

\RequirePackage{epsfig}
\RequirePackage{times}
\RequirePackage{fancyhdr}
%\RequirePackage[english,norsk]{babel} % Changed by KO
\RequirePackage[english,french,dutch,german,polish,nynorsk,norsk]{babel}
               % Hovedspraaket er det sist
               % nevnte.  \selectlanguage{english}
               % maa skje etter \begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Babelisering:
\addto\extrasnorsk{%
  \def\ntnu@@ntnu {Norges teknisk-\\naturvitenskapelige universitet}%
  \def\ntnu@@tele {Telefon}%
  \def\ntnu@@epost{E-post}%
  \def\ntnu@@fax  {Telefax}%
  \def\ntnu@@besad{Bes{\o}ksadresse}%
  \def\ntnu@@posad{Postadresse}%
  \def\ntnu@@vdato{\kern-0.15em V{\aa}r dato}%
  \def\ntnu@@vref {V{\aa}r ref.}%
  \def\ntnu@@ddato{Deres dato}%
  \def\ntnu@@dref {Deres ref.}%
  \def\ntnu@@saksb{Saksbehandler}%
  \def\ntnu@@til  {Til}%
  \def\ntnu@@fra  {Fra}%
  \def\ntnu@@kopi {Kopi}%
  \def\ntnu@@om   {Om}%
  \def\ntnu@@mref {M{\o}tereferat}%
  \def\ntnu@@tilst{Til stede}%
  \def\ntnu@@refnt{Referent}%
  \def\ntnu@@mtid {M{\o}tetid}%
  \def\ntnu@@msted{M{o}tested}%
  \def\ntnu@@sider{Sider inkl.~denne}%
  \def\ntnu@@sideav#1#2{Side #1 av #2}%
  \def\ntnu@@klage{Hvis du ikke mottar alle sidene ring}%
  \def\ntnu@@meldg{Melding}%
  \def\ntnu@@notat{Notat}%
  \def\ntnu@@dato {Dato}%
  \def\ntnu@@arkiv{Arkiv}%
  \def\tlfprefix{}%
  \def\pnrprefix{}%
  \def\Norge{}% Til {\aa} hekte bakp{\aa} postadressen
}
\addto\extrasnynorsk{%
  \extrasnorsk
  \def\ntnu@@ntnu {Noregs teknisk-\\naturvitskaplege universitet}%
  \def\ntnu@@ddato{Dykkar dato}%
  \def\ntnu@@dref {Dykkar ref.}%
  \def\ntnu@@saksb{Saksbehandlar}%
  \def\ntnu@@fra  {Fr{\aa}}%
  \def\ntnu@@tilst{Til stades}%
  \def\ntnu@@msted{M{o}testad}%
  \def\ntnu@@klage{Dersom du ikkje mottar alle sidene ring}%
}
% Se http://unit1.unit.no/filer/MALER/ENGELSK/readme.txt for disse:
\addto\extrasenglish{%
  \def\ntnu@@ntnu {Norwegian University of\\Science and Technology}%
  \def\ntnu@@tele {Tel.}%
  \def\ntnu@@epost{E-mail}%
  \def\ntnu@@fax  {Fax}%
  \def\ntnu@@besad{Address}%
  \def\ntnu@@posad{Postal address}%
  \def\ntnu@@vdato{Dated}%
  \def\ntnu@@vref {Our ref.}%
  \def\ntnu@@ddato{Your letter dated}%
  \def\ntnu@@dref {Your ref.}%
  \def\ntnu@@saksb{Our consultant:}%
  \def\ntnu@@til  {To}%
  \def\ntnu@@fra  {From}%
  \def\ntnu@@kopi {Copy to}%
  \def\ntnu@@om   {Subject}%
  \def\ntnu@@mref {Minutes of meeting}%
  \def\ntnu@@tilst{Present}%
  \def\ntnu@@refnt{Minutes by}%
  \def\ntnu@@mtid {M{\o}tetid}%
  \def\ntnu@@msted{M{o}tested}%
  \def\ntnu@@sider{No.~of pages incl.~this}%
  \def\ntnu@@sideav#1#2{Page #1 of #2}%
  \def\ntnu@@klage{In case you do not receive all pages, please call}%
  \def\ntnu@@meldg{Message}%
  \def\ntnu@@notat{Memo}%
  \def\ntnu@@dato {Date}%
  \def\ntnu@@arkiv{File}%
  \def\tlfprefix{+47 }%
  \def\pnrprefix{N--}%
  \def\Norge{\\Norway}% Til {\aa} hekte bakp{\aa} postadressen
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newif\ifntnulogo  \ntnulogotrue
   \let\utenlogo   \ntnulogofalse
   \let\medlogo    \ntnulogotrue

\newif\ifntnu@bytt \ntnu@byttfalse
   \let\byttinstfak\ntnu@bytttrue
   \let\toppinst   \ntnu@bytttrue
   \let\toppfak    \ntnu@byttfalse

\topmargin -82 pt     %    Nominal distance from top of paper to top of page
\leftmargin -1 mm
    \textheight 50\baselineskip
    \oddsidemargin 0 in      %   Note that \oddsidemargin = \evensidemargin
    \evensidemargin 0 in
    \marginparwidth 2.6 cm
    \textwidth 14.9 true cm 
    \advance\headheight by 2.5pt
\advance\textheight by \topskip

\parindent=0pt
\parskip=1ex

\def\TwoDigits#1{\ifnum#1<10 0\fi\number#1}
\def\ISOidag{\number\year--\TwoDigits\month--\TwoDigits\day}
\def\NORidag{\the\day.\the\month.\the\year}
\def\vdato#1{\gdef\ntnu@vdato{#1}}%
                \vdato{\idag}
\def\dato#1{\gdef\ntnu@dato{#1}}%
                \dato{\idag}

\def\kopi#1{\gdef\ntnu@kopi{#1}}\kopi{}
\def\ddato#1{\gdef\ntnu@ddato{#1}}\ddato{}
\def\sider#1{\gdef\ntnu@sider{#1}}\sider{}
\def\arkiv#1{\gdef\ntnu@arkiv{#1}}\arkiv{}

\ifx\@ramme\ntnu@ark
   \def\telefon#1{\gdef\ntnu@telefon{#1}}\telefon{}
   \def\telefaks#1{\gdef\ntnu@telefaks{#1}}\telefaks{}
   \def\baddr#1{\gdef\ntnu@baddr{#1}}\baddr{}
\fi

\ifx\@ramme\ntnu@telefax
   \def\paddr#1{\gdef\ntnu@paddr{#1}}\paddr{}
   \def\telefon#1{\gdef\ntnu@telefon{#1}}\telefon{}
   \def\telefaks#1{\gdef\ntnu@telefaks{#1}}\telefaks{}
   \def\om#1{\gdef\ntnu@om{#1}}\om{}
   \def\til#1{\gdef\ntnu@til{#1}}\til{}
   \def\fra#1{\gdef\ntnu@fra{#1}}\fra{}
   \def\tilfax#1{\gdef\ntnu@tilfax{#1}}\tilfax{}
   \def\frafax#1{\gdef\ntnu@frafax{#1}}\frafax{}
   \def\klager#1{\gdef\ntnu@klager{#1}}\klager{}
\fi

\ifx\@ramme\ntnu@moteinnk
   \def\baddr#1{\gdef\ntnu@baddr{#1}}\baddr{}
   \def\kopi#1{\gdef\ntnu@kopi{#1}}\kopi{}
   \def\telefon#1{\gdef\ntnu@telefon{#1}}\telefon{}
   \def\telefaks#1{\gdef\ntnu@telefaks{#1}}\telefaks{}
   \def\om#1{\gdef\ntnu@om{#1}}\om{}
   \def\til#1{\gdef\ntnu@til{#1}}\til{}
   \def\fra#1{\gdef\ntnu@fra{#1}}\fra{}
   \def\motetid#1{\gdef\ntnu@motetid{#1}}\motetid{}
   \def\motested#1{\gdef\ntnu@motested{#1}}\motested{}
   \def\dato#1{\gdef\ntnu@dato{#1}}\dato{\the\day.\the\month.\the\year}
\fi

\ifx\@ramme\ntnu@moteref
   \def\baddr#1{\gdef\ntnu@baddr{#1}}\baddr{}
   \def\kopi#1{\gdef\ntnu@kopi{#1}}\kopi{}
   \def\telefon#1{\gdef\ntnu@telefon{#1}}\telefon{}
   \def\telefaks#1{\gdef\ntnu@telefaks{#1}}\telefaks{}
   \def\om#1{\gdef\ntnu@om{#1}}\om{}
   \def\motetid#1{\gdef\ntnu@motetid{#1}}\motetid{}
   \def\motested#1{\gdef\ntnu@motested{#1}}\motested{}
   \def\tilstede#1{\gdef\ntnu@tilstede{#1}}\tilstede{}
   \def\referent#1{\gdef\ntnu@referent{#1}}\referent{}
   \def\dato#1{\gdef\ntnu@dato{#1}}\dato{\the\day.\the\month.\the\year}
\fi

\ifx\@ramme\ntnu@brev
   \def\saksb#1{\gdef\ntnu@saksb{#1}}\saksb{}
   \def\sbtelefon#1{\gdef\ntnu@sbtelefon{#1}}\sbtelefon{}
   \def\saksbtittel#1{\def\ntnu@saksbtittel{#1}}\saksbtittel{\ntnu@@saksb}
   \def\sbepost#1{\gdef\ntnu@sbepost{#1}}\sbepost{}
   \def\om#1{\gdef\ntnu@om{#1}}\om{}
   \def\til#1{\gdef\ntnu@til{#1}}\til{}
   \def\fra#1{\gdef\ntnu@fra{#1}}\fra{}
   \def\telefon#1{\gdef\ntnu@telefon{#1}}\telefon{}
   \def\telefaks#1{\gdef\ntnu@telefaks{#1}}\telefaks{}
   \def\vref#1{\gdef\ntnu@vref{#1}}\vref{}
   \def\dref#1{\gdef\ntnu@dref{#1}}\dref{}
   \def\paddr#1{\gdef\ntnu@paddr{#1}}\paddr{}
   \def\baddr#1{\gdef\ntnu@baddr{#1}}\baddr{}
\fi

\ifx\@ramme\ntnu@notat
   \def\filnavn#1{\gdef\ntnu@filnavn{#1}}\filnavn{}
   \def\baddr#1{\gdef\ntnu@baddr{#1}}\baddr{}
   \def\til#1{\gdef\ntnu@til{#1}}\til{}
   \def\fra#1{\gdef\ntnu@fra{#1}}\fra{}
   \def\telefon#1{\gdef\ntnu@telefon{#1}}\telefon{}
   \def\telefaks#1{\gdef\ntnu@telefaks{#1}}\telefaks{}
   \def\om#1{\gdef\ntnu@om{#1}}\om{}
\fi   

\def\tiladr#1{\gdef\ntnu@tiladr{#1}}\tiladr{~\\~\\~\\~}

\def\fakultet#1{\gdef\ntnu@fak{#1}}\fakultet{}
\def\institutt#1{\gdef\ntnu@inst{#1}}\institutt{}

\newcommand\ntnularge{\@setfontsize\ntnularge\@xivpt{16}}
\newcommand\ntnusmall{\@setfontsize\ntnusmall\@ixpt{10}}
\newcommand\ntnunorml{\@setfontsize\ntnunorml\@xiipt{13.6}}
\def\ltxt#1{\raisebox{3mm}{\rule{0mm}{8pt}\ntnusmall\bf #1}}

%
% Tegner en ntnu-logo eller etterlater et tilsvarende aapent rom
\def\ntnu@logo{%
   \ifntnulogo
      \psfig{figure=ntnulogo.eps,width=1.6cm}%
   \else
      \rule{1.6cm}{.0mm}\rule{.0mm}{1.6cm}\fi}

\def\hboxatleast to#1#{\hb@xatleast{#1}}
\def\hb@xatleast#1#2{%
   \begingroup
      \setbox0=\hbox{#2}%
      \ifdim\wd0>#1 \box0 \else\hbox to#1{\box0 \hfill}\fi
   \endgroup}

\newcommand{\BrevHode}[1]{%
  \begingroup \hsize=17.5cm \parskip=0pt
    % Topptekst, med tilsynelatende stoerrelse null - saa vi har bedre
    % kontroll med avstanden fra toppen av arket til logo og slikt.
    \vtop to 0pt{
      \ntnularge \noindent
      \parbox[t]{10cm}{\bf \raggedright \ntnu@@ntnu\\NTNU}
      \hfill
      \parbox[t]{7cm}{\bf\raggedleft
              \ifntnu@bytt\ntnu@inst\else\ntnu@fak\fi}%
      \par\vss}
    \vspace{21mm}
    % Tiladresse og logo.
    % Foerst tiladresse, i en boks med dybde 0, saa dybden ikke har noen
    % innvirkning paa plasseringen av annen tekst:
    \begingroup 
      \setbox0=\vtop{\hsize=12cm \raggedright
                     \noindent#1\par}
      \dp0=0pt
      \noindent\box0
    \endgroup
    % Vi er naa i horisontal (paragraph) mode.  Ta med logoen!
    % (men bare om vi skriver brev).
    \ifx\@ramme\ntnu@brev\else\ntnulogofalse\fi
    \ifx\@ramme\ntnu@telefax\ntnulogotrue\fi  % Line added by KO
    \ifx\@ramme\ntnu@ark\ntnulogotrue\fi      % Line added by KO
    \ifx\@ramme\ntnu@notat\ntnulogotrue\fi    % Line added by KO
    \ifx\@ramme\ntnu@moteinnk\ntnulogotrue\fi % Line added by KO
    \ifx\@ramme\ntnu@moteref\ntnulogotrue\fi  % Line added by KO
    \hfill
    \ntnu@logo
    \par
    \vspace{8pt}
    \parskip=1ex
    \ntnu@marginfo
    \par
  \endgroup
}

%
% Informasjonen som skal ligge i margen paa hoeyre side av 
% foerste ark
\def\ntnu@marginfo{
   \begingroup
     % Vi samler opp informasjon i \0 og prosesserer til slutt
     \let\\\relax % Ellers vil \\ lage troebbel for oss i \edef under
     \def\0{}
     \long\def\@dd##1{\edef\0{\0##1}}
     \long\def\@dd@##1{\ifx\empty##1\else\@dd{\\##1}\fi}
     \long\def\@dd@@##1##2{\ifx\empty##2\else\@dd{\\##1 ##2}\fi}
     \@dd{\ifntnu@bytt\ntnu@fak\else\ntnu@inst\fi\par}
     \ifx\@ramme\ntnu@brev
        \ifx\empty\ntnu@saksb
        \else
           \@dd@\ntnu@saksbtittel
           \@dd@\ntnu@saksb
           \@dd@@{\ntnu@@tele}\ntnu@sbtelefon
           \@dd@@{\ntnu@@epost}\ntnu@sbepost
           \@dd\par
        \fi
      \fi
      \ifx\@ramme\ntnu@telefax\else\@dd@@{\ntnu@@besad\\}\ntnu@baddr\par\fi
      \ifx\@ramme\ntnu@telefax\@dd{\\\ntnu@@posad\\\ntnu@paddr\par}\fi
      \ifx\@ramme\ntnu@brev   \@dd{\\\ntnu@@posad\\\ntnu@paddr\par}\fi
      \@dd@@{\ntnu@@tele}\ntnu@telefon
      \@dd@@{\ntnu@@fax}\ntnu@telefaks
      % Ferdig med aa sette sammen \0.
      % Her kommer en del magi: Vi maa sjekke om vi kan putte vaar dato
      % etc paa samme linje som siste linje i \0.  Makroen \processlast
      % gjoer dette.  Den faar som argument: Alt fra siste \\ og ut i \0.
      \long\def\processlast##1{%
           \par
           \setbox1=\hbox{##1}
           \setbox0=\hbox{%
                 \ifx\ntnu@brev\@ramme
                      \hboxatleast to 2.91cm{\ntnu@@vdato: \ntnu@vdato\quad}%
                      \hboxatleast to 2.91cm{\ntnu@@vref \ntnu@vref\quad}%
                      \hboxatleast to 2.91cm{\ntnu@@ddato \ntnu@ddato\quad}%
                      \hbox                 {\ntnu@@dref \ntnu@dref\qquad}%
                 \fi}
           \dimen0=\wd0 \advance\dimen0\wd1
           \ifdim\dimen0<\hsize
             \hbox to\hsize{\box0\hfill\box1}
           \else
             \hbox to\hsize{\hfill\box1}
             \box0
           \fi}
      % \process brukes til aa splitte innholdet i \0 etter \\.  Det
      % meste blir bare eksekvert uten videre, og den siste sendes til
      % \processlast.
      \long\def\process##1\\##2\endprocess
      {\def\0{##2}\ifx\empty\0\processlast{##1}%
                 \else\\##1\process##2\endprocess\fi}
      \bf\raggedleft\ntnusmall
      \def\\{\ifhmode\penalty-10000 \fi\ignorespaces}
      \expandafter\process\0\\\endprocess
   \endgroup}


\ifx\@ramme\ntnu@brev
   \def\letterstyle#1{\@nameuse{ls@#1}}
\else
\def\forside{%
  \BrevHode{}
        \ifx\@ramme\ntnu@notat
           {\ntnularge\bf \ntnu@@notat}\vspace{.8cm}\\
           {\setlength{\tabcolsep}{0cm}\ntnunorml
           \hbox to 0cm{\begin{tabular*}{17.5cm}{@{\extracolsep{\fill}}%
                                                *{3}{p{5.82cm}}}\hline
           \multicolumn{2}{l}{\ltxt{\makebox[.8cm][l]{\ntnu@@til:}} \ntnu@til} & 
                \ltxt{\makebox[1cm][l]{\ntnu@@dato:}} \ntnu@dato\\\hline
           \multicolumn{2}{l}{\ltxt{\makebox[.8cm][l]{\ntnu@@fra:}} \ntnu@fra} &
                \ltxt{\makebox[1cm][l]{\ntnu@@arkiv:}} \ntnu@arkiv\\\hline
           \multicolumn{3}{l}{\ltxt{\makebox[.8cm][l]{\ntnu@@kopi:}} 
                                                        \ntnu@kopi}\\\hline
           \multicolumn{3}{l}{\ltxt{\makebox[.8cm][l]{\ntnu@@om:}}
                                        \bf\ntnu@om}\\\hline
           \end{tabular*}\hss}}\fi
        \ifx\@ramme\ntnu@moteref
           {\ntnularge\bf \ntnu@@mref}\vspace{.8cm}\\
           {\setlength{\tabcolsep}{0cm}\ntnunorml
           \hbox to 0mm{\begin{tabular*}{17.5cm}{@{\extracolsep{\fill}}%
                                                *{3}{p{5.82cm}}}\hline
           \multicolumn{3}{l}{\ltxt{\makebox[1.4cm][l]{\ntnu@@tilst:}} 
                                                \ntnu@tilstede}\\\hline
           \multicolumn{2}{l}{\ltxt{\makebox[1.4cm][l]{\ntnu@@refnt:}} 
                   \ntnu@referent} &
                \ltxt{\makebox[1.4cm][l]{\ntnu@@kopi:}} \ntnu@kopi\\\hline
           \ltxt{\makebox[1.4cm][l]{Dato:}} \ntnu@dato &
                \ltxt{\makebox[1.4cm][l]{\ntnu@@mtid:}} \ntnu@motetid &
                \ltxt{\makebox[1.4cm][l]{\ntnu@@msted:}} \ntnu@motested\\\hline
           \multicolumn{3}{l}{\ltxt{\makebox[1.4cm][l]{\ntnu@@om:}}
                                        \bf\ntnu@om}\\\hline
           \end{tabular*}\hss}}\fi
        \ifx\@ramme\ntnu@moteinnk
           {\ntnularge\bf M{\o}teinnkalling}\vspace{.8cm}\\
           {\setlength{\tabcolsep}{0cm}\ntnunorml
           \hbox to 0mm{\begin{tabular*}{17.5cm}{@{\extracolsep{\fill}}%
                                                *{3}{p{5.82cm}}}\hline
           \multicolumn{3}{l}{\ltxt{\makebox[1.4cm][l]{\ntnu@@til:}} 
                                                \ntnu@til}\\\hline
           \multicolumn{3}{l}{\ltxt{\makebox[1.4cm][l]{\ntnu@@fra:}} 
                                                \ntnu@fra}\\\hline
           \multicolumn{3}{l}{\ltxt{\makebox[1.4cm][l]{\ntnu@@kopi:}} 
                                                \ntnu@kopi}\\\hline
           \ltxt{\makebox[1.4cm][l]{\ntnu@@mtid:}} \ntnu@motetid &
                \ltxt{\makebox[.8cm][l]{Dato:}} \ntnu@dato &
                \ltxt{\makebox[1.4cm][l]{\ntnu@@msted:}} \ntnu@motested\\\hline
           \multicolumn{3}{l}{\ltxt{\makebox[1.4cm][l]{\ntnu@@om:}}
                                        \bf\ntnu@om}\\\hline
           \end{tabular*}\hss}}\fi
        \ifx\@ramme\ntnu@telefax
           {\ntnularge\bf \ntnu@@fax}\vspace{.8cm}\\
           {\setlength{\tabcolsep}{0cm}\ntnunorml
           \hbox to 0mm{\begin{tabular*}{17.5cm}{@{\extracolsep{\fill}}%
                                                p{9.82cm}p{7.64cm}}\hline
           \ltxt{\ntnu@@til:} ~\ntnu@til & \ltxt{\ntnu@@fax:} ~\ntnu@tilfax\\\hline
           \ltxt{\ntnu@@fra:} ~\ntnu@fra & \ltxt{\ntnu@@fax:} ~\ntnu@frafax\\\hline
           \ltxt{\ntnu@@sider:} \ntnu@sider &
                        \ltxt{\ntnu@@dato:} ~\ntnu@dato\\\hline
           \multicolumn{2}{l}{\ltxt{\ntnu@@klage:} 
                ~\ntnu@klager}\\\hline
           \ltxt{\ntnu@@meldg:} ~\bf\ntnu@om\\\hline
           \end{tabular*}\hss}}\fi
        \bigskip
        \pagestyle{fancy}
        \renewcommand{\headrulewidth}{0pt}
        \rfoot{}\lfoot{}\cfoot{}\rhead{}\chead{}\lhead{}
        \ifx\@ramme\ntnu@notat
                \rfoot{\ntnunorml \ntnu@@sideav{\thepage}{\AntallSider}}
                \lfoot{\ntnusmall\ifx\empty\ntnu@filnavn\jobname\else
                                                       \ntnu@filnavn\fi}
        \fi
        \ifntnulogo
           \lhead{\vbox to 0pt{\vspace{3.8cm}
                \hbox to 17.5cm{\hfill
                \psfig{figure=ntnulogo.eps,width=1.6cm}}\vss}}\fi
}\fi

\headheight=18.85pt



\def\ls@ntnu{
   \gdef\opening##1{
        \om{##1}
        \tiladr{\toname\\\toaddress}
        \BrevHode{\ntnu@tiladr}
        \pagestyle{fancy}
        \renewcommand{\headrulewidth}{0pt}
        \rfoot{}\lfoot{}\cfoot{}\rhead{}\chead{}\lhead{}
        \rfoot{\ntnunorml \ntnu@@sideav{\thepage}{\AntallSider}}
        \ifntnulogo
           \lhead{\vbox to 0pt{\vspace{3.8cm}
                \hbox to 17.5cm{\hfill
                \psfig{figure=ntnulogo.eps,width=1.6cm}}\vss}}\fi
        \thispagestyle{empty}
        \ifx\empty{\ntnu@om}\else
           {\bigskip\ntnularge\bf\ntnu@om}\fi\par\medskip}
}

\def\@texttop{}
