% dvidoc style file.  Fixes things up so your file uses only fixed width 
% non-math characters, at least if you don't use math mode 
%
% The first section defines all the font change commands to use the
% doc pseudo-font.  It is taken from John Pavel's dvidoc.sty, March 1987
%
\makeatletter
% Modified the font selection mechanism by Jan Wielemaker
% (jan@swi.psy.uva.nl) for use with LaTeX2e.

\font\doctt=doc
\font\docbf=docbf
\font\docul=docul
\font\verbtt=cmtt12
%\renewcommand{\selectfont}{\doctt}
\renewcommand{\selectfont}{%
	\ifthenelse{\equal{\f@family}{\ttdefault}}%
		   {\verbtt}%
		   {\ifthenelse{\equal{\f@series}{\bfdefault}}%
		               {\docbf}%
			       {\ifthenelse{\equal{\f@shape}{\itdefault}}%
			       {\docul}%
			       {\doctt}}}}
\doctt

% version from John Pavel's dvidoc.sty, March 1987
%
% These dimensional definitions are also taken from Langdon, though with
% some changes, e.g. not ragged right/bottom and parind 3 instead of 5. 
% horizontal dimensions had best be multiples of \em
\hsize 72 em                  % 78 characters per line so fit any screen
% \rightskip=0pt plus 4em       % ragged right
% \spaceskip=1em                % forces ONE space between words
% \frenchspacing        suppresses extra blanks after punctuation -don't
% \parindent=3em
\def\enspace{\kern 1em} \def\enskip{\hskip 1em\relax}
%
% vertical skips may best be multiples of \baselineskip
\baselineskip=12pt            % 6 lines per inch
% \vsize                        % default give 58 lines -OK
\voffset=\baselineskip        % so don't lose \headline
% \parskip=0pt
\smallskipamount=0pt
\medskipamount= \baselineskip
\bigskipamount=2\baselineskip
% \raggedbottom
%
% By default itemize is done with bullets, which we don't have. use hyphen 
% now fix up various latexish stuff
% 
% \def\labelitemi{ -}
% \def\labelitemii{ -}
% \def\labelitemiii{ -}
% \def\labelitemiv{ -}
%
% Fix up table of contents.  Default latex uses fractional spacing between 
% the section number and title.  This comes out as no space in the doc file 
% so we add a space to numberline, and expand tempdima by one em to allow 
% for it.  Also, go out of math mode for the dot in the leader.  Dots in 
% math mode turn out to be colons! 
%
\def\@dottedtocline#1#2#3#4#5{\ifnum #1>\c@tocdepth \else
  \vskip \z@ plus .2pt
 {\hangindent #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
   \parindent #2\relax\@afterindenttrue
  \interlinepenalty\@M
  \leavevmode 
  \@tempdima #3\relax
  \addtolength\@tempdima{1em}
   #4\nobreak\leaders\hbox to 2em{\hss.\hss}\hfill \nobreak \hbox to\@pnumwidth{\hfil\rm #5}\par}\fi}
\def\numberline#1{\advance\hangindent\@tempdima \hbox to\@tempdima{#1\hfil}\ }
%
% Can't really do superscripts, so do footnotes with [] 
%
\def\@makefnmark{\hbox{(\@thefnmark)}}
\long\def\@makefntext#1{\parindent 1em\noindent 
            \hbox to 3em{\hss\@thefnmark.}\ #1}
\skip\footins 24pt plus 4pt minus 2pt
\def\footnoterule{\kern-12\p@   
\hbox to .4\columnwidth{\leaders\hbox{-}\hfill}} 
%
% \arrayrulewidth 1em \doublerulesep 1em 
%
% Some fairly obvious hacks.  No odd/even pages in doc files.  Can't do the
% fancy TeX symbols.
%
\oddsidemargin 0pt \evensidemargin 0pt
\def\TeX{TeX}
\def\LaTeX{LaTeX}
\def\SliTeX{SliTeX}
\def\BibTeX{BibTeX}
%
% special versions of stuff from xxx10.sty, since only one font size
%
\def\@normalsize{\@setsize\normalsize{12pt}\xpt\@xpt
\abovedisplayskip 12pt
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip  \z@
\belowdisplayshortskip \z@
\let\@listi\@listI}   % Setting of \@listi added 9 Jun 87
\let\small\@normalsize
\let\footnotesize\@normalsize
\normalsize
\footnotesep 12pt
\labelsep 10pt
\def\@listI{\leftmargin\leftmargini \parsep 12pt%
\topsep 12pt%
\itemsep 0pt}
\let\@listi\@listI
\let\@listii\@listI
\let\@listiii\@listI
\let\@listiv\@listI
\let\@listv\@listI
\let\@listvi\@listI
\@listI
%
% We had sort of random numbers of blank lines around section numbers.
% Turns out they used various fractional spacing.  Rather than depend
% upon the definition of startsection, just wrap something around it
% that normalizes the arguments to 12pt.  Negative args have special
% meanings.
\let\@oldstartsec\@startsection
\def\@startsection#1#2#3#4#5#6{
  \@tempskipa #4\relax
  \@tempskipb #5\relax
  \ifdim \@tempskipa <\z@ \@tempskipa -12pt \else \@tempskipa 12pt \fi
  \ifdim \@tempskipb >\z@ \@tempskipb 12pt \fi
\@oldstartsec{#1}{#2}{#3}{\@tempskipa}{\@tempskipb}{#6}
}
%
% Remaining unsolved problem: hrule and vrule are no-ops.  This is
% visible mostly in the tabular stuff, where none of the lines show up,
% though it's still basically usable.
%
\makeatother
