% The WITPress LaTeX Document Class % Copyright 2001 Newgen Imaging Systems Private Limited % % Please mail you queries to texsupport@newgenimaging.com % \newcommand\classname{witpress} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{witpress}[2001/10/13 Version 1.00 WITPress LaTeX Document Class] % Document options % Paper sizes \DeclareOption{a4paper} {\setlength\paperheight {297mm}% \setlength\paperwidth {210mm}} \DeclareOption{a5paper} {\setlength\paperheight {210mm}% \setlength\paperwidth {148mm}} \DeclareOption{b5paper} {\setlength\paperheight {250mm}% \setlength\paperwidth {176mm}} \DeclareOption{letterpaper} {\setlength\paperheight {11in}% \setlength\paperwidth {8.5in}} \DeclareOption{legalpaper} {\setlength\paperheight {14in}% \setlength\paperwidth {8.5in}} \DeclareOption{executivepaper} {\setlength\paperheight {10.5in}% \setlength\paperwidth {7.25in}} % Type area sizes \DeclareOption{demy} {\setlength\textwidth {115mm}% \setlength\textheight {170mm}} \DeclareOption{royal} {\setlength\textwidth {115mm}% \setlength\textheight {190mm}} \DeclareOption{quarto} {\setlength\textwidth {135mm}% \setlength\textheight {202mm}} % Support these LaTeX options \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse} \DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue} \DeclareOption{draft}{\setlength\overfullrule{5pt}% \PassOptionsToPackage{draft}{graphics}% \PassOptionsToPackage{draft}{graphicx}}% \DeclareOption{final}{\setlength\overfullrule{0pt}} \newif\if@timesfonts \@timesfontstrue % Don't want to use the times fonts? \DeclareOption{cmfonts}{\@timesfontsfalse} \ExecuteOptions{a4paper,demy,twoside,final} % Choose Demy size by default \ProcessOptions\relax % Load all necessary packages \RequirePackage{latexsym} \if@timesfonts \RequirePackage{times} \fi \def\bfdefault{b} % Not sure if needed. \newcommand\@ptsize{0} % % Set page layout dimensions % \setlength\headheight{\z@} % no running head \setlength\topskip{10\p@} % height of first line of text \setlength\headsep{\z@} % space below running head -- \setlength\footskip{\z@} % space above footer line \setlength\maxdepth{.5\topskip} % pages can be short or deep by half a line? % Set the margins % Side \setlength\@tempdima {\paperwidth} \addtolength\@tempdima {-\textwidth} \setlength\oddsidemargin {.5\@tempdima} \addtolength\oddsidemargin {-1in} \setlength\marginparwidth {.5\@tempdima} \addtolength\marginparwidth {-\marginparsep} \ifdim\marginparwidth < 2pc \marginparwidth=2pc \fi \setlength\evensidemargin {\paperwidth} \addtolength\evensidemargin{-2in} \addtolength\evensidemargin{-\textwidth} \addtolength\evensidemargin{-\oddsidemargin} % Top \setlength\topmargin{\paperheight} \addtolength\topmargin{-2in} \addtolength\topmargin{-\headheight} \addtolength\topmargin{-\headsep} \addtolength\topmargin{-\textheight} \addtolength\topmargin{-\footskip} \addtolength\topmargin{-.5\topmargin} \@settopoint\topmargin % Default font sizes \renewcommand\normalsize{% \@setfontsize\normalsize{10\p@}{12\p@}% \abovedisplayskip 10\p@ \@plus 3\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus 3\p@ \belowdisplayshortskip 6\p@ \@plus 3\p@ \@minus2\p@ \belowdisplayskip \abovedisplayskip \let\@listi\@listI} \normalsize \let\@bls\baselineskip \newcommand\small{% \@setfontsize\small{9\p@}{11\p@}% \abovedisplayskip 6\p@ \@plus1\p@ \@minus1\p@ \abovedisplayshortskip \z@ \@plus2\p@ \belowdisplayshortskip 2\p@ \@plus1\p@ \@minus1\p@ \def\@listi{\leftmargin\leftmargini \listparindent 1em \topsep 6\p@ \@plus2\p@ \@minus1\p@ \parsep \z@ \itemsep \z@}% \belowdisplayskip \abovedisplayskip} \newcommand\footnotesize{% \@setfontsize\footnotesize{8\p@}{10\p@}% \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus \p@ \belowdisplayshortskip 3\p@ \@plus2\p@ \@minus2\p@ \def\@listi{\leftmargin\leftmargini \listparindent 1em \topsep 5\p@ \@plus 2\p@ \@minus 1\p@ \parsep \z@ \itemsep \z@}% \belowdisplayskip \abovedisplayskip} \def\scriptsize{\@setfontsize\scriptsize{7\p@}{9\p@}} \def\tiny{\@setfontsize\tiny{6\p@}{7\p@}} \def\little{\@setfontsize\little{5\p@}{6\p@}} \def\large{\@setfontsize\large{12\p@}{14\p@}} \def\Large{\@setfontsize\Large{14\p@}{16\p@}} \def\LARGE{\@setfontsize\LARGE{16\p@}{18\p@}} \def\huge{\@setfontsize\huge{24\p@}{26\p@}} \def\Huge{\@setfontsize\Huge{25\p@}{27\p@}} \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} \DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf} \DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} \DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf} \DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} \DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl} \DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc} % Line spacing \setlength\lineskip{1\p@} \setlength\normallineskip{1\p@} \renewcommand\baselinestretch{} % Paragraph dimensions and inter-para spacing \setlength\parskip{0\p@} \setlength\parindent{1em} % Set inter-para skips \setlength\smallskipamount{3\p@ \@plus 1\p@ \@minus 1\p@} \setlength\medskipamount{6\p@ \@plus 2\p@ \@minus 2\p@} \setlength\bigskipamount{12\p@ \@plus 4\p@ \@minus 4\p@} % Page break penalties \@lowpenalty 51 \@medpenalty 151 \@highpenalty 301 % Disallow widows and orphans \widowpenalty=9999 \clubpenalty=9999 % Disable page breaks before equations, allow pagebreaks after % equations and discourage widow lines before equations. \displaywidowpenalty 1000 \predisplaypenalty 10000 \postdisplaypenalty 1500 % Allow breaking the page in the middle of a paragraph \interlinepenalty 0 % Hyphenation; don't split words into less than three characters % No consecutive hyphens, disallow breaking the page after % a hyphenated line \lefthyphenmin=3 \righthyphenmin=3 \doublehyphendemerits=10000 \brokenpenalty 7000 % Don't allow footnotes to split over pages \interfootnotelinepenalty=9999 \setlength\columnsep{12\p@} % space between columns for double-column text \setlength\columnseprule{0\p@} % width of rule between two columns % Footnotes \setlength\footnotesep{6.65\p@} % space between footnotes % space between text and footnote \setlength{\skip\footins}{12\p@ \@plus 4\p@ \@minus 2\p@} % Float placement parameters % The total number of floats that can be allowed on a page. \setcounter{totalnumber}{10} % The maximum number of floats at the top and bottom of a page. \setcounter{topnumber}{5} \setcounter{bottomnumber}{5} % The maximum part of the top or bottom of a text page that can be % occupied by floats. This is set so that at least four lines of text % fit on the page. \renewcommand\topfraction{.9} \renewcommand\bottomfraction{.9} % The minimum amount of a text page that must be occupied by text. % This should accomodate four lines of text. \renewcommand\textfraction{.06} % The minimum amount of a float page that must be occupied by floats. \renewcommand\floatpagefraction{.94} % The same parameters repeated for double column output \renewcommand\dbltopfraction{.9} \renewcommand\dblfloatpagefraction{.9} % Space between floats \setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@} % Space between floats and text \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} % Space above and below an inline figure \setlength\intextsep {18\p@ \@plus 2\p@ \@minus 2\p@} % For double column floats \setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@} \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} % Space left at top, bottom and inbetween floats on a float page. \setlength\@fptop{0\p@} % no space above float page figures \setlength\@fpsep{12\p@ \@plus 1fil} \setlength\@fpbot{0\p@ \@plus 1fil} % The same for double column \setlength\@dblfptop{0\p@} \setlength\@dblfpsep{12\p@ \@plus 1fil} \setlength\@dblfpbot{0\p@ \@plus 1fil} % Sectional units % Lowest level heading that takes a number by default \setcounter{secnumdepth}{4} % Counters \newcounter{chapter} \newcounter{section}[chapter] \newcounter{subsection}[section] \newcounter{subsubsection}[subsection] \newcounter{paragraph}[subsubsection] \newcounter{subparagraph}[paragraph] \newcounter{figure}[chapter] \newcounter{table}[chapter] % Form of the numbers \newcommand\thepage{\arabic{page}} \renewcommand\thechapter{\arabic{chapter}} \renewcommand\thesection{\arabic{section}} \renewcommand\thesubsection{{\thesection.\arabic{subsection}}} \renewcommand\thesubsubsection{{\thesubsection.\arabic{subsubsection}}} \renewcommand\theparagraph{\thesubsubsection.\arabic{paragraph}} \renewcommand\thesubparagraph{\theparagraph.\arabic{subparagraph}} \renewcommand\theequation{\arabic{equation}} \newcommand\@chapapp{\chaptername} \newcommand\contentsname{Contents} \newcommand\listfigurename{List of Figures} \newcommand\listtablename{List of Tables} \newcommand\chaptername{Chapter} \newcommand\appendixname{Appendix} \newcommand\abstractname{Abstract} \newcommand\refname{References} \newcommand\bibname{Bibliography} \newcommand\indexname{Index} \newcommand\figurename{Figure} \newcommand\tablename{Table} % Frontmatter, mainmatter and backmatter % Just switch between page numbering styles. \newif\if@mainmatter \@mainmattertrue \newcommand\frontmatter{% \clearpage \@mainmatterfalse \pagenumbering{roman}} \newcommand\mainmatter{% \clearpage \@mainmattertrue \pagenumbering{arabic}} \newcommand\backmatter{% \clearpage \@mainmatterfalse} \def\chapter{\clearpage \thispagestyle{empty} \global\@topnum\z@ \@afterindentfalse \secdef\@chapter\@schapter} \def\@chapter[#1]#2{% \ifnum \c@secnumdepth >\m@ne \refstepcounter{chapter} \typeout{^^J\@chapapp\space\arabic{chapter}:} \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1} \else \addcontentsline{toc}{chapter}{#1} \fi \@makechapterhead{#2} \@afterindentfalse \@afterheading} \def\@schapter#1{% \@makeschapterhead{#1} \@afterindentfalse \@afterheading} \def\@makechapterhead#1{% \begingroup \parindent \z@ \vspace*{30mm}% \fontsize{16}{18}\fontseries{b}\selectfont #1\par \vspace{16\p@} \endgroup} \def\@makeschapterhead#1{% \begingroup \parindent \z@ \vspace*{30mm}% \fontsize{16}{18}\fontseries{b}\selectfont #1\par \vspace{16\p@} \endgroup} % Add address \def\address#1{\gdef\@address{#1}} \newcommand\maketitle{\par \begingroup \renewcommand\thefootnote{\@fnsymbol\c@footnote}% \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% \long\def\@makefntext##1{\parindent 1em\noindent \hb@xt@1.8em{% \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% \newpage \global\@topnum\z@ % Prevents figures from going at top of page. \@maketitle \thispagestyle{empty}\@thanks \endgroup \setcounter{footnote}{0}% \global\let\thanks\relax \global\let\maketitle\relax \global\let\@maketitle\relax \global\let\@thanks\@empty \global\let\@author\@empty \global\let\@address\@empty \global\let\@date\@empty \global\let\@title\@empty \global\let\title\relax \global\let\author\relax \global\let\date\relax \global\let\and\relax } \def\@maketitle{% \newpage \vspace*{30mm}% \begingroup \parindent\z@ \let \footnote \thanks {\fontsize{16}{18}\selectfont\bfseries\raggedright \@title \par}% \vspace{15pt} {\fontsize{12}{14}\selectfont\raggedright \@author \par}% {\fontsize{11}{13}\fontshape{it}\selectfont\raggedright \@address \par}% \vspace{24pt}% \endgroup} % Abstract \newenvironment{abstract}{{\noindent\large\bfseries\abstractname}\par\vspace{12pt}% \normalfont\normalsize\noindent\ignorespaces }{} % Text headings \renewcommand{\@seccntformat}[1]{{\csname the#1\endcsname}\enskip} \def\section{% \@startsection{section}{1}{\z@} {-1\@bls plus -1\p@}{1\@bls} {\reset@font\normalfont\large\bfseries\raggedright}} \def\subsection{% \@startsection{subsection}{2}{\z@} {-1\@bls plus -1\p@}{1\@bls} {\reset@font\normalfont\normalsize\bfseries\raggedright}} \def\subsubsection{% \@startsection{subsubsection}{3}{\z@} {-1\@bls plus -1\p@}{1sp} {\reset@font\normalfont\normalsize\bfseries\raggedright}} \def\paragraph{% \@startsection{paragraph}{4}{\z@} {-1\@bls plus -1\p@}{-1em} {\reset@font\normalfont\normalsize\bfseries}} % Figures and Tables and captions \newlength{\abovecaptionskip} \newlength{\belowcaptionskip} \setlength{\abovecaptionskip}{7pt} \setlength{\belowcaptionskip}{11pt} \long\def\@caption#1[#2]#3{\addcontentsline{\csname ext@#1\endcsname}{#1} {\protect\numberline{\csname fnum@#1\endcsname} {\ignorespaces #2}} \begingroup \@parboxrestore \@makecaption{\csname fnum@#1\endcsname}{#3}\par \endgroup} \newbox\@tempboxb \newdimen\@captionwidth \long\def\@makecaption#1#2{\vspace{\abovecaptionskip} \setbox\@tempboxa\hbox{{#1:}\ #2\strut}% \setbox\@tempboxb\hbox{{#1:}\ }% \setlength\@captionwidth{\textwidth}% \addtolength\@captionwidth{-\wd\@tempboxb}% \ifdim \wd\@tempboxa >\hsize \par {#1:}\ \begin{tabular}[t]{@{}p{\@captionwidth}@{}}#2\end{tabular}% \else \hbox to\hsize{\hfil\box\@tempboxa\hfil} \fi} \long\def\@tablecaption#1#2{\vspace{\belowcaptionskip}% \setbox\@tempboxa\hbox{{#1:}\ #2\strut}% \setbox\@tempboxb\hbox{{#1:}\ }% \setlength\@captionwidth{\textwidth}% \addtolength\@captionwidth{-\wd\@tempboxb}% \ifdim \wd\@tempboxa >\hsize \par {#1:}\ \begin{tabular}[t]{@{}p{\@captionwidth}@{}}#2\end{tabular}% \else \hbox to\hsize{\hfil\box\@tempboxa\hfil} \fi\vspace{\belowcaptionskip}} \def\thefigure{\@arabic\c@figure} \def\fps@figure{tbp} \def\ftype@figure{1} \def\ext@figure{lof} \def\fnum@figure{\figurename~\thefigure} \def\figure{\@float{figure}} \let\endfigure\end@float \@namedef{figure*}{\@dblfloat{figure}} \@namedef{endfigure*}{\end@dblfloat} \def\thetable{\@arabic\c@table} \def\fps@table{tbp} \def\ftype@table{2} \def\ext@table{lot} \def\fnum@table{\tablename~\thetable} \def\table{\let\@makecaption\@tablecaption\@float{table}} \let\endtable\end@float \@namedef{table*}{\let\@makecaption\@tablecaption\@dblfloat{table}} \@namedef{endtable*}{\end@dblfloat} % Lists - as in article.cls \setlength\leftmargini {2.5em} \leftmargin \leftmargini \setlength\leftmarginii {2.2em} \setlength\leftmarginiii {1.87em} \setlength\leftmarginiv {1.7em} \setlength\leftmarginv {1em} \setlength\leftmarginvi {1em} \setlength \labelsep {.5em} \setlength \labelwidth{\leftmargini} \addtolength\labelwidth{-\labelsep} \renewcommand\theenumi{\@arabic\c@enumi} \renewcommand\theenumii{\@alph\c@enumii} \renewcommand\theenumiii{\@roman\c@enumiii} \renewcommand\theenumiv{\@Alph\c@enumiv} \newcommand\labelenumi{\theenumi.} \newcommand\labelenumii{(\theenumii)} \newcommand\labelenumiii{\theenumiii.} \newcommand\labelenumiv{\theenumiv.} \renewcommand\p@enumii{\theenumi} \renewcommand\p@enumiii{\theenumi(\theenumii)} \renewcommand\p@enumiv{\p@enumiii\theenumiii} \newcommand\labelitemi{\textbullet} \newcommand\labelitemii{\normalfont\bfseries \textendash} \newcommand\labelitemiii{\textasteriskcentered} \newcommand\labelitemiv{\textperiodcentered} \newenvironment{description} {\list{}{\topsep\bigskipamount\labelwidth\z@ \itemindent-\leftmargin \let\makelabel\descriptionlabel}} {\endlist} \newcommand*\descriptionlabel[1]{\hspace\labelsep \normalfont\bfseries #1} % Verse, quotation, and quote environments. % The same as in article.cls \newenvironment{verse} {\let\\\@centercr \list{}{\itemsep \z@ \itemindent -1.5em% \listparindent\itemindent \rightmargin \leftmargin \advance\leftmargin 1.5em}% \item\relax} {\endlist} \newenvironment{quotation} {\list{}{\listparindent 1.5em% \itemindent \listparindent \rightmargin \leftmargin \parsep \z@ \@plus\p@}% \item\relax} {\endlist} \newenvironment{quote} {\list{}{\rightmargin\leftmargin}% \item\relax} {\endlist} % Table of Contents \newcommand\@pnumwidth{1.55em} \newcommand\@tocrmarg{2.55em} \newcommand\@dotsep{4.5} \setcounter{tocdepth}{2} \newcommand\tableofcontents{% \chapter*{\contentsname \@mkboth{% \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}% \@starttoc{toc}% } \newcommand*\l@chapter[2]{% \ifnum \c@tocdepth >\m@ne \addpenalty{-\@highpenalty}% \vskip 1.0em \@plus\p@ \setlength\@tempdima{1.5em}% \begingroup \parindent \z@ \rightskip \@pnumwidth \parfillskip -\@pnumwidth \leavevmode \bfseries \advance\leftskip\@tempdima \hskip -\leftskip #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par \penalty\@highpenalty \endgroup \fi} \newcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}} \newcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}} \newcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}} \newcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}} \newcommand*\l@subparagraph{\@dottedtocline{5}{12em}{6em}} \newcommand\listoffigures{% \chapter*{\listfigurename}% \@mkboth{\MakeUppercase\listfigurename}% {\MakeUppercase\listfigurename}% \@starttoc{lof}% } \newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}} \newcommand\listoftables{% \chapter*{\listtablename}% \@mkboth{% \MakeUppercase\listtablename}% {\MakeUppercase\listtablename}% \@starttoc{lot}% } \let\l@table\l@figure \newenvironment{thebibliography}[1] {\section*{\refname}% \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}% \list{\@biblabel{\@arabic\c@enumiv}}% {\settowidth\labelwidth{\@biblabel{#1}}% \leftmargin\labelwidth \advance\leftmargin\labelsep \usecounter{enumiv}% \let\p@enumiv\@empty \renewcommand\theenumiv{\@arabic\c@enumiv}}% \sloppy \clubpenalty4000 \@clubpenalty \clubpenalty \widowpenalty4000% \sfcode`\.\@m} {\def\@noitemerr {\@latex@warning{Empty `thebibliography' environment}}% \endlist} \newcommand\newblock{} \let\@openbib@code\@empty \newenvironment{theindex} {\columnseprule \z@ \columnsep 35\p@ \twocolumn[\@makeschapterhead{\indexname}]% \@mkboth{\MakeUppercase\indexname}% {\MakeUppercase\indexname}% \thispagestyle{plain}\parindent\z@ \parskip\z@ \@plus .3\p@\relax \let\item\@idxitem} {\onecolumn} \newcommand\@idxitem{\par\hangindent 40\p@} \newcommand\subitem{\@idxitem \hspace*{20\p@}} \newcommand\subsubitem{\@idxitem \hspace*{30\p@}} \newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax} % Footnotes \renewcommand\footnoterule{% \kern-3\p@ \hrule\@width.4\columnwidth \kern2.6\p@} \@addtoreset{footnote}{chapter} \newcommand\@makefntext[1]{% \parindent 1em% \noindent \hb@xt@1.8em{\hss\@makefnmark}#1} % Appendix \def\appendix{\par \setcounter{chapter}{0} \setcounter{section}{0} \setcounter{subsection}{0} \appendtrue \def\@chapapp{App.\ } \def\thechapter{\Alph{chapter}}} % Math parameters \setlength{\jot}{5\p@} % Reset eqnarray to avoid to avoid \arraycolsep between % columns. Take from a post on comp.text.tex % by Fred Bartlett \newif\if@alignpoint \def\eqnarray{% \stepcounter{equation}% \def\@currentlabel{\p@equation\theequation}% \global\@eqnswtrue \m@th \global\@eqcnt\z@ \tabskip\@centering \let\\\@eqncr $$\everycr{}\halign to\displaywidth\bgroup \hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel &\global\@eqcnt\@ne\hfil\setbox\z@\hbox{$\displaystyle{{}##{}}$}% \global\ifdim\wd\z@>\z@\@alignpointtrue\else\@alignpointfalse\fi \box\z@\hfil &\global\@eqcnt\tw@$\displaystyle{\if@alignpoint\else{}\fi##}$\hfil \tabskip\@centering &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup \tabskip\z@skip \cr} % Table, array and box values \setlength\arraycolsep{.5em} \setlength\tabcolsep{.5em} \setlength\arrayrulewidth{.4pt} \setlength\doublerulesep{2pt} \renewcommand\arraystretch{1.25} \setlength\tabbingsep{\labelsep} \skip\@mpfootins = \skip\footins \setlength\fboxsep{3\p@} \setlength\fboxrule{.4\p@} \flushbottom \frenchspacing \ps@empty \onecolumn \endinput % End of file witpress.cls