%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*- Mode: Latex -*- %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% aadiv.sty -- En del nyttige LaTeX makroer.
%% 
%% Author          : Anders Andersen
%% Created On      : Tue Apr 18 17:32:19 1995
%% Last Modified By: Anders Andersen
%% Last Modified On: Tue Dec 12 10:57:52 2000
%% Status          : Unknown, Use with caution!
%% 
%% (C) Copyright 1995, Anders Andersen, all rights reserved.
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% --------------------------------------%--------------------------------------
% ---------------------------- Identification part ----------------------------
% --------------------------------------%--------------------------------------

\RequirePackage{rcs}

\RCS$Date: 2002/07/09 23:45:45 $
\RCS$RCSfile: aadiv.sty,v $
\RCS$Revision: 1.1 $
\RCS$State: Exp $
\RCS$Author: aa $

\input{aausercs}


% --------------------------------------%--------------------------------------
% --------------------------------- Main code ---------------------------------
% --------------------------------------%--------------------------------------


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Smart fotnote, sjekker om det kommer punktum eller komma etter noten:
\newcommand{\afootnote}[1]{\@ifnextchar.{\@afootnote{#1}}{\@@footnote{#1}}}
\newcommand{\@@footnote}[1]{\@ifnextchar,{\@@afootnote{#1}}{%
    \footnotemark\footnotetext{#1} }}
\def\@afootnote#1.{\makebox[0pt][l]{\@.}\footnotemark\footnotetext{#1}}
\def\@@afootnote#1,{\makebox[0pt][l]{\@,}\footnotemark\footnotetext{#1}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2 kolonner for informasjon

% Dimensions.
\newdimen\firstcolumn   % Width of first column.
\newdimen\lastcolumn    % Width of last column.
\newdimen\inforowsep    % Width between info rows
\inforowsep=1.5ex       % This one you can change, but you shouldn't give
                        % it a value less than 1ex.

% Information in two columns.
\newcommand{\info}[2]{%
        \parbox[t]{\firstcolumn}{#1}
        \ \
        \parbox[t]{\lastcolumn}{#2\vspace{\inforowsep}}}

% Use *only* this if you want to change the size of the columns.
\newcommand{\setfirstcolumnsize}[1]{%
        \firstcolumn=#1
        \lastcolumn=\textwidth
        \advance\lastcolumn by -\firstcolumn
        \advance\lastcolumn by -2\tabbingsep
}

% Setting the size of the columns.
\setfirstcolumnsize{2.6cm}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Tegn og ord

% Backslash
\newcommand{\bs}{\char'134}
\newcommand{\unix}{\navn{Unix}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Bokser og andre makroer

% Fbox uten `luft'
\newcommand{\ftbox}[1]{%
  \newlength{\tmplength}%
  \tmplength=\fboxsep%
  \setlength{\fboxsep}{0pt}%
  \fbox{#1}%
  \fboxsep=\tmplength}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Tekst typer o.l.

% Norsk tekst (korte sitater)
\newcommand{\notekst}[1]{%
  \iflanguage{english}{%
    \selectlanguage{norsk}#1\selectlanguage{english}}%
  {#1}}

% Norsk tekstblokk
\newenvironment{norwegian}{%
  \selectlanguage{norsk}}{%
  \selectlanguage{english}}

% Det norske ordet (i engelsk tekst)
\newcommand{\noword}[1]{norwegian:~\notekst{\emph{#1}}}

% Engelsk tekst (korte sitat)
\newcommand{\engtext}[1]{%
  \iflanguage{norsk}{%
    \selectlanguage{english}#1\selectlanguage{norsk}}{%
    #1}}

% Engelsk tekstblokk
\newenvironment{english}{%
  \selectlanguage{english}}{%
  \selectlanguage{norsk}}

% Det engelske ordet (i norsk tekst)
\newcommand{\engword}[1]{engelsk:~\engtext{\emph{#1}}}

% Norsk og engelsk navn
\newcommand{\navn}[1]{\notekst{\textsl{#1}}}
\newcommand{\name}[1]{\engtext{\textsl{#1}}}

% Norsk og engelsk tittel
\newcommand{\tnavn}[1]{\notekst{\emph{#1}}}
\newcommand{\tname}[1]{\engtext{\emph{#1}}}

% Norsk og engelsk u-tekst
\newcommand{\utekst}[1]{\notekst{\emph{#1}}}
\newcommand{\utext}[1]{\engtext{\emph{#1}}}

% Norsk og engelsk uthevet tekst
\newcommand{\uthev}[1]{\notext{\emph{#1}}}
\newcommand{\emphit}[1]{\engtext{\emph{#1}}}

% Program-navn
\newcommand{\prog}[1]{\texttt{\textsl{#1}}}

% Kommando (i shell)
\newcommand{\komm}[1]{\texttt{\textit{#1}}}

% En tast
\newcommand{\tast}[1]{\texttt{#1}}

% Et prompt (fra shell)
\newcommand{\prompt}[1]{\texttt{#1}}

% Filnavn
\newcommand{\fnavn}[1]{\texttt{#1}}
