% pdclft.def 1.2 1995/03/30 -- macros for short documents
%%%@TeX-definition-file {
%%% filename       = "pdclft.def",
%%% version        = "1.2",
%%% date           = "1995/03/30",
%%% package        = "pdcmac 1.0",
%%% author         = "P. Damian Cugley",
%%% email          = "damian.cugley@comlab.ox.ac.uk",
%%% address        = "Oxford University Computing Laboratory,
%%%                   Parks Road, Oxford  OX1 3QD, UK",
%%% codetable      = "USASCII",
%%% keywords       = "TeX, plain TeX, style file",
%%% supported      = "Maybe",
%%% abstract       = "Sectioning macros for style files.
%%%                   This macro file was generated by running plain
%%%                   TeX on pdcsty.dtx",
%%% copyright      = "Copyright (c) 1991-1995 P. Damian Cugley",
%%% copying        = "DO NOT DISTRIBUTE THIS FILE.
%%%                   Distribute pdcsty.dtx only as part of the
%%%                   package it came in.",
%%% dependencies   = ""
%%%}

\message{1.2 <pdc 1995/03/30>}

\topmg=297mm \advance\topmg-11in \advance\topmg7mm
\botmg=\topmg
\advance\topmg\ht\strutbox \advance\topmg\headlineskip
\ifdim \topmg<20mm \topmg=20mm \fi
\ifdim \botmg<27mm \botmg=27mm \fi
\setpaper{210mm}{297mm}
\setnkgrid{4}{3}
\colrule=0pt
\leftmargin=\gridwd \advance\leftmargin\colsep
\everypage={\ifdim\leftmargin>0pt
    \setbox\leftbox=\hbox to \gridwd{}\fi}
\everyfootnote={\notefonts}
\everylinenum={\smallfonts}
\everylinenum={\smallfonts}
\everytag={\bf}
\newcount\secno \newcount\subsecno
\def\thesecno{%
    \n{%
        \number\secno
        \ifnum\subsecno>0
            .\number\subsecno
        \fi
    }%
}
\def\section{
    \global\advance\secno1 \global\subsecno0
    \doheading\medskipamount{\subheadingfonts\thesecno\enspace}{}
}
\def\subsec{
    \global\advance\subsecno1
    \doheading\smallskipamount{\bodyfonts\thesecno\enspace}{}
}
\newtoks\majorheadline
\expandafter\majorheadline
    \expandafter{\expandafter\uppercase\expandafter{\jobname}}
\newif\ifnoheadline \newif\iftwosided
\headline{%
    \ifnoheadline
        \hfil
    \else\iftwosided
        \ifodd\pageno
            \hfil \the\majorheadline \quad{\bf\folio}%
        \else
            {\bf\folio}\quad \the\majorheadline\hfil
        \fi
    \else
        \hfil \the\majorheadline \quad{\bf\folio}%
    \fi\fi
}
\footline{%
    \ifnoheadline
        \global\noheadlinefalse
        \hfil{\bf\folio}\hfil
    \else
        \hfil
    \fi
}
\def\pt{\,{\rm pt}}
\def\mm{\,{\rm mm}}
\def\MF{{\ifdim\fontdimen1\font>0pt \mfi \else \mf \fi META}\-%
        {\ifdim\fontdimen1\font>0pt \mfi \else \mf \fi FONT}}
\def\MSDOS{\leavevmode\hbox{MS-DOS}}
\def\TeX{T\kern-0.1em\lower0.5ex\hbox{E}X\spacefactor1000 }
\begingroup\catcode`\|=12 \toks0={\endgroup
    \def\dfn#1{\ifx\index\UNDEFINED\else\index{#1|INDdfn}\fi{\bi #1}}
} \the\toks0
\declareactivechar\* \def*#1*{{\it#1\/}}
\def\|{%
    \relax\ifmmode
        \Vert
    \else
        \begingroup
        \ttb \setupverbatim
        \catcode`\|=13 \let|\endgroup
    \fi
}
\def\inputifexists#1{%
    \openin15=#1
    \ifeof15 \else \input #1 \fi
    \closein15
}
