From:	CSBVAX::MRGATE!RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP 15-SEP-1988 10:57
To:	ARISIA::EVERHART
Subj:	RNO-to-TeX (again)


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Thu, 15 SEP 88 06:37:13 PDT
Received: from relay.ubc.ca by KL.SRI.COM with TCP; Thu, 15 Sep 88 06:23:22 PDT
Received: by relay.ubc.ca (5.59/1.14)
	id AA00522; Thu, 15 Sep 88 06:23:32 PDT
Date: 15 Sep 88 13:11 -0500
From: John Edgecombe <edgecombe%ccrs.cdn@relay.ubc.ca>
To: <tnieland@wpafb-aamrl.arpa>, <philmds!philtis!lcn@mcvax.cwi.nl>,
        <info-vax@kl.sri.com>
Message-Id: <12*edgecombe@ccrs.cdn>
Subject: RNO-to-TeX (again)

I have been getting more messages recently about the .INI file missing
(including Ted Nieland's to the net).  Although I posted the revised
share files, the volume implies that I shall have to do so again.
So here goes -- in five parts:


+-+-+-+ Beginning of part 2 +-+-+-+
X          newintvalue( arg[n], rightmargin, modified, extractedvalue);
X          noconversion
X       end;
X
X  { ***** NO FILL ***** }
X  30 : beginnofill( outfile );
X
X  { ***** FILL ***** }
X  31 : endnofill( outfile );
X
X  { ***** NO JUSTIFY ***** }
X  32 : begin
X          writeln(outfile,'\sloppy % - begin no justify');
X          writeln(    log,'\sloppy % - begin no justify');
X          justify := false
X       end;
X
X  { ***** JUSTIFY ***** }
X  33 : begin
X          writeln(outfile,'\fussy % - turn justification on');
X          writeln(    log,'\fussy % - turn justification on');
X          justify := true
X       end;
X
X  { ***** BREAK ***** }
X  34 : begin                        
X         if fill then
X`009 begin
X`009   writeln(outfile,'\hfil\linebreak');
X`009   writeln(    log,'\hfil\linebreak')
X`009 end
X         else
X`009 begin
X`009   writeln(outfile,'% RNOTOTEX - forced break');
X`009   writeln(    log,'% RNOTOTEX - forced break')
X`009 end
X       end;
X
X  { ***** SPACING ***** }
X  35 : begin
X          newintvalue(arg[n], spacing, modified, extractedvalue );
V          adjustlength(outfile, modified, spacing, extractedvalue, charheight,'
Xbaselineskip')
X       end;
X
X  { ***** SKIP ***** }
X  36 : begin          
X         if n = 1 then
X`009 begin
X`009    if (spacing > 0) and (spacing < 4) then
X`009    case spacing of
X`009        1 : begin
X`009              writeln(outfile,'\smallskip');
X`009              writeln(    log,'\smallskip')
X`009            end;
X`009        2 : begin
X`009              writeln(outfile,'\medskip');
X`009              writeln(    log,'\medskip')
X`009            end;
X`009        3 : begin
X`009               writeln(outfile,'\bigskip');
X`009               writeln(    log,'\bigskip')
X`009            end
X`009    end
X`009    else
X`009    begin
X`009       writeln(outfile,'\smallskip % - default skip amount');
X`009       writeln(    log,'\smallskip % - default skip amount')
X`009    end
X         end
X         else
X`009 begin
X           skip := 1;
X           newintvalue(arg[n], skip, modified, extractedvalue );
X           extractedvalue := extractedvalue * spacing;
X`009   write(outfile,'\vspace{'); 
X           write(    log,'\vspace{'); 
X           writecharheight(outfile, extractedvalue);
X           c(outfile)
X         end
X       end;
X
X  { ***** BLANK ***** }
X  37 : begin
X         if n = 1 then
X`009 begin
X`009   writeln(outfile,'\smallskip');
X           writeln(    log,'\smallskip')
X         end
X         else
X         begin
X`009   skip := 1;
X           newintvalue(arg[n], skip, modified, extractedvalue );
X           write(outfile,'\vspace{');  
X           write(    log,'\vspace{'); 
X`009   writecharheight(outfile, extractedvalue);
X           c(outfile)
X         end
X       end;
X
X  { ***** PAGE ***** }
X  38 : begin
V`009 writeln(outfile,'\pagebreak[0] \typeout{runoff page break encountered, may
X be ignored}');
X`009 writeln(    log,'\pagebreak[0]')
X       end;
X 
X  { ***** TEST PAGE ***** }
X  39 : noconversion;
X
X  { ***** CENTRE ***** }
X  40 : begin
X         if not centering then
X`009 begin
X           centering := true;         
X`009   if not fill then
X`009   begin
X`009     startnofillagain := true;
X`009     endnofill( outfile )
X           end;
X`009   writeln(outfile,'\begin{centering}');
X`009   writeln(    log,'\begin{centering}');
X           writeanothertexcommand := 40
X`009 end
X`009 else
X`009 begin
X`009   writeln(outfile,'% RNOTOTEX - centering already active');
X`009   writeln(    log,'% RNOTOTEX - centering already active')
X`009 end
X       end;
X
X  { ***** TAB STOPS ***** }
X  41 : noconversion;
X
X  { ***** INDENT ***** }
X  42 : begin
X          indent := 5;
X`009  newintvalue(arg[n], indent, modified, extractedvalue);
X          if modified = nochange then        
X          begin
X`009     write(outfile,'\indent ');
X`009     write(    log,'\indent ')
X          end
X          else              
X          begin
X            write(outfile,'\hspace*{');
X            write(    log,'\hspace*{');
X            writecharwidth(outfile, indent);
X            write(outfile,'} ');
X            writeln(log,'}')
X          end
X       end;
X
X   { ***** LEFT ***** }
X  43 : begin
X          indent := 5;
X`009  newintvalue(arg[n], indent, modified, extractedvalue);
X          if (modified = nochange) or (n = 1) then
X          begin
X`009     write(outfile,'\indent ');
X`009     write(    log,'\indent ')
X`009  end
X          else
X          begin                                                   
X            write(outfile,'\hspace*{');
X            write(    log,'\hspace*{');
X            writecharwidth(outfile, indent);
X            write(outfile,'} ');
X`009    writeln(log,'}')
X          end
X       end;
X 
X   { *****  RIGHT ***** }
X  44 : begin
X          if not flushright then
X`009  begin
X            if not fill then
X            begin
X`009      startnofillagain := true;
X`009      endnofill( outfile )
X`009    end;
X`009    flushright:= true;
X`009    writeln(outfile,'\begin{flushright}');
X`009    writeln(    log,'\begin{flushright}');
X            writeanothertexcommand := 44
X`009  end
X`009  else
X`009  begin
X`009    writeln(outfile,'% RNOTOTEX - flush right already active');
X`009    writeln(    log,'% RNOTOTEX - flush right already active')
X`009  end
X       end;
X
X   { ***** NO PERIOD ***** }
X  45 : begin 
X         writeln(outfile,'\frenchspacing');
X         writeln(    log,'\frenchspacing')
X       end;
X
X   { ***** PERIOD ***** }
X  46 : begin 
X`009 writeln(outfile,'\nofrenchspacing');
X`009 writeln(    log,'\nofrenchspacing')
X       end;
X
X   { ***** NO SPACE ***** }
X  47 : noconversion;
X
X   { ***** PARAGRAPH ***** }
X  48 : begin
X`009if n > 1 then
X `009begin
X`009    newintvalue(arg[2], paragraphdef.indent, modified, extractedvalue);
X `009    newintvalue(arg[3], paragraphdef.vertskip, modified, extractedvalue);
X`009    newintvalue(arg[4], paragraphdef.testpage, modified, extractedvalue)
X        end;
X`009writeln(outfile,'\par');
X`009writeln(    log,'\par')
X       end;
X
X   { ***** SET PARAGRAPH ***** }
X  49 : begin
X`009 newintvalue(arg[m(n-2)], paragraphdef.indent, modified, extractedvalue);
V `009 adjustlength(outfile, modified, paragraphdef.indent, extractedvalue,charw
Xidth,'parindent');
V `009 newintvalue(arg[m(n-1)], paragraphdef.vertskip, modified, extractedvalue)
X;
V`009 adjustlength(outfile, modified, paragraphdef.vertskip, extractedvalue,char
Xheight,'parskip');
X`009 newintvalue(arg[m(n)], paragraphdef.testpage, modified, extractedvalue)
X       end;
X
X   { ***** AUTOPARAGRAPH ***** }
X   50 : noconversion;
X
X   { ***** NO AUTOPARAGRAPH ***** }
X   51 : noconversion;
X
X   { ***** AUTOTABLE ***** }
X   52 :  noconversion;
X
X   { ***** NO AUTOTABLE ***** }
X   53 : noconversion;
X
X   { ***** DISABLE UNDERLINING ***** }
X   54 : turnflagoff( underline );
X
V   { ***** ENABLE UNDERLINING ***** }                                          
X                
X   55 : turnflagon( underline );
X
X   { ***** NO HYNPHENATION ***** }
X   56 : turnflagoff( hyphenate );
X
X   { ***** HYPENATION ***** }
X   57 : turnflagon( hyphenate );
X
X   { ***** DISABLE BOLDING ***** }
X   58 : turnflagoff( bold );
X
X   { *****  ENABLE BOLDING ***** }
X   59 : turnflagon( bold );
X
X   { ***** DISABLE OVERSTRIKE ***** }
X   60 : turnflagoff( overstrike );
X
X   { ***** ENABLE OVERSTRIKE ***** }
X   61 : turnflagon( overstrike );
X
X   { ***** ENABLE BAR ***** }
X   62 : noconversion;
X                       
X   { ***** BEGIN BAR  ***** }
X   63 : noconversion;
X
X   { ***** END BAR ***** }
X   64 : noconversion;
X
X   { ***** DISABLE BAR ***** }
X   65 : noconversion;
X
X   { ***** FIGURE ***** }
X   66 : begin
X`009   skip := 1;
X`009   newintvalue(arg[n], skip, modified, extractedvalue);
X`009   writeln(outfile,'\begin{figure}');
X           write(outfile,'\vspace{');
X`009   writeln(    log,'\begin{figure}');
X           write(    log,'\vspace{');
X           writecharheight(outfile, skip);
X           c(outfile);
X`009   writeln(outfile,'\caption{Another Figure}');
X           writeln(outfile,'\end{figure}');
X`009   writeln(    log,'\caption{Another Figure}');
X           writeln(    log,'\end{figure}')
X`009end;
X
X    { ***** FIGURE DEFFERED ***** }
X   67 : begin
X`009   skip := 1;
X`009   newintvalue(arg[n], skip, modified, extractedvalue);
X`009   writeln(outfile,'\begin{figure}');
X`009   writeln(    log,'\begin{figure}');
X           write(outfile,'\vspace{');
X           write(    log,'\vspace{');
X           writecharheight(outfile, skip);
X           c(outfile);
X`009   writeln(outfile,'\caption{Another Figure}');
X           writeln(outfile,'\end{figure}');
X`009   writeln(    log,'\caption{Another Figure}');
X           writeln(    log,'\end{figure}')
X`009end;
X    
X    { ***** LITERAL ***** }
X   68 : begin 
X`009   if not inliteral then
X`009   begin
X`009     if not fill then
X`009     begin
X`009       startnofillagain := true;
X`009       endnofill( outfile )
X`009     end;
X`009     inliteral := true;
X`009     writeln(outfile,'\begin{verbatim}');
X             writeln(    log,'\begin{verbatim}')
X`009   end
X`009   else
X`009   begin
X`009     writeln(outfile,'% RNOTOTEX - literal already active');
X`009     writeln(    log,'% RNOTOTEX - literal already active')
X`009   end
X`009end;`009
X
X    { ***** END LITERAL ***** }
X   69 : begin  
X`009   if inliteral then
X`009   begin
X`009     writeln(outfile,'\end{verbatim}');
X`009     writeln(    log,'\end{verbatim}');
X`009     inliteral := false;
X`009     if startnofillagain then
X`009     begin
X`009       startnofillagain := false;                           
X`009       beginnofill( outfile )
X`009     end
X           end
X`009   else
X`009   begin
X`009      writeln(outfile,'% RNOTOTEX - end literal not after literal');
X`009      writeln(    log,'% RNOTOTEX - end literal not after literal')
X`009   end
X`009end;
X
X    { ***** REPEAT ***** }
X   70 : begin
X          skip := 1;
X`009  newintvalue(arg[2], skip, modified, extractedvalue);
X`009  q := quotedcharacter( arg[3] );
X          for i := 1 to skip do                  
X`009  begin
X`009    texwrite(outfile, q);
X`009    texwrite(    log, q)
X`009  end
X        end;
X
X    { ***** LIST ***** }
X   71 : begin                         
X`009  if (not fill) and (listnestlevel = 0) then
X`009  begin
X`009    nofillbeforelist := true;
X`009    endnofill( outfile )
X`009  end;
X          listnestlevel := listnestlevel + 1;
X          numberofelements[listnestlevel] := 0;
X`009  if n = 3 then
X`009  begin
X`009    q := quotedcharacter( arg[3] );
X`009    writeln(outfile,'\begin{itemize} % list nest ',listnestlevel:1);
X`009    writeln(    log,'\begin{itemize}');
X`009    liststate[listnestlevel] := itemize;
X`009    write(outfile,'\item ');          
X`009    outputfirstitem[listnestlevel] := true
X`009  end
X`009  else
X`009  begin
X`009    writeln(outfile,'\begin{enumerate} % list nest ',listnestlevel:1);
X`009    writeln(    log,'\begin{enumerate}');
X`009    liststate[listnestlevel] := enumerate;
X`009    write(outfile,'\item ');          
X`009    outputfirstitem[listnestlevel] := true
X`009  end
X`009end;
X      
X     { ***** END LIST ***** }
X    72 : begin                   
X           if listnestlevel > 0 then 
X           begin
X`009     case liststate[listnestlevel] of
V`009        nostate   : writeln(outfile,'% - RNOTOTEX - close on list not open'
X);
V`009        itemize    : writeln(outfile,'\end{itemize} % - list nest ',listnes
Xtlevel:1);
V`009        enumerate  : writeln(outfile,'\end{enumerate} % - list nest ',listn
Xestlevel:1)
X`009     end;
X`009     case liststate[listnestlevel] of          
V`009        nostate   : writeln(    log,'% - RNOTOTEX - close on list not open'
X);
X`009        itemize    : writeln(    log,'\end{itemize}');
X`009        enumerate  : writeln(    log,'\end{enumerate}')
X`009     end;
X             numberofelements[listnestlevel] := 0;
X             liststate[listnestlevel] := nostate;
X`009     outputfirstitem[listnestlevel] := false;
X   `009     listnestlevel := listnestlevel - 1;
X`009     if (listnestlevel = 1) and (nofillbeforelist) then
X`009     begin
X`009        nofillbeforelist := false;
X`009        beginnofill( outfile )
X`009     end
X           end
X`009   else
X`009   begin
X`009      writeln(outfile,'% - RNOTOTEX end list for none started');
X`009      writeln(    log,'% - RNOTOTEX end list for none started')
X`009   end
X`009 end;
X                                         
X     { ***** LIST ELEMENT ***** }
X    73 : begin                           
X           if listnestlevel > 0 then
X`009   begin
X             if liststate[listnestlevel] = nostate then
X             begin
V`009        writeln(outfile,'% - RNOTOTEX - list element for non-existant-list'
X);
V`009        writeln(    log,'% - RNOTOTEX - list element for non-existant-list'
X)
X             end
X`009     else
X             begin
X`009       if not outputfirstitem[listnestlevel] then
X`009       begin
X`009         write(outfile,'\item ');
X    `009         writeln(    log,'\item ')
X`009       end
X`009       else
X`009         outputfirstitem[listnestlevel] := false;
V               numberofelements[listnestlevel] := numberofelements[listnestleve
Xl] + 1
X             end
X           end                   
X           else
X           begin
X`009     writeln(outfile,'% - RNOTOTEX - list element for unopened-list');
X`009     writeln(    log,'% - RNOTOTEX - list element for unopened-list')
X           end                                               
X `009 end;
X               
X     { ***** NUMBER LIST ***** }
X    74 : begin
X`009   newintvalue(arg[2], numberlist.listlevel, modified, extractedvalue);
X`009   newintvalue(arg[3], numberlist.valuetoset, modified, extractedvalue);
X`009   if (numberlist.listlevel > 0) and ( numberlist.listlevel < 5) then
X`009     case numberlist.valuetoset of
V`009        1 : adjustcounter(outfile, modified, numberlist.valuetoset,extracte
Xdvalue,'enumi');
V`009        2 : adjustcounter(outfile, modified, numberlist.valuetoset,extracte
Xdvalue,'enumii');
V`009        3 : adjustcounter(outfile, modified, numberlist.valuetoset,extracte
Xdvalue,'enumiii');
V`009        4 : adjustcounter(outfile, modified, numberlist.valuetoset,extracte
Xdvalue,'enumiv')
X`009     end                     
X`009 end;
X
X      { ***** DISPLAY ELEMENTS ***** }
X     75 : noconversion;
X
X      { ***** NOTE ***** }
X     76 : begin
X            if not inmarginpar then
X`009    begin
X`009      writeln(outfile,'\marginpar{\em ');
X`009      writeln(    log,'\marginpar{\em ');
X`009      inmarginpar := true;
X`009      if n > 1 then
X`009      begin 
X`009        dumpthelist(outfile, dsrlist);
X`009        dumpthelist(    log, dsrlist);
X`009        inmarginpar := false;
X`009        c(outfile)
X              end
X            end
X`009    else
X`009    begin
X`009       writeln(outfile,'% RNOTOTEX - marginpar already active');
X`009       writeln(    log,'% RNOTOTEX - marginpar already active')
X`009    end
X`009  end;
X
X      { ***** END NOTE ***** }
X     77 : begin            
X            if inmarginpar then
X            begin
X`009      writeln(outfile,'} % - end of margin par ');
X`009      writeln(    log,'} % - end of margin par ')
X            end
X`009    else
X`009    begin
X`009       writeln(outfile,'% RNOTOTEX - marginpar not active');
X`009       writeln(    log,'% RNOTOTEX - marginpar not active')
X`009    end;
X`009    inmarginpar := false
X`009  end;
X
X      { ***** FOOTNOTE ***** }
X     78 : begin
X            if not infootnote then
X`009    begin
X`009      write(outfile,'\footnote{');
X`009      writeln(    log,'\footnote{');
X     `009      infootnote := true
X            end
X`009    else
X`009    begin
X`009      writeln(outfile,'% RNOTOTEX - already in footnote');
X`009      writeln(    log,'% RNOTOTEX - already in footnote')
X            end
X`009  end;
X
X      { ***** END FOOTNOTE ***** }
X     79 : begin 
X     `009    if infootnote then
X            begin              
X`009       writeln(outfile,'} % - end of footnote');
X`009       writeln(    log,'} % - end of footnote')
X`009    end
X            else
X`009    begin
X`009       writeln(outfile,'% RNOTOTEX - footnote not active');
X`009       writeln(    log,'% RNOTOTEX - footnote not active')
X            end;
X`009    infootnote := false
X`009  end;
X
X      { ***** CHAPTER ***** }
X     80 : begin 
X            if not startedwithfill then
X`009       endnofill(outfile);
X`009    write(outfile,'\chapter{');
X`009    write(    log,'\chapter{');
X`009    dumpthelist(outfile, nextinlist(dsrlist));
X`009    dumpthelist(    log, nextinlist(dsrlist));
X`009    c(outfile);
X`009    if not startedwithfill then
X`009      beginnofill(outfile);
X`009  end;
X
X      { ***** NUMBER CHAPTER ***** }
X     81 : begin
V`009     newcountparameter(arg[n], numberchapter, modified, extractedvalue, cla
Xss);
V`009     adjustcounter(outfile, modified, numberchapter, extractedvalue,'chapte
Xr')
X`009  end;                             
X                                 
X      { ***** DISPLAY CHAPTER ***** }
X     82 : begin
X`009    newstyleparameter(arg[n], displaychapter);
X`009    adjuststyle(outfile, displaychapter, 'chapter')
X`009  end;
X
X       { ***** HEADER LEVEL ***** }
X      83 : begin                             
X`009     newintvalue(arg[2], nestlevel, modified, extractedvalue);
X`009     if modified <> nochange then
X`009        startindex := 3
X`009     else
X`009     begin                         
X`009       newintvalue(arg[3], nestlevel, modified, extractedvalue);
X`009       startindex := 4
X`009     end;
X`009     if modified <> nochange then
X`009     begin
X`009        if (nestlevel > 0) and (nestlevel < 7) then
X`009        begin
X`009          case nestlevel of 
X`009            1 : write(outfile,'\section{');
X`009            2 : write(outfile,'\subsection{');
X`009            3 : write(outfile,'\subsubsection{');
X`009            4 : write(outfile,'\paragraph{');
X`009            5 : write(outfile,'\subparagraph{');
X`009            6 : write(outfile,'\P ')
X`009          end;
X`009          case nestlevel of 
X`009            1 : write(    log,'\section{');
X`009            2 : write(    log,'\subsection{');
X`009            3 : write(    log,'\subsubsection{');
X`009            4 : write(    log,'\paragraph{');
X`009            5 : write(    log,'\subparagraph{');
X`009            6 : write(    log,'\P ')
X`009          end;
X`009          for i := startindex to n do
X                  begin
X`009            texwritearg(outfile, arg[i] );
X`009            texwritearg(    log, arg[i] )
X                  end;
X`009          if nestlevel < 6 then
X`009            c(outfile);
V           `009  headerlevel[nestlevel].value := headerlevel[nestlevel].value +
X 1
X`009        end
X             end
X           end;
X           
X       { ***** NUMBER LEVEL ***** }
X      84 : begin  
X`009     startindex := -1; 
X`009     if  n = 7 then startindex := 2;
X`009     if  n = 8 then startindex := 3;
X`009     if startindex <> -1 then
X`009     begin
X     `009       for i := startindex to (startindex + 5) do 
X`009       begin                      
X`009         j := i - startindex + 1;
V`009         newintvalue(arg[i], headerlevel[j].value, modified,extractedvalue)
X;
X`009          case j of
V`009            1 : adjustcounter(outfile, modified, headerlevel[1].value,extra
Xctedvalue,'section');
V`009            2 : adjustcounter(outfile, modified, headerlevel[2].value,extra
Xctedvalue,'subsection');
V`009            3 : adjustcounter(outfile, modified, headerlevel[3].value,extra
Xctedvalue,'subsubsection');
V`009            4 : adjustcounter(outfile, modified, headerlevel[4].value,extra
Xctedvalue,'paragraph');
V`009            5 : adjustcounter(outfile, modified, headerlevel[5].value,extra
Xctedvalue,'subparagraph');
X`009            6 : noconversion
X`009          end   
X`009       end
X             end
X`009   end;
X
X        { ***** STYLE HEADERS ***** }
X       85 : noconversion;
X
X        { ***** DISPLAY LEVELS ***** }
X       86 : begin  
X`009     startindex := -1; 
X`009     if  n = 7 then startindex := 2;
X`009     if  n = 8 then startindex := 3;
X`009     if startindex <> -1 then
X`009     begin
X     `009       for i := startindex to (startindex + 5) do 
X`009       begin                      
X`009         j := i - startindex + 1;
X`009         newstyleparameter(arg[i], headerlevel[j].display);
X`009          case j of                     
X`009            1 : adjuststyle(outfile, headerlevel[1].display, 'section');
X`009            2 : adjuststyle(outfile, headerlevel[2].display, 'subsection');
V`009            3 : adjuststyle(outfile, headerlevel[3].display, 'subsubsection
X');
X`009            4 : adjuststyle(outfile, headerlevel[4].display, 'paragraph');
V`009            5 : adjuststyle(outfile, headerlevel[5].display ,'subparagraph'
X);
X`009            6 : noconversion
X`009          end
X`009       end      
X             end
X`009    end;                     
X    
X       { ***** APPENDIX ***** }
X      87 : begin
X`009     write(outfile,'\chapter{APPENDIX ');
X`009     write(    log,'\chapter{APPENDIX ');
X`009     if n >= 2 then
X`009     begin
X`009       write(outfile,': ');
X`009       write(    log,': ');
X`009       dumpthelist(outfile, nextinlist(dsrlist));
X`009       dumpthelist(    log, nextinlist(dsrlist))
X`009     end;
X`009     c(outfile)
X`009   end;
X
X       { ***** NUMBER APPENDIX ***** }
X      88 : begin
V`009     newcountparameter(arg[n], numberappendix, modified, extractedvalue,cla
Xss);
V`009     adjustcounter(outfile, modified, numberappendix, extractedvalue, 'chap
Xter')
X`009   end;
X
X       { ***** DISPLAY APPENDIX ***** }
X      89 : begin
X`009     newstyleparameter(arg[n], displayappendix);
X`009     adjuststyle(outfile, displayappendix, 'chapter')
X`009   end;
X                             
X       { ***** STANDARD ***** }
X      90 : noconversion;
X
X       { ***** COMMENT ***** }
X      91 : begin
X`009      write(outfile,'% ');
X`009      dumpthelist(outfile, nextinlist(dsrlist));
X`009      write(    log,'% ');
X`009      dumpthelist(    log, nextinlist(dsrlist))
X`009   end;
X
X       { ***** REQUIRE ***** }
X      92 : begin
X`009     write(outfile,'%%%%%% REQUIRE WAS HERE %%%%% \input {');
X`009     dumpthelist(outfile, nextinlist(dsrlist));
X`009     write(    log,'\input {');
X`009     dumpthelist(    log, nextinlist(dsrlist));
X`009     c(outfile)
X`009   end;
X
X       { ***** CONTROL CHARACTERS ***** }
X      93 : noconversion;
X
X       { ***** NO CONTROL CHARACTERS ***** }
X      94 : noconversion;
X
X       { ***** IF ***** }
X      95 : noconversion;
X
X       { ***** ELSE ***** }
X      96 : noconversion;
X
X       { ***** END IF ***** }
X      97 : noconversion;
X
X       { ***** IFNOT ***** }
X      98 : noconversion;
X
X       { ***** VARIABLE ***** }
X      99 : noconversion;
X
X       { ***** SET DATE ***** }
X     100 : noconversion;
X
X       { ***** SET TIME ***** }
X     101 : noconversion;
X
X       { ***** FLAGS ALL ***** }
X     102 : begin
X`009     for f := control to substitute do
X`009        turnflagon( f )
X`009   end;
X   
X       { ***** NO FLAGS ALL ***** }
X     103 : begin
X`009     for f := control to substitute do
X`009        turnflagoff( f );
X`009     turnflagon( control )
X`009   end;               
X 
X       { ***** NO FLAGS CONTROL ***** }
X     104 : turnflagoff( control );
X
X       { ***** FLAGS CONTROL ***** }
X     105 : flagchange(control, arg[n]);
X
X       { ***** NO FLAGS UPPERCASE ***** }
X     106 : turnflagoff( uppercase );
X
X       { ***** FLAGS UPPERCASE ***** }
X     107 : flagchange( uppercase, arg[n]);
X
X       { ***** NO FLAGS LOWERCASE ***** }
X     108 : turnflagoff( lowercase );
X
X       { ***** FLAGS LOWERCASE ***** }
X     109 : flagchange( lowercase, arg[n]);
X
X       { ***** NO FLAGS QUOTE ***** }
X     110 : turnflagoff( quote );
X`009                          
X       { ***** FLAGS QUOTE ***** }
X     111 : flagchange( quote, arg[n] );
X
X       { ***** NO FLAGS SPACE ***** }
X     112 : turnflagoff( space );
X
X       { ***** FLAGS SPACE ***** }
X     113 : flagchange( space, arg[n] );
X
X       { ***** NO FLAGS UNDERLINE ***** }
X     114 : turnflagoff( underline );
X
X       { ***** FLAGS UNDERLINE ***** }
X     115 : flagchange( underline, arg[n] );
X           
X       { ***** NO FLAGS BOLD ***** }
X     116 : turnflagoff( bold );
X
X       { ***** FLAGS BOLD ***** }
X     117 : flagchange( bold, arg[n] );
X
X       { ***** NO FLAGS OVERSTRIKE ***** }
X     118 : turnflagoff( overstrike );
X
X       { ***** FLAGS OVERSTRIKE ***** }
X     119 : flagchange( overstrike, arg[n] );
X
X       { ***** NO FLAGS HYPHENATE ***** }        
X     120 : turnflagoff( hyphenate );
X
X       { ***** FLAGS HYPHENATE ***** }
X     121 : flagchange( hyphenate, arg[n] );
X
X       { ***** NO FLAGS CAPITALIZE ***** }
X     122 : turnflagoff( capitalize );
X
X       { ***** FLAGS CAPITALIZE ***** }
X     123 : flagchange( capitalize, arg[n] );
X
X       { ***** NO FLAGS END FOOTNOTE ***** }
X     124 : turnflagoff( endfootnote );
X
X       { ***** FLAGS END FOOTNOTE ***** }
X     125 : flagchange( endfootnote, arg[n] );
X
X       { ***** NO FLAGS COMMENT ***** }
X     126 : turnflagoff( comment );
X
X       { ***** FLAGS COMMENT ***** }
X     127 : flagchange( comment, arg[n] );
X
X       { ***** NO FLAGS SUBSTITUTE ***** }
X     128 : turnflagoff( substitute );
X
X       { ***** FLAGS SUBSTITUTE ***** }
X     129 : flagchange( substitute, arg[n] );
X         
X       { ***** INDEX ***** }
X     130 : begin
X`009     write(outfile,'\index{');
X`009     dumpthelist(outfile, nextinlist(dsrlist));
X`009     write(    log,'\index{');
X`009     dumpthelist(    log, nextinlist(dsrlist));
X`009     c(outfile)
X           end
X                                              
Xend; {case of tex index extracted}`009
X
X
Xroutineexit : nullstatement
Xend;
X                                                                     
X
X
X[GLOBAL] PROCEDURE putsecondarytexcommand(var outfile : text;
X`009                          var nextcommand : integer );
Xbegin 
X
X  if nextcommand = 40 {centering}      then  
X  begin      
X      if centering then
X      begin
X        centering := false;
X        writeln(outfile,'\end{centering}');
X        if startnofillagain then
X        begin
X`009  startnofillagain := false;
X`009  beginnofill( outfile )
X        end
X      end
X      else
X      begin
V`009writeln(outfile,'% RNOTOTEX - end centering when centering not-active');`00
X9
X`009writeln(    log,'% RNOTOTEX - end centering when centering not-active')
X      end
X  end;
X  if nextcommand = 44 {rightjustify}  then
X  begin  
X      if flushright then
X      begin
X        flushright := false;
X        writeln(outfile,'\end{flushright}');
X        if startnofillagain then
X        begin
X`009  startnofillagain := false;
X`009  beginnofill( outfile )
X        end
X      end
X      else
X      begin
X        writeln(outfile,'% RNOTOTEX - end flushright when not active');
X        writeln(    log,'% RNOTOTEX - end flushright when not active')
X      end
X  end;
X
X  nextcommand := indexofunknowntexcommand
X
Xend;
X
X
X
X
X
XEND.
X
X
$ GOSUB UNPACK_FILE
$ FILE_IS = "DSROPS.PAS"
$ CHECKSUM_IS = 658424605
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X[INHERIT('SCREENHANDLERS','UTILITYOPS','ARGOPS',
X'TREEANDLISTOPS','FLAGOPS','CONVERSION')]
X
XMODULE DSROPS;
X
X
XCONST
X    
X   indexofpagecommand = 38;
X
XVAR
X    
X    totallines             : [EXTERNAL] integer;
X    totalgooddsrcommands : [EXTERNAL] integer;
X    totalbaddsrcommands  : [EXTERNAL] integer;
X
X
X
X
X
X[GLOBAL] FUNCTION listispagecommand( list : arglist ) : boolean;
Xvar
X   s : pckstr;
Xbegin 
X   listispagecommand := false;
X   if arglistlength(list) = 1 then
X   begin
X      s := argliteral(firstarg(list), TRUE );
X      if s = 'PAGE' then
X        listispagecommand := true
X   end 
Xend;
X
X
X                              
X[GLOBAL] PROCEDURE checkfordsrcommand( var infile, outfile : text; 
X`009                         var dsrcommand : boolean );
Xvar
X  gotten : boolean;
Xbegin
X  if flagclass(currentchar) = control then
X  begin           
X    getnextchar(infile, gotten);
X    if gotten then
X    begin
X      if (flagclass(currentchar) <> comment) and (currentchar <> blank) then
X          dsrcommand := true
X    end
X    else
X    begin
X      dsrcommand := false;   
X      texwrite(outfile, currentchar)
X    end                     
X  end
X  else
X    dsrcommand := false
Xend;
X
X
X
X
X[GLOBAL] PROCEDURE parsedsrcommand( var infile, outfile : text; var list :
X`009                              arglist; var anothercommand : boolean;
V`009                              var carrychar : boolean; var charcarried : ch
Xar);
Xconst                                                          
X   dontwritethem = false;
Xtype
V   charidentity = (letter, separator, number, semicolon, quote, commentchar,new
Xdsrcommand);
Xvar                                    
X   quotedchar : char;
X   argread : argument;   
X   currentargclass : charidentity;
X   done, gotten, atseparator, endofdsrcommand : boolean;
X   i : integer;
X
X   function charclass( ch : char ) : charidentity;
X   label
X      localexit;
X   begin
X      charclass := separator;                                       
X      if flagclass( ch ) = control then
X      begin
X         charclass := newdsrcommand;      
X         goto localexit
X      end;
X      if ch in ['a'..'z','A'..'Z'] then
X      begin
X         charclass := letter;
X         goto localexit
X      end;
X      if ch in ['+','-','0'..'9'] then
X      begin                                                                    
X         charclass := number;
X`009 goto localexit
X      end;
X      if ch in [chr(34), chr(39)] then
X      begin
X         charclass := quote;
X         goto localexit
X      end;
X      if flagclass(currentchar) = comment then
X      begin
X         charclass := commentchar;
X         goto localexit
X      end;
X      if ch = ';' then
X        charclass := semicolon;                        
X      localexit : nullstatement
X   end;
X                                                                               
X   procedure startarg( ch : char; var arg : argument; startset : setofargtype);
X   begin
X      initarg(arg, startset, ch, indexofunknowntexcommand, false);
X   end;
X
Xbegin   
X    list := nulllist;
X    atseparator := false;
X    endofdsrcommand := false;
X    anothercommand := false;                        
X    carrychar := false;
X    repeat
X         currentargclass := charclass(currentchar);
X         case currentargclass of 
X       `009    letter  : begin
X`009                atseparator := false;
V`009                startarg(currentchar, argread, [dsrverb,stylespecifier, tex
Xtpckstr,character]);
X                        done := false;
X                        repeat
X`009                    getnextchar(infile, gotten);
X                            if gotten then                                    
X`009                    begin
X`009                        if charclass(currentchar) = letter then
X                                    appendchartoarg(currentchar, argread)
X                                else
X                                    done := true
X                            end
X`009                    else
X                            begin
X                                done := true;
X`009                        endofdsrcommand :=  true
X`009                    end
X`009                until done;
X`009                appendargonlist(list, argread )
X                     end;
-+-+-+-+-+ End of part 2 +-+-+-+-+-

