%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                  outline.sty -- Outline Style
%                           Hal R. Varian
%                          September, 1987
%
%  Reads structured files generated by PC-OUTLINE and formats them
%  in TeX.  Before using you must use a global search and replace command
%  to change all strings of ".HEAD" to "\HEAD".  Then load outline.sty
%  and TeX the outline file.
%
%  Notes
%  1. To generate the outline, choose "Send to structured file" from the
%     device menu in the print routine of PC-OUTLINE.
%  2. The title must be indicated manually using \title.  It is usually
%     indicated by a .HEAD 1
%  3. Sometimes the structured file ends with a spurious .HEAD 1 which should
%     be removed.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
%for title
\def\title#1{\centerline{\bf #1}\medskip}
     
%use \count11 thru \count18 for counters for levels 1 thru 8
     
\count11=0
\count12=0
\count13=0
\count14=0
\count15=0
\count16=0
\count17=0
\count18=0
     
%create registers for levels, etc.
     
\newcount\CurrentLevel\CurrentLevel=0
\newcount\LastLevel\LastLevel=0
\newcount\CurrentCounter\CurrentCounter=1
\newcount\CharCode\CharCode=96
     
%\Indentation measures the amount of indentation
\newdimen\Indentation\Indentation=3ex
     
%skip between level 1 headings
\def\AdjustSpace{\vskip -.5pc}
     
\parindent=0pt
\parskip=0pt
     
\def\HEAD #1 {%
\par
\CurrentLevel=#1
\CurrentCounter=#1
\advance\CurrentCounter by 10         %level 1 is assigned to register 11, etc.
\ifnum\CurrentLevel>\LastLevel                %if sublevel,
   \count\CurrentCounter=1                    %reset \CurrentCounter,
   \else\advance\count\CurrentCounter by 1\fi %otherwise, increment
\LastLevel=\CurrentLevel
\filbreak     %helps prevent entries from being split between pages
\hskip\CurrentLevel\Indentation
\CharCode=\number\count\CurrentCounter  %for lettered levels
\let\NumCode=\CharCode                  %for numbered levels
\ifcase#1%
\relax\or                               %there is no level zero
   \AdjustSpace\advance\CharCode by 64
\Item\char\CharCode.\space\or           %level 1: A.
\Item\llap{\number\NumCode.\space}\or   %level 2: 1.
   \advance\CharCode by 96
\Item\llap{\char\CharCode)\space}\or    %level 3: a)
\Item\llap{\number\NumCode)\space}\or   %level 4: 1)
   \advance\CharCode by 96
\Item\llap{\char\CharCode$>$\space}\or  %level 5: a>
\Item\llap{\number\NumCode$>$\space}\or %level 6: 1>
   \advance\CharCode by 96
\Item\llap{\char\CharCode:\space}\or    %level 7: a:
\Item\llap{\number\NumCode:\space}\fi}  %level 8: 1:
     
\def\Item{\hangindent\CurrentLevel\Indentation}
%%%-Incise----------------------------------------------------------
