% This is REFMAN.STY by H.Partl, TU Wien, Version 1.0 of 25 Nov 1988.
% One forgotten \templength fixed 09.10.1990 RUM/W.Kaspar
% Bug fixed in line 336: 14.04.1989 RUM/W.Kaspar
% OLD: \def\ps@headings{\let ....
% NEW: \def\ps@footings{\let ....
% Bug fixed in line 432: 12.04.1989 RUM/W.Kaspar
% OLD: \leftmarginwidth=\templength
% NEW: \leftmarginwidth=\templength@
%
% Document Style Option to `article' and `report',
% for technical reference manuals, users' guides and articles,
% with a design similar to that of the PostScript Reference Manual:
% All pages have a wide left margin and no right margin, and section
% headings and other `guiding' material appear in that margin.
% Supports one-column only. REFMAN should be specified as the LAST
% optional argument of the \documentstyle command, e.g.
% \documentstyle[11pt,twoside,german,refman]{article}
%
% It CAN be used with twoside, fleqn and others.
% It can NOT be used with twocolumn, titlepage, fullpage, a4, a4wide
% and others.
%
% +-----------------------------------------------------------------+
% ! This style file has been designed for reference manuals, users' !
% ! guides, short instants, and related papers at the EDP centre of !
% ! the Technical University of Vienna. It must be re-designed and !
% ! changed before application at any other institution or for any !
% ! other purpose. !
% +-----------------------------------------------------------------+
% Copyright H.Partl TU Wien 1988.
% Process this file only once:
\@ifundefined{leftmarginwidth}{}{\endinput}
\typeout{ TU Wien Refman Style - Version 1.0 as of 25 Nov 1988}
\newdimen\leftmarginwidth % value of odd & evensidemargin, set below.
\newdimen\fullwidth % = \textwidth + \leftmarginwidth
\newdimen\emptyheadtopmargin % used by some pagestyles
\newdimen\emptyfoottopmargin % dto.
% \longhrule and \longthickhrule are defined for \hrule's of width \fullwidth
\def\longhrule{\par\hbox to \linewidth{\hss
\vrule width \fullwidth height 0.4pt depth 0pt}\par}
\def\longthickhrule{\par\hbox to \linewidth{\hss
\vrule width \fullwidth height 1.0pt depth 0pt}\par}
% Re-definitions of the \section commands to use \fullwidth and smaller
% vertical skips and smaller fonts.
% (Note that the afterskip must be >zero, not =zero)
\def\secshape{\leftskip=-\leftmarginwidth % use \fullwidth
\rightskip=\@flushglue % raggedright
\hyphenpenalty=2000} % no hyphenation
\def\section{\@startsection {section}{1}{\z@}{-2ex plus -1ex minus
-.2ex}{0.5ex plus .2ex}{\secshape\large\bf}}
\def\subsection{\@startsection{subsection}{2}{\z@}{-1.5ex plus -.5ex minus
-.2ex}{0.5ex plus .2ex}{\secshape\normalsize\bf}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-1.5ex plus
-.5ex minus -.2ex}{0.5ex plus .2ex}{\secshape\normalsize\rm}}
\def\paragraph{\@startsection
{paragraph}{4}{\z@}{2ex plus 1ex minus .2ex}{-1em}{\normalsize\bf}}
\def\subparagraph{\@startsection
{subparagraph}{4}{\parindent}{2ex plus 1ex minus
.2ex}{-1em}{\normalsize\bf}}
% For ARTICLE:
% Re-definitions of \maketitle and \part (\clearpage, \fullwidth, \hrules).
% This \maketitle prints the \title only.
% A \makeauthor command is defined to print the \author (to be used either
% just after \maketitle or at the end of the article, without \thanks).
\def\@redefinemaketitle{
\def\maketitle{\par
\begingroup
\if@twocolumn
\twocolumn[\@maketitle]
\else \newpage
\global\@topnum\z@ % Prevents figures from going at top of page.
\@maketitle \fi\thispagestyle{plain}
\endgroup
\setcounter{footnote}{0}}
\def\makeauthor{\par\nopagebreak\vskip 2ex plus 1ex minus 1ex
\begin{flushright}\normalsize\sl \@author \end{flushright}\par
\vskip 2ex plus 1ex minus 1ex\relax }
\def\and{\\*}
\def\thanks{\footnote}
% In \part, only \thepart (the Roman part number) is printed, without
% the word `Part' in front of it, and \markboth is replaced by \@mkboth
% to preserve the marks with the myheadings and myfootings page styles.
% No word `Chapter'/`Kapitel' before the chapter number, but the word
% `Appendix'/`Anhang' will still be inserted after \appendix !
\def\@chapapp{}
% Note that \chapter itself is defined like this:
% \def\chapter{\clearpage \thispagestyle{plain} \global\@topnum\z@
% \@afterindentfalse \secdef\@chapter\@schapter}
% This definition and those of \@chapter and \@schapter remain unchanged.
} % end of \@redefinechapter
% Now, do either the first one or the second one, depending on the main
% document style (article= \chapter undefined, or report= \chapter defined).
% (Note that \par must not appear inside \@ifundefined, therefore this
% indirect approach is taken.)
% Re-defintion of the \marginpar command to use always the left margin
% (never the right margin). Be careful that Marginpars do not come to
% near to each other!
% Special Marginpars:
% \marginlabel{X} puts X into a flushright Marginpar.
% To be used like description-items or short
% \subsubsection* headings.
% \attention puts ! --> to the left of the text.
% To mark an important piece of text.
% \seealso{X} puts a small ---> X to the very left.
% To mark a reference within the text.
% These three commands start with an empty \mbox, i.e. they can be used
% before the first word of a paragraph and still have the desired
% effect, namely that the marginal stuff appears next to the first
% line of this paragraph, not at the last line of the previous one.
% They end with \ignorespaces, i.e. blanks (spaces) after the argument's
% } are allowed and do NOT appear in the printed text.
% Like all \marginpar's, they cannot be used in math mode or inside boxes.
% The description environment is redefined such that the item labels use
% the whole left margin (and are in roman, right bound, with colon).
% \labelwidth = \leftmarginwidth + previous\@totalleftmargin +
% + new\leftmargin - \labelsep
% \descriptioncolontrue and -false can be used to select whether a colon
% is added to the item label.
% \descriptionlefttrue and -false can be used to select whether the item labels
% are set left bound or right bound.
\newif\ifdescriptioncolon \descriptioncolontrue
\newif\ifdescriptionleft \descriptionleftfalse
\def\descriptionlabel#1{\ifdescriptionleft\else \hfil \fi
\rm #1\ifdescriptioncolon :\fi
\ifdescriptionleft \hfil \fi}
\def\description{\list{}{\labelsep=\marginparsep
\labelwidth=\leftmarginwidth \advance\labelwidth by \@totalleftmargin
\advance\labelwidth by \leftmargin \advance\labelwidth by -\labelsep
\let\makelabel=\descriptionlabel}}
\let\enddescription=\endlist
% The maxipage environment is a minipage that uses the \fullwidth,
% with \hrules above and below. Marginpars are not allowed.
% To be used for wide tables, long math equations, and the like.
% It cannot be split across pages.
% It can be used in floats, e.g. like
% \begin{table}\begin{maxipage}
% ... a wide table ... \caption{the caption}
% \end{maxipage}\end{table}
% \maxipageruletrue and -false can be used to select whether \hrule's are
% added to the minpage.
\newif\ifmaxipagerule \maxipageruletrue
\def\maxipage{\par % (here a \vskip\parskip will happen by the final \par)
\mbox{}\kern-\leftmarginwidth \kern-\@totalleftmargin
\begin{minipage}{\fullwidth}
\medskip \ifmaxipagerule \hrule\medskip \fi
\parskip = 0.5\baselineskip % <--- same as outside minipage
\def\marginpar{\typeout{Marginpar not allowed within Maxipage.}}}
\def\endmaxipage{\par \vskip\parskip
\medskip \ifmaxipagerule \hrule\medskip \fi
\end{minipage}\par}
% The fullpage environment changes the page layout such that normal text
% and all environments use the \fullwidth. Marginpars are not allowed.
% Both \begin{fullpage} and \end{fullpage} start a new page before switching
% to the other layout.
% To be used for one or several special pages where the full line length is
% needed.
\def\fullpage{\clearpage \leftmarginwidth\z@ \textwidth=\fullwidth
\oddsidemargin=\z@ \evensidemargin\z@
\hsize=\fullwidth \linewidth=\fullwidth \columnwidth=\fullwidth
\def\marginpar{\typeout{Marginpar not allowed within Fullpage.}}}
\def\endfullpage{\clearpage}
% The example environment is a verse enironment with \tt font and with
% trying to avoid page breaks at the \begin{example}. Lines in the example
% should be separated by \\*.
% Page Styles:
% The pagestyles plain, headings and myheadings are redefined and new
% pagestyles footings and myfootings are defined, which all use the
% \fullwidth, with \thepage on the outer side of the (odd/even) page
% and some with a \hrule below the head line or above the foot line.
% My favourite is
% \pagestyle{myfootings}
% \markboth{the title of the paper}{the title of the paper}
% (Note that the \markboth is not destroyed by the new \part command.)
% The pagestyles headings and myheadings set \topmargin to \emptyfoottopmargin.
% The pagestyles footings and myfootings set \topmargin to \emptyheadtopmargin.
% The pagestyles empty and plain do not change \topmargin.
% Therefore, within one document,
% - you may switch between headings, myheadings, empty, and plain,
% - or you may switch between footings, myfootings, empty, and plain,
% - but you should not mix (my)headings with (my)footings pages.
% As a compromise between article (section+subsection) and report
% (chapter+section), \sectionmark (without uppercase) will be put on
% both side pages in the headings and footings style (neither chapter
% nor subsection).
\def\ps@plain{\let\@mkboth\@gobbletwo
\def\@oddhead{}\def\@evenhead{}%
\def\@oddfoot{\rm\hfil\thepage}%
\def\@evenfoot{\hss \hbox to \fullwidth{\normalsize\rm\thepage\hfil}}}
% The \condbreak{length} command is defined for conditional pagebreaks:
% If less then length vertical space remains on the current page, then
% a new page is started. This means that the following stuff remains
% together (either on the current or the next page).
\def\condbreak#1{\vskip 0pt plus #1\pagebreak[3]\vskip 0pt plus -#1\relax}
% The \noparskip command is defined to take away the vertical Parskip,
% just like \noindent takes away the horizontal Parindent.
\def\noparskip{\vskip-\parskip}
% Correction of a LaTeX bug that occurs when marginpars and footnotes
% appear on the same page (by Chris Rowley, TUGboat 9/2 Aug.88)
% Setting of the Layout Parameters and Dimensions:
% ------------------------------------------------
% Switch to \onecolumn and disable \twocolumn.
\onecolumn
\let\onecolumn=\relax
\def\twocolumn{\typeout{Twocolumn not allowed with Refman.}}
% Horizontal Layout:
% \fullwidth = \leftmarginwidth + \textwidth
% \odd&evensidemargin = \leftmarginwidth - 3mm
% (DIN-A4 paper is about 6mm narrower than 8.5 Inch.)
% \marginparwidth = \leftmarginwidth - \marginparsep
% \textwidth, \columnwidth, \linewidth remain unchanged from art10...rep12
\fullwidth=6.5in
\leftmarginwidth=\fullwidth \advance\leftmarginwidth by -\textwidth
\oddsidemargin=\leftmarginwidth \advance\oddsidemargin by -3mm
\evensidemargin=\oddsidemargin
\marginparwidth=\leftmarginwidth \advance\marginparwidth by -\marginparsep
% The horizontal layout can be changed in the preamble with the command
% \setleftmarginwidth{length}
% This sets \leftmarginwidth=length and \textwidth=\fullwidth-<length> .
% Example: \setleftmarginwidth{2.5in} ---> 2.5 : 4 = 4 : 6.5
\newdimen\templength@
\def\setleftmarginwidth#1{\templength@=#1\relax
\leftmarginwidth=\templength@
\textwidth=\fullwidth \advance\textwidth by -\templength@
\oddsidemargin=\leftmarginwidth \advance\oddsidemargin by -3mm
\evensidemargin=\oddsidemargin
\marginparwidth=\leftmarginwidth \advance\marginparwidth by -\marginparsep
\hsize=\textwidth \linewidth=\textwidth \columnwidth=\textwidth }
% Vertical Layout (for DIN-A4 paper):
% The Top Margin is made smaller by 4.5 baselineskips,
% the Head and Foot separations are increased by 0.5 baselineskips each,
% the Textheight is increased by 10 lines.
% On DIN-A4 paper (which is about 2 lines higher than 11 Inch), this
% makes the Bootom Margin equal to the Top Margin.
% \raggedbottom is switched on (even for twoside).
% With some pagestyles, the page contents are shifted up or down a bit,
% by using \emptyheadtopmargin or \emptyfoottopmargin, respectively.
\advance\topmargin by -4.5\baselineskip
\advance\headsep by 0.5\baselineskip
\advance\footskip by 0.5\baselineskip
\advance\textheight by 10\baselineskip
\@colht=\textheight \@colroom=\textheight
\emptyheadtopmargin=\topmargin \advance\emptyheadtopmargin by -1\baselineskip
\emptyfoottopmargin=\topmargin \advance\emptyfoottopmargin by 1\baselineskip
\raggedbottom
% Zero minimal vertical separation between Marginpars (because we use a lot
% of them, and all must find room above each other).
\marginparpush=\z@
% Paragraph Layout:
% Zero Parindent and non-zero Parskip. The stretchable glue in \parskip
% helps LaTeX in finding the best place for page breaks.
\parskip=0.5\baselineskip \advance\parskip by 0pt plus 2pt
\parindent=\z@
% Redefinition of the vertical spacing in the list environments
% to use the same as \parskip in all relevant places (normalsize only):
% \parsep = \parskip
% \itemsep = \z@ % add nothing to \parskip between items
% \topsep = \z@ % add nothing to \parskip before first item