% 
% This is the file 'asmeart.cls', copyright 1997, Richard W Kaszeta
%
% Report errors to kaszeta@me.umn.edu
%
% A test implementation of an ASME paper format, implementing the
% formatinng rules described in ``The ASME Author's Kit: Guid to
% Publication of an ASME Conference Paper''.  Designed
% to provide a robust, latex2e compatible ASME format.  Doesn't
% necessarily do everything you want, but leaves things in a format
% where it is easy for the user to customize it's behavior
%
% Important:
% If you modify this file for personal use, you are *not* allowed to
% redistribute it unless you do all of the following (unless you
% obtain written permission from myself):
%
% 1. You must rename the file before you make any changes to it.
% 2. You must leave the copyright above intact.
% 3. You must change the error report address above so I don't get
%    email about files not maintained by me.
% 4. You must either distribute this original file with the changed
%    version or provide a .diff file
%
% Distribution of modified copies of this file without meeting these
% requirements is a violation of US Copyright Code.
%
% Otherwise, feel free to distribute unchanged copies of this file.
%
% What this class does:
%   1. Implements a ``9pt'' class option for basing all font calculations
%      on nine-point font sizes.  A bad hack.
%   2. Sets proper ASME margins and column separations
%   3. Turns off section numbering (making \section and \section* commands
%      functionally equivalent)
%   4. Sets up ASME style sectioning commands.  The underlined subsection 
%      command is another bad hack.
%   5. Tweaks the float parameters to allow tighter spacing.  You should
%      probably still use the `float' package to get the [H] specifier.
%   6. Redefines the \maketitle command.
%   7. Redefines the `abstract' environment.
%   8. Fixes a few section headers to be uppercase
%
% What this class doesn't do:
%   1. Provide postscript fonts instead of cm.  Easily done by including
%      \usepackage{times,mathptm} instead.
%   2. Provide nomenclature support.  Use the `nomencl' package.
%   3. Author-year citations.  Use the `natbib' package along with the 
%      `menet' biblioagraphy style.
%   4. Doesn't force section headers to be uppercase.  Do this by hand.
%
% What this class requires in the preamble:
%   \author{Authors}  % Doesn't support \LaTeX's \and command
%   \title{Title}
%
% Recent Changes:
%   Cleaned up float parameters (v0.95)
%
% Todo:
%
% 1. Better handling of 9pt option
% 2. Clean up \subsubsection commands.
%
% Identification
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{asmeart}
              [1997/09/03 v0.95 UMN ASME-ish Format]
% Initial Code
\RequirePackage{ifthen}
\newboolean{doninept}
% Declaration of Options
\DeclareOption{9pt}{\setboolean{doninept}{true}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
% Execution of Options
\ProcessOptions
% Package and Class Loading
\RequirePackage{geometry}  % For page margin handling
\RequirePackage{calc}      % For nomenclature handling
\RequirePackage[normalem]{ulem} % For underlining
\LoadClass[notitlepage]{article} % no titlepage support
% Main Code

% Nine Point Font Handling.  This loads force9.clo, which does the
% same thing as size9.clo, but uses renewcommands so it doesn't error
% out.  I'd like a better way of handling this, actually.
\ifthenelse{\boolean{doninept}}
  {%
     \InputIfFileExists{force9.clo}%
     {\ClassInfo{asmeart}{Loading 9pt Class Option}}
     {\ClassInfo{asmeart}{No force9.clo, using 10pt}}}
  {}

% Provides ASME Compatible Margins
\geometry{nohead,lmargin=0.5in,rmargin=0.5in,tmargin=1in,bmargin
=0.5in,footskip=36pt}

% Sets ASME required column separation
\setlength{\columnsep}{0.375in}

% Sets ASME parskip and indent
\setlength{\parindent}{0.25in}
\setlength{\parskip}{9pt}

% No Section Numbers, which makes both the normal and starred versions
% of the sections commands the same.
\setcounter{secnumdepth}{0}

% Replace the default sectioning commands with ASME ones.  These aren't exact
% since they leave space between the section header and the start of the 
% section, due to the limitations of \@startsection
\renewcommand{\section}{\@startsection{section}{1}{0pt}{9pt}{0.1pt}{\bfseries\sffamily}}
\renewcommand{\subsection}{\@startsection{subsection}{2}{0pt}{9pt}{0.1pt}{\bfseries\sffamily}}

% And to get the underlining(spit!) working right, I had to \secdef this
% one.  TOC entries aren't supported, it will have to be editted more for
% that.  Also a hack since you can't then have a newline there.
\renewcommand{\subsubsection}{\secdef\Subsubsection\Subsubsectionb}
\newcommand{\Subsubsection}[2][?]{{\bfseries\sffamily\uline{#1}.} }
\newcommand{\Subsubsectionb}[1]{{\bfseries\sffamily\uline{#1}.} }

% ASME papers require a lot of figures crammed in tightly into the
% text, so we have to twiddle the float placement parameters
\renewcommand{\topfraction}{.90} 
\renewcommand{\bottomfraction}{.90}
\renewcommand{\textfraction}{.10} 
\renewcommand{\floatpagefraction}{.9}
\renewcommand{\dbltopfraction}{.9} 
\renewcommand{\dblfloatpagefraction}{.9}
\setcounter{topnumber}{9} 
\setcounter{bottomnumber}{9}
\setcounter{totalnumber}{20} 
\setcounter{dbltopnumber}{9} 
\setlength{\textfloatsep}{5pt plus 1pt minus 2pt}
\setlength{\dbltextfloatsep}{5pt plus 1pt minus 2pt}
\setlength{\floatsep}{5pt plus 1pt minus 2pt}
\setlength{\dblfloatsep}{5pt plus 1pt minus 2pt}
\setlength{\intextsep}{5pt plus 1pt minus 2pt}
\setlength{\abovecaptionskip}{3pt}
\setlength{\belowcaptionskip}{0pt}

% A new \maketitle macro, which uses the \institution command
\def\institution#1{\gdef\@institution{#1}}
\institution{Heat Transfer Laboratory\\%
University of Minnesota\\%
Minneapolis, MN 55455, U.S.A.}
% Title formatting macro
\renewcommand{\@maketitle}{\begin{center}
\vspace*{1.125in}
  {\Large \sffamily \bfseries \@title\\}
  \vspace*{3em}
  {\large \sffamily \bfseries \@author\\}
  \vspace*{3em}
  {\large \sffamily \@institution\\}
  \vspace*{1.5em}
  \end{center}
}
\if@twocolumn
\renewcommand{\maketitle}{%
  \twocolumn[\@maketitle]
}
\else
\renewcommand{\maketitle}{\@maketitle}
\fi

% Fix case of Reference section
\renewcommand{\refname}{REFERENCES}

% Provide a realistic abstract environment in case someone tries to use it:
\renewenvironment{abstract}{\section*{ABSTRACT}}{}

% Finally, process user-local code
\InputIfFileExists{asmeart.cfg}{\ClassInfo{asmeart}{Using local configuration file}}{\ClassInfo{asmeart}{No local configuration file}}

