%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*- Mode: Latex -*- %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% aamisc.sty -- Some useful LaTeX macros
%% 
%% Author          : Anders Andersen
%% Created On      : Tue Apr 18 17:32:19 1995
%% Last Modified By: Anders Andersen
%% Last Modified On: Tue Dec 12 13:13:29 2000
%% Status          : Unknown, Use with caution!
%% 
%% (C) Copyright 1995-2001, Anders Andersen, all rights reserved.
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


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

\RequirePackage{rcs}

\RCS$Date: 2000/12/12 12:21:58 $
\RCS$RCSfile: aamisc.sty,v $
\RCS$Revision: 1.1 $
\RCS$State: Exp $
\RCS$Author: aa $

\input{aausercs}


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


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Smart footnote (punctation aware)
\newcommand{\aafootnote}[1]{\@ifnextchar.{\@afootnote{#1}}{\@@footnote{#1}}}
\newcommand{\@@footnote}[1]{\@ifnextchar,{\@afootnote{#1}}{%
    \footnotemark\footnotetext{#1} }}
\def\@afootnote#1#2{\makebox[0pt][l]{\expandafter\@#2}%
  \footnotemark\footnotetext{#1}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Special characters and words

% Backslash
\newcommand{\bs}{\char'134}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Boxes

% Fbox without spacing
\newlength{\@atmplength}%
\newcommand{\aaftbox}[1]{%
  \@atmplength=\fboxsep%
  \setlength{\fboxsep}{0pt}%
  \fbox{#1}%
  \fboxsep=\@atmplength}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Support for other language in text

% Text (sentence) #2 in language #1 (see babel)
\newcommand{\aalangtext}[2]{%
  \iflanguage{#1}{#2}{%
    \expandafter\def\expandafter\@aatmplang\expandafter{\languagename}%
    \selectlanguage{#1}#2\expandafter\selectlanguage\expandafter{\@aatmplang}}}

% Text block in language #1 (see babel)
\newenvironment{aalang}[1]{%
  \expandafter\def\expandafter\@aatmplang\expandafter{\languagename}%
  \selectlanguage{#1}}{\expandafter\selectlanguage\expandafter{\@aatmplang}}
