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


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Thu, 15 SEP 88 08:37:08 PDT
Received: from relay.ubc.ca by KL.SRI.COM with TCP; Thu, 15 Sep 88 08:10:16 PDT
Received: by relay.ubc.ca (5.59/1.14)
	id AA01015; Thu, 15 Sep 88 07:48:59 PDT
Date: 15 Sep 88 14:10 -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: <14*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 4 +-+-+-+
X`009        warningmessage('readini','bad index digits in INI');
X`009        gotten := false                                   
X             end
X          end
X     until (not gotten) or (count = ndigits);
X     if (gotten) and (not eof(ini)) then read(ini, ch)
X  end;
X
X  procedure pckstrtoarg( s : pckstr; index : integer; var arg : argument);
X  label
X      routineexit;
X  begin
X     initarg(arg, [dsrverb], s, index, false );        
X     if s = '[N]' then
X     begin
X       reassignargclass(arg, [int,signedint,nulltype]);
X       reassignarggeneralization(arg, true);
X       goto routineexit
X     end;
X     if s = '[Y]' then
X     begin
X       reassignargclass(arg, [stylespecifier]);
X       reassignarggeneralization(arg, true);
X       goto routineexit
X     end;
X     if s = '[T]' then
X     begin            
X       reassignargclass(arg, [textpckstr,character,nulltype]);
X       reassignarggeneralization(arg, true);
X       goto routineexit
X     end;
X     if s = '[C]' then
X     begin
X       reassignargclass(arg, [character,nulltype]);
X       reassignarggeneralization(arg, true);
X       goto routineexit
X     end;                  
X     if s = '[Q]' then
X     begin
X       reassignargclass(arg, [quotedpckstr,nulltype]);
X       reassignarggeneralization(arg, true);
X       goto routineexit
X     end;
X     routineexit : nullstatement
X  end;         
X  
Xbegin {readarglistfromini}
X  list := nulllist;
X  readindex(index, gotten );
X  if gotten then                                              
X  begin         
X    if index < 1 then      
X      warningmessage('readini','bad INI index value');
X    repeat
X       readpckstr(s, gotten );
X       if gotten then        
X       begin
X         pckstrtoarg(s, index, arg );
X         appendargonlist(list, arg);
X       end                                             
X    until not gotten;
X    if arglistlength(list) = 0 then
X       warningmessage('readini','empty argument list in INI file')
X  end  
X  else
X  begin
X    index := indexofunknowntexcommand;
X    warningmessage('readini','could not read index from INI file')
X  end;                        
X  if not eof(ini) then
X    readln(ini)
Xend;  
X         
X
X
X
X
X                   
X[GLOBAL] PROCEDURE setuptree( var ini : text; var tree : argtree );
Xvar 
X   list : arglist;
X   index : integer;
Xbegin  
X    openinifile( ini );
X    tree := nulltree;
X    while not eof(ini) do
X    begin          
X       readarglistfromini( ini, index, list);
X
X       {   ***** ttywritestring(' index read = ');
X                 ttywriteint(index);
X                 ttywriteln;                   *****      }
X
X       insertlistintotree( list, tree )
X    end;
X    closeinifile( ini )
Xend;
X    
X    
X                                      
XEND.                  
$ GOSUB UNPACK_FILE
$ FILE_IS = "LATEXOPS.PAS"
$ CHECKSUM_IS = 964346211
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X[INHERIT('UTILITYOPS','ARGOPS','BASICFILEOPS',
X'TREEANDLISTOPS','FLAGOPS')]
X
XMODULE LATEXOPS;
X
X
XTYPE
X 
X
Xcountparametertype = (numericcounter, lowercasechars, uppercasechars );
X
Xparameterchangestates = (nochange, altered,  assigned);
X
Xpagestyletype  = (empty, plain, headings, myheadings);
X
Xliststatetype = (nostate, itemize, enumerate);
X
X
XVAR
X   
X   LOG               : [EXTERNAL] TEXT;
X   pagestyle        : [EXTERNAL] pagestyletype;
X   datestring       : [EXTERNAL] pckstr;
X   title, subtitle   : [EXTERNAL] argarray;
X   fill`009             : [EXTERNAL] boolean;
X   centering         : [EXTERNAL] boolean;
X   flushright       : [EXTERNAL] boolean;
X   minipageactive  : [EXTERNAL] boolean;
X   inmarginpar      : [EXTERNAL] boolean;        
X   infootnote       : [EXTERNAL] boolean;
X   underlineactive  : [EXTERNAL] enhancmentstates;
X   boldactive       : [EXTERNAL] enhancmentstates;
X   listnestlevel   : [EXTERNAL] integer;
X
VPROCEDURE startlatex( var outfile : text; outputfont : integer ; outputstyle: p
Xckstr );
Xconst
X   minfont = 10;
X   maxfont = 12;
Xvar
X  pt : integer;
Xbegin          
X  pt := outputfont;
X  if (pt < minfont) or (pt > maxfont) then
X    pt := minfont;                                                  
X  writeln(outfile,'%');
X  if pt = 10 then
X     writeln(outfile,'\documentstyle{',outputstyle,'}')
X  else
X     writeln(outfile,'\documentstyle[',pt:2,'pt]{',outputstyle,'}');
X   writeln(outfile,'%');
X   writeln(outfile,'% (put preamble statements here) ');
X   writeln(outfile,'%');
X   writeln(outfile,'\begin{document}');
X   writeln(outfile,'%')
Xend;
X
X
X[GLOBAL] PROCEDURE closeanyopenbrackets( var outfile : text );
Xvar
X  i : integer;
Xbegin
X   if not fill then
X     writeln(outfile,'} % - end of obeylines and obeyspaces group');
X   if centering then
X     writeln(outfile,'\end{centering}');
X   if flushright then
X     writeln(outfile,'\end{flushright}');
X   if minipageactive then
X     writeln(outfile,'\end{minipage}');
X   if inmarginpar then
X     writeln(outfile,'} % - end of margin par ');
X   if infootnote then
X     writeln(outfile,'} % - end of footnote');
X   if inliteral then
X     writeln(outfile,'\end{verbatim}');
X   for i := 1 to listnestlevel do
X      writeln(outfile,'\end{itemize} % - RNOTOTEX forced list close');
X   stopunderline( outfile );
X   stopbold( outfile )
Xend;
X    
X
X
X[GLOBAL] PROCEDURE endlatex( var outfile : text );
Xbegin           
X  closeanyopenbrackets( outfile );
X  writeln(outfile,'%');
X  writeln(outfile,'%  (put postamble statements here) ');
X  writeln(outfile,'%');
X  writeln(outfile,'\end{document}')
Xend;
X
X
X                                     
X[GLOBAL] PROCEDURE adjustpagestyle( var f : text; newstyle : pagestyletype);
Xbegin
X  pagestyle := newstyle;
X  case pagestyle of
X    empty       : writeln(f,'\pagestyle{empty}');
X    plain       : writeln(f,'\pagestyle{plain}');
X    headings    : writeln(f,'\pagestyle{headings}');
X    myheadings  : begin
X                     writeln(f,'\pagestyle{myheadings}');
X`009             write(f,'\markright{');
X                     writeargarray(f, title);
X                     writeargarray(f, subtitle);
X                     write(f, datestring );
X                     writeln(f,'}')
X                  end
X  end;
X  case pagestyle of
X    empty       : writeln(log,'\pagestyle{empty}');
X    plain       : writeln(log,'\pagestyle{plain}');
X    headings    : writeln(log,'\pagestyle{headings}');
X    myheadings  : begin
X                     writeln(log,'\pagestyle{myheadings}');
X`009             write(log,'\markright{');
X                     writeargarray(log, title);
X                     writeargarray(log, subtitle);
X                     write(log, datestring );
X                     writeln(log,'}')
X                  end
X  end
Xend;
X                      
X                      
X
X
X[GLOBAL] PROCEDURE writecharwidth( var f : text; nchars : integer);
Xconst
X  widthofcharincm = 0.254; { 10 chars per inch, 2.54 cm per inch }
X  maxwidth = 20.0;
X  minwidth = -20.0;
Xvar
X  cm  : real;
Xbegin
X  cm := nchars * widthofcharincm;
X  if cm > maxwidth then
X  begin
X    writeln(log,'[too many chars to skip, ',nchars,' = ',cm:10:2,'cm]');
X    cm := 1.0
X  end;             
X  if  cm < minwidth then
X  begin
X    writeln(log,'[too many chars to skip ',nchars,' = ',cm:10:2,'cm]');
X    cm := -1.0
X  end;
X  write(f, cm:6:2, 'cm ');
X  write(log, cm:6:2,'cm ')
Xend;
X
X
X
X[GLOBAL] PROCEDURE writecharheight( var f : text; nlines : integer );
Xconst
X  heightoftextincm = 0.425; { 6 lines per inch, 2.54 cm per inch }
X  maxheight = 25.0;
X  minheight = -25.0;
Xvar
X  cm : real;
Xbegin
X  cm := nlines * heightoftextincm;
X  if cm > maxheight then
X  begin
X    writeln(log,'[too many lines to skip, ',nlines,' = ',cm:10:2,'cm]');
X    cm := 1.0
X  end;             
X  if  cm < minheight then
X  begin
X    writeln(log,'[too many lines to skip ',nlines,' = ',cm:10:2,'cm]');
X    cm := -1.0
X  end;
X  write(f, cm:6:2,'cm ');
X  write(log, cm:6:2,'cm ')
Xend;
X
X
X
X
X
V[GLOBAL] PROCEDURE adjustlength( var outfile : text; modified : parameterchange
Xstates;
Xlengthvalue : integer; adjustmentvalue : integer; charwidth : boolean;
Xlatexname : pckstr );
Xbegin
X   case modified of
X     nochange : nullstatement;
X     altered   : begin
X`009           write(outfile,'\addtolength{',latexname,'}{');
X                   if charwidth then
X                      writecharwidth(outfile, adjustmentvalue)
X                   else
X                      writecharheight(outfile, adjustmentvalue);
X                   writeln(outfile,'}')
X                 end;
X     assigned  : begin
X`009           write(outfile,'\setlength{',latexname,'}{');
X                   if charwidth then
X                      writecharwidth(outfile, lengthvalue)
X`009           else
X`009              writecharheight(outfile, lengthvalue);
X                   writeln(outfile,'}')
X                 end
X  end;              
X   case modified of
X     nochange : noconversion;
X     altered   : begin
X`009           write(log,'\addtolength{',latexname,'}{');
X                   if charwidth then
X                      writecharwidth(log, adjustmentvalue)
X                   else
X                      writecharheight(log, adjustmentvalue);
X                   writeln(log,'}')
X                 end;
X     assigned  : begin
X`009           write(log,'\setlength{',latexname,'}{');
X                   if charwidth then
X                      writecharwidth(log, lengthvalue)
X`009           else
X`009              writecharheight(log, lengthvalue);
X                   writeln(log,'}')
X                 end
X  end              
Xend;                                              
X 
X               
X
V[GLOBAL] PROCEDURE adjustcounter( var outfile : text;  modified : parameterchan
Xgestates;
Xcountervalue : integer; adjustmentvalue : integer; latexname : pckstr );
Xbegin
X   case modified of
X     nochange : nullstatement;
V     altered   : writeln(outfile,'\addtocounter{',latexname,'}{',adjustmentvalu
Xe,'}');
V     assigned  : writeln(outfile,'\setcounter{',latexname,'}{',countervalue,'}'
X)               
X   end;
X   case modified of
X     nochange : noconversion;
V     altered   : writeln(log,'\addtocounter{',latexname,'}{',adjustmentvalue,'}
X');
V     assigned  : writeln(log,'\setcounter{',latexname,'}{',countervalue,'}')   
X            
X   end
Xend;
X
X                                                     
X
X[GLOBAL] PROCEDURE adjuststyle(var outfile : text; s : styletype;
X`009                         latexname : pckstr );
Xbegin                                                         
X   case s of 
X     undetermined : nullstatement;
V     decimal      : writeln(outfile,'\renewcommand{\the',latexname,'}{\arabic{'
X,latexname,'}}');
V     octal        : writeln(outfile,'\renewcommand{\the',latexname,'}{\arabic{'
X,latexname,'}}'); 
V     hexidecimal  : writeln(outfile,'\renewcommand{\the',latexname,'}{\arabic{'
X,latexname,'}}');
V     romanupper  : writeln(outfile,'\renewcommand{\the',latexname,'}{\Roman{',l
Xatexname,'}}');
V     romanlower  : writeln(outfile,'\renewcommand{\the',latexname,'}{\roman{',l
Xatexname,'}}');
V     romanmixed  : writeln(outfile,'\renewcommand{\the',latexname,'}{\roman{',l
Xatexname,'}}');
V     letterupper : writeln(outfile,'\renewcommand{\the',latexname,'}{\Alpha{',l
Xatexname,'}}');
V     letterlower : writeln(outfile,'\renewcommand{\the',latexname,'}{\alpha{',l
Xatexname,'}}');
V     lettermixed : writeln(outfile,'\renewcommand{\the',latexname,'}{\alpha{',l
Xatexname,'}}');
X     nostyle     : nullstatement
X  end;
X   case s of                     
X     undetermined : noconversion;
V     decimal      : writeln(log,'\renewcommand{\the',latexname,'}{\arabic{',lat
Xexname,'}}');
V     octal        : writeln(log,'\renewcommand{\the',latexname,'}{\arabic{',lat
Xexname,'}}'); 
V     hexidecimal  : writeln(log,'\renewcommand{\the',latexname,'}{\arabic{',lat
Xexname,'}}');
V     romanupper  : writeln(log,'\renewcommand{\the',latexname,'}{\Roman{',latex
Xname,'}}');
V     romanlower  : writeln(log,'\renewcommand{\the',latexname,'}{\roman{',latex
Xname,'}}');
V     romanmixed  : writeln(log,'\renewcommand{\the',latexname,'}{\roman{',latex
Xname,'}}');
V     letterupper : writeln(log,'\renewcommand{\the',latexname,'}{\Alpha{',latex
Xname,'}}');
V     letterlower : writeln(log,'\renewcommand{\the',latexname,'}{\alpha{',latex
Xname,'}}');
V     lettermixed : writeln(log,'\renewcommand{\the',latexname,'}{\alpha{',latex
Xname,'}}');
X     nostyle     : noconversion
X  end
Xend;
X
X
XEND.
X                                
$ GOSUB UNPACK_FILE
$ FILE_IS = "LINK_RNOTOTEX.COM"
$ CHECKSUM_IS = 1462906451
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X$ PI = 'P1
X$ IF ("''P1'" .EQS. "") THEN $ PI="NODEBUG"
X$ LINK/'PI'  RNOTOTEX,-
X`009     UTILITYOPS,-
X`009     SCREENHANDLERS,-
X`009     ARGOPS,-
X`009     BASICFILEOPS,-
X`009     FLAGOPS,-
X`009     TREEANDLISTOPS,-
X`009     LATEXOPS,-
X`009     INIOPS,-
X`009     CONVERSION,-
X`009     DSROPS,-
X`009     GETCLI
$ GOSUB UNPACK_FILE
$ FILE_IS = "RNOTOTEX.CLD"
$ CHECKSUM_IS = 958872892
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X!`009
X!`009FILE TO SET UP THE RNOTOTEX COMMAND
XDEFINE VERB RNOTOTEX
X    IMAGE TEX_CONVERTAREA:RNOTOTEX.EXE
X    QUALIFIER TEX
X    PARAMETER P1 LABEL=RNO_FILE,PROMPT="RNO file",VALUE(TYPE=$FILE,REQUIRED)
X    PARAMETER P2 LABEL=TEX_FILE,PROMPT="TeX file",VALUE(TYPE=$FILE,REQUIRED)
$ GOSUB UNPACK_FILE
$ FILE_IS = "RNOTOTEX.INI"
$ CHECKSUM_IS = 1110335497
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X130 X$[T]
X099 VR$[T]$[T]                      
X099 VARIABLE$[T]$[T]                        !VARIABLE COMMAND
X026 UPPER$CASE                              !FORCE UPPER CASE TEXT
X026 UC
X041 TS$[N]$[N]$[N]$[N]$[N]  
X039 TP$[N]
X021 TITLE$[T]                               !TITLE COMMAND
X039 TEST$PAGE$[N]                           !TEST FOR A PAGE BREAK
X041 TAB$STOPS$[N]$[N]$[N]$[N]$[N]           !SET TAB STOPS
X021 T$[T]
X022 SUBTITLE$[T]                            !SUBTITLE COMMAND
X016 SUBPAGE`009                            !CREATE SUBPAGE
X130 SUBINDEX$[T]
X085 STYLE$HEADERS$[N]$[N]$[N]               !SET STYLE OF HEADERS
X101 STM$[N]$[N]$[N]                 
X085 STHL$[N]$[N]$[N]                    
X090 STANDARD$[N]                            !RESET TO STANDARD MODE
X022 ST$[T]         
X049 SPR$[N]$[N]$[N]                     
X016 SPG`009                        
X035 SPACING$[N]                             !SET SPACING VALUE
X035 SP$[N]
X036 SKIP$[N]                                !SKIP SOME SPACES
X101 SET$TIME$[N]$[N]$[N]                    !SET TIME
X049 SET$PARAGRAPH$[N]$[N]$[N]               !SET PARAGRAPH DEFAULT VALUES
X100 SET$DATE$[N]$[N]$[N]                    !SET DATE
X100 SDT$[N]$[N]$[N]             
X090 SD$[N]
X036 S$[N]
X070 RPT$[N]$[Q]                 
X029 RM$[N]
X044 RIGHT$[N]                               !RIGHT FLUSH
X029 RIGHT$MARGIN$[N]                        !SETR RIGHT MARGIN
X092 REQUIRE$[Q]                             !GET A FILE
X070 REPEAT$[N]$[Q]                          !REPEAT CHARACTER
X044 R$[N]
X001 PS$[N]$[N]
X046 PR
X038 PG
X046 PERIOD`009                            !ENABLE PERIOD FLAG
X048 PARAGRAPH$[N]$[N]$[N]                   !NEW PAR
X001 PAPER$SIZE$[N]$[N]                      !PAPER SIZE [LENGTH] [WIDTH]
X015 PAGING`009                            !ENABLE PAGING MODE
X001 PAGE$SIZE$[N]$[N]
X038 PAGE `009                            !FORCE A PAGE BREAK
X015 PA`009
X048 P$[N]$[N]$[N]$[N]           
X018 NUMBER$SUBPAGE$[C]                      !NUMBER  SUBPAGE
X012 NUMBER$RUNNING$[C]                      !NUMBER RUNNING COUNTER
X011 NUMBER$PAGE$[C]                         !ENABLE PAGE NUMBERING
X074 NUMBER$LIST$[N]$[N]                     !NUMBER LIST
X084 NUMBER$LEVEL$[N]$[N]$[N]$[N]$[N]$[N]    !SET SECTION NUMBERING LEVELS
X081 NUMBER$CHAPTER$[C]                      !SET CHAPTER NUMBERING STYLE
X088 NUMBER$APPENDIX$[C]                     !SET APPENDIX NUMBERING
X076 NT$[T]         
X023 NST
X047 NSP
X045 NPR
X014 NPA
X076 NOTE$[T]                                !BEGIN NOTES
X032 NOJUST
X030 NOFILL
X023 NO$SUBTITLE                             !DISABLE SUBTITLE
X047 NO$SPACE                                !FRENCH SPACING
X045 NO$PERIOD                               !DISABLE PERIOD FLAG
X014 NO$PAGING                               !STOP PAGING MODE
X010 NO$NUMBER                               !DISABLE PAGE NUMBERING
X032 NO$JUSTIFY                              !STOP JUSTIFICATION
X032 NO$JUST
X056 NO$HYPHENATION                          !DISABLE HYNPHENATION
X002 NO$HEADERS                              !TURN HEADER WRITING OFF
X106 NO$FLAGS$UPPERCASE
X114 NO$FLAGS$UNDERLINE
X128 NO$FLAGS$SUBSTITUTE
X112 NO$FLAGS$SPACE
X110 NO$FLAGS$QUOTE
X118 NO$FLAGS$OVERSTRIKE
X108 NO$FLAGS$LOWERCASE
X120 NO$FLAGS$HYPHENATE
X124 NO$FLAGS$FOOTNOTE
X104 NO$FLAGS$CONTROL                        !NO CONTROL FLAGS
X126 NO$FLAGS$COMMENT
X122 NO$FLAGS$CAPTIALIZE
X103 NO$FLAGS$ALL                            !TURN OFF ALL FLAGS
X103 NO$FLAGS
X030 NO$FILL`009                            !DIABLE FILL
X008 NO$DATE                                 !DISABLE DATE ON PAGE
X094 NO$CONTROL$CHARACTERS                   !NO CONTROL CHARACTERS ALLOWED
X053 NO$AUTOTABLE                            !DISABLE AUTOTABLE
X024 NO$AUTOSUBTITLE                         !DISABLE AUTOSUBTITLE
X051 NO$AUTOPARAGRAPH                        !DISABLE AUTOPARAGRAPHING
X010 NNM
X018 NMSPG$[C]
X012 NMR$[C]
X011 NMPG$[C]        
X084 NMLV$[N]$[N]$[N]$[N]$[N]$[N]        
X074 NMLS$[N]$[N]                
X081 NMCH$[C]
X088 NMAX$[C]                                
X103 NLF
X032 NJ                                                           
X056 NHY
X002 NHD                                                           
X106 NFL$UPPERCASE   
X114 NFL$UNDERLINE
X128 NFL$SUBSTITUTE
X112 NFL$SPACE
X110 NFL$QUOTE
X118 NFL$OVERSTRIKE
X108 NFL$LOWERCASE
X120 NFL$HYPHENATE
X124 NFL$FOOTNOTE
X104 NFL$CONTROL
X126 NFL$COMMENT
X122 NFL$CAPTIALIZE    
X116 NFL$BOLD
X030 NF   `009                
X008 ND                                                         
X094 NCC
X053 NAT
X024 NAST`009
X051 NAP
X071 LS$[N]$[Q]          
X027 LOWER$CASE                              !FORCE LOWER CASE TEXT
X009 LO$[N]$[N]
X028 LM$[N]
X068 LITERAL$[N]                             !LITERAL
X068 LIT
X071 LIST$[N]$[Q]                            !LIST COMMAND
X073 LIST$ELEMENT                            !LIST ELEMENT
X043 LEFT$[N]                                !SAME AS INDENT
X028 LEFT$MARGIN$[N]                         !SET LEFT MARGIN
X073 LE
X027 LC 
X009 LAYOUT$[N]$[N]                          !SETUP LAYOUT
X043 L$[N]
X068 L
X033 JUSTIFY                                 !ENABLEJUSTIFICATION
X033 J
X130 IX$[T]
X130 INDEX$[T]
X042 INDENT$[N]                              !INDENT TEXT
X098 IFNOT$[T]                               !IF NOT COMMAND
X095 IF$[T]`009                            !IF COMMAND
X042 I$[N]`009    
X057 HYPHENATION                             !ENABLE HYNPHENATION
X057 HY
X083 HL$[N]$[T]             
X004 HEADERS$UPPER                           !PAGE NUMBERING CASE
X003 HEADERS$ON                              !TURN HEADER WRITING ON
X006 HEADERS$MIXED                                             
X005 HEADERS$LOWER
X083 HEADER$LEVEL$[N]$[T]                    !SECTIONING COMMAND
X003 HD$ON
X003 HD                                                           
X020 FT
X078 FOOTNOTE$[N]                            !BEGIN FOOTNOTE
X078 FN$[N]`009        
X107 FLAGS$UPPERCASE$[C]
X115 FLAGS$UNDERLINE$[C]
X129 FLAGS$SUBSTITUTE$[C]
X113 FLAGS$SPACE$[C]
X111 FLAGS$QUOTE$[C]
X119 FLAGS$OVERSTRIKE$[C]
X109 FLAGS$LOWERCASE$[C]
X121 FLAGS$HYPHENATE$[C]
X125 FLAGS$FOOTNOTE$[C]
X105 FLAGS$CONTROL$[C]                       !TURN ON CONTROL FLAGS
X127 FLAGS$COMMENT
X123 FLAGS$CAPITALIZE$[C]
X117 FLAGS$BOLD$[C]
X102 FLAGS$ALL                               !TURN ON ALL FLAGS
X102 FLAGS
X107 FL$UPPERCASE$[C]
X115 FL$UNDERLINE$[C]
X129 FL$SUBSTITUTE$[C]
X113 FL$SPACE$[C]
X111 FL$QUOTE$[C]
X119 FL$OVERSTRIKE$[C]
X116 FL$NO$FLAGS$BOLD
X109 FL$LOWERCASE$[C]
X121 FL$HYNPHENATE$[C]
X125 FL$FOOTNOTE$[C]
X105 FL$CONTROL$[C]                                                
X127 FL$COMMENT
X123 FL$CAPTIALIZE$[C]
X117 FL$BOLD$[C]
X102 FL
X020 FIRST$TITLE                             !ENABLE FIRST TITLE
X031 FILL `009                            !ENABLE FILL
X066 FIGURE$[N]                              !FIGURE COMMAND
X067 FIGURE$DEFERRED$[N]                     !FIGURE DEFERRED
X067 FGD$[N]
X066 FG$[N]
X031 F
X055 EUN
X017 ES
X061 EOV
X097 ENDIF$[T]                               !END IF COMMAND
X017 END$SUBPAGE                             !END SUBPAGE
X077 END$NOTE                                !END NOTES
X069 END$LITERAL                             !END LITERAL
X072 END$LIST                                !END LIST
X079 END$FOOTNOTE                            !END FOOTNOTE
X064 END$BAR`009                            !END BAR
X055 ENABLE$UNDERLINING                      !ENABLE CHARACTER UNDERLINING
X061 ENABLE$OVERSTRIKE                       !ENABLE OVERSTRIKING
X059 ENABLE$BOLDING                          !ENABLE BOLDING
X062 ENABLE$BAR                              !ENABLE BAR
X077 EN
X096 ELSE$[T]                                !ELSE
X072 ELS
X069 EL
X059 EBO
X062 EBB
X064 EB
X054 DUL
X019 DSP$[Y]`009                    
X060 DOV
X013 DNM$[Y]`009                                
X075 DLE$[Q]$[Y]$[Q]             
X019 DISPLAY$SUBPAGE$[Y]                     !DISPLAY SUBPAGE
X013 DISPLAY$NUMBER$[Y]                      !DISPLAY NUMBER RUNNING
X086 DISPLAY$LEVELS$[Y]$[Y]$[Y]$[Y]$[Y]$[Y]  !DISPLAY LEVELS COMMAND
X075 DISPLAY$ELEMENTS$[Q]$[Y]$[Q]            !DISPLAY LIST ELEMENTS
X082 DISPLAY$CHAPTER$[Y]                     !DISPLAY CHAPTER STYLE
X089 DISPLAY$APPENDIX$[Y]                    !DISPLAY APPENDIS
X054 DISABLE$UNDERLINING                     !DISABLE CHARACTER UNDERLINING
X060 DISABLE$OVERSTRIKING                    !DISABLE OVERSTRIKING
X058 DISABLE$BOLDING                         !DISABLE BOLDING OF CHARACTERS
X065 DISABLE$BAR                             !DISABLE BAR
X086 DHL$[Y]$[Y]$[Y]$[Y]$[Y]$[Y]             
X082 DCH$[Y]
X058 DBO
X065 DBB                                                 
X089 DAX$[Y]
X007 DATE                                    !ENABLE DATE ON PAGE
X007 D
X093 CONTROL$CHARACTERS                      !ENABLE CONTROL CHARACTERS
X091 COMMENT$[T]                             !DSR COMMENT
X080 CHAPTER$[T]                             !NEW CHAPTER
X080 CH$[T]                 
X040 CENTRE$[N]
X040 CENTER$[N]                              !CENTRE A LINE OF TEXT
X093 CC
X040 C$[N]
X034 BREAK                                   !CAUSE A BREAK
X034 BR
X037 BLANK$[N]                               !LEAVE BLANK LINES
X063 BEGIN$BAR                               !BEGIN BAR
X063 BB
X037 B$[N]
X087 AX$[T]                 
X052 AUTOTABLE                               !ENABLE AUTOTABLE
X025 AUTOSUBTITLE$[N]                        !ENABLE AUTOSUBTITLING
X050 AUTOPARAGRAPH                           !ENABLE AUTOPARGRAPHING
X052 AT
X025 AST$[N]
X087 APPENDIX$[T]                            !APPENDIX 
X050 AP
$ GOSUB UNPACK_FILE
$ FILE_IS = "RNOTOTEX.PAS"
$ CHECKSUM_IS = 1062041168
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X[INHERIT('BASICFILEOPS','CONVERSION',
X'LATEXOPS','TREEANDLISTOPS','FLAGOPS','DSROPS','INIOPS')]
X
XPROGRAM RNOTOTEX( INPUT, OUTPUT);
X
X{ PROGRAM TO CONVERT A RUNOFF FORMAT FILE TO TEX FORMAT }
X{ DEVELOPED BY RANDALL VENHOLA, SUMMER 1987 ON CCRS SMOKE:: }
X{ USING VAX PASCAL }
X
XLABEL
X
X  ENDOFPROGRAM;
X
XCONST
X   DEFAULTFONT = 10;
X   DEFAULTSTYLE = 'report';
X
XVAR
X 
X  RNO, TEX, INI                 : TEXT;         
X  RUNOFFTREE                   : ARGTREE;
X  CURRENTDATE, CURRENTTIME    : DATETIMETYPE;
X  INPUTFID, OUTPUTFID         : FIDTYPE;                   
X  LASTINPUTCHAR, CURRENTCHAR : [GLOBAL] CHAR;
X  TOTALLINES, TOTALCHARS      : [GLOBAL] INTEGER;
X  TOTALGOODDSRCOMMANDS       : [GLOBAL] INTEGER;
X  TOTALBADDSRCOMMANDS        : [GLOBAL] INTEGER;
X  TABRECORD                    : [GLOBAL] TABRECORDTYPE;
X  LOG`009                        : [GLOBAL] TEXT;
X  COLUMNCOUNTER                : [GLOBAL] INTEGER;
X         
X{emergency exit procedure}
X[GLOBAL] PROCEDURE GOTOENDOFPROGRAM;
XBEGIN
X   GOTO ENDOFPROGRAM
XEND;
X
X
XBEGIN
X
X    OPENLOGFILE;
X    GREETUSER( CURRENTDATE, CURRENTTIME );
X    USERINTERFACE( INPUTFID, OUTPUTFID, RNO, TEX );
X    SETUPTREE( INI, RUNOFFTREE );
X    PUTCOMMENTSTOOUTPUT( TEX, INPUTFID, CURRENTDATE, CURRENTTIME);
X    STARTLATEX( TEX, DEFAULTFONT, DEFAULTSTYLE );
X    INITFLAGTABLE;
X    INITGLOBALVARS;
X    INITCHARREADER( RNO );
X    PARSEFILE(RNO, TEX, RUNOFFTREE );
X    ENDLATEX( TEX );
X
XENDOFPROGRAM:
X
X    WRITELN(LOG,'[TOTAL GOOD DSR COMMANDS = ',TOTALGOODDSRCOMMANDS,']');
X    WRITELN(LOG,'[TOTAL  BAD DSR COMMANDS = ',TOTALBADDSRCOMMANDS,']');
X    CLOSEFILES( RNO, TEX );
X    CLOSELOGFILE          
X
XEND.
X                    
$ GOSUB UNPACK_FILE
$ FILE_IS = "RNOTOTEX.RNH"
$ CHECKSUM_IS = 808919667
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X.AP
X.NOFLAGS ACCEPT
X.NONUMBER
X.LITERAL
X
X1 RNOTOTEX
X
X  $ RNOTOTEX[ /qualifier] RNO-FILE-SPEC TEX-FILE-SPEC
X
X.END LITERAL
X.LM+2
XReads a Digital Standard Runoff format file and creates the LaTeX 
Xequivalent.
X.LM-2
X.LITERAL
X
X2 Parameters
X
X   RNO-FILE-SPEC 
X
X.END LITERAL
X.LM+2
X ... is the name of the input DSR format file. The default type 
Xis .RNO.
X.LITERAL
X
X  TEX-FILE-SPEC
X
X.END LITERAL
X
X ... is the name of the output TEX file spec. The default
Xtype is .TEX.
X.LM-2
X.LITERAL
X
X2 Command-Qualifiers
X
X/TEX
X
X  /TEX 
X
X.END LITERAL
X.LM+2
XPreserve embedded TeX and LaTeX commands in the input DSR file. 
XAny commands found are copied directly to the output .TEX file.  The
Xdefault is /NOTEX.
X
X.LM-2
X.LITERAL
X
X2 Example
X
X.END LITERAL
X.LM+2
XThe following DCL 
Xcommands convert the DSR file FOO.RNO to FOO.TEX and prints the
XLN3 file on the LN03. The log of the conversion is also printed
Xand deleted.
X.LITERAL
X
X  $ RNOTOTEX FOO.RNO FOO.TEX
X  $ LATEX/BATCH FOO.TEX
X  $ DVI2LN3 FOO.DVI
X  $ PRINT/FORM=TEX FOO.LN3
X  $ PRINT/DELETE RNOTOTEX.LOG
X
X.END LITERAL
X
XNote that there isn't a one-to-one mapping of DSR commands to LaTeX 
Xcommands and that more LaTeX text fits on a page than a RUNOFF file.
XThe first output may be messy!  The output .TEX file must be
Xedited after examining the first printing. It may take a few tries to
Xget the output that you want.
X
XThe program was designed for those familiar with both LaTeX and DSR
Xand would like to upgrade older documents to LaTeX format.
$ GOSUB UNPACK_FILE
$ FILE_IS = "RNOTOTEX_GUIDE.TEX"
$ CHECKSUM_IS = 1613414640
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X\documentstyle{report}
X%
X%   DOCUMENTATION FOR PROGRAM RNOTOTEX
X%   WRITTEN IN LATEX USING LSE 
X%   R. VENHOLA, 9-MAR-88
X%
X%   Revised by John Edgecombe,  6-JUL-1988, restricting to RNOTOTEX only
X%
X% put section headings on top of page
X\pagestyle{headings}
X
X% release the LaTeX boundaries for margins
X\setlength{\oddsidemargin}{0.5in}
X\setlength{\evensidemargin}{0.0in}
X\setlength{\topmargin}{0.0in}
X
X% make the page size wider and longer
X\setlength{\textwidth}{6.0in}   % 8.5 by 11 page with 1 inch margins
X\setlength{\textheight}{8.0in}  % on each side
X
X% generate a title page
X\author{R.~Venhola}
X\title{ { \Huge \TeX\ \& \LaTeX\ \\ 
X\vspace*{1.0ex} 
XCONVERSION PROGRAM } \\
XRNOTOTEX
X}
X\maketitle
X
X% An IDX file is to be generated
X\makeindex
X
X% A short form command 
X\newcommand{\lb}{\large\bf}
X
X\begin{document}
X
X\chapter{Quick Reference}
XExecute SETUP.COM ({\tt @SETUP.COM}) to set the DCL command syntax
Xbefore using the RNOTOTEX command.
X
X\section{RNOTOTEX}
XDCL command format is :
X
X\begin{center}
X
X{\large\bf \$ RNOTOTEX[\ /qualifier] RNO-FILE-SPEC  TEX-FILE-SPEC}
X
X\end{center}
X
XReads a {\em Digital Standard Runoff} format file and creates the \LaTeX\ 
Xequivalent.
X
X
X\subsection{Parameters}
X
X\begin{center}
X
X
X {\large\sl RNO--FILE--SPEC }
X
X\end{center}
X
X$\ldots$ is the name of the input DSR format file.  The default type 
Xis~{\tt{.RNO}}.
X\begin{center}
X
X
X {\large\sl TEX--FILE--SPEC }
X
X\end{center}
X$\ldots$ is the name of the output~{\tt{TEX}} file spec.  The default
Xtype is~{\tt{.TEX}}.
X
X\subsection{/TEX}
X
X\begin{center}
X
X{\large\sl /TEX }
X
X\end{center}
X
XPreserve embedded \TeX\ and \LaTeX\ commands in the input DSR file.  
XAny commands found are copied directly to the output~{\tt{.TEX}} file.   The
Xdefault is /NOTEX.
X
X\subsection{Example}
XThe following DCL 
Xcommands convert the DSR file FOO.RNO to FOO.TEX and prints the
XLN3 file on the LN03.  The log of the conversion is also printed
Xand deleted.
X
X\begin{verbatim}
X
X    $ RNOTOTEX FOO.RNO
X    $ LATEX FOO.TEX
X    $ DVI2LN3 FOO.DVI
X    $ PRINT/FORM=TEX FOO.LN3
X    $ PRINT/DELETE RNOTOTEX.LOG
X
X\end{verbatim}
X
XNote that there isn't a one-to-one mapping of DSR commands to \LaTeX\ 
Xcommands and that more \LaTeX\ text fits on a page than a RUNOFF file.
VThe  first output may be messy!   The output~{\tt{.TEX}} file must \index{messy
X RNOTOTEX output}
Xedited after examining the first printing.  It may take a few tries to
Xget the output that you want.
X
XThe program was designed for those familiar with both \LaTeX\ and DSR
Xand would like to upgrade older documents to \LaTeX\ format.
X\vspace{10.0cm}
X\pagebreak
X
X\chapter{Introduction}
X\TeX\ and \LaTeX\ are programs that allow programmers to typeset manuscripts
Vfor high precision output devices, such as the \index{LN03} LN03 linked to the 
XSMOKE
Xsystem at CCRS.  \LaTeX\ can be thought of as a usable extension of
X\TeX\ .  Raw \TeX\ can be difficult to use.
X
XThe input files to the program are created in the same
Xmanner as one would create a RUNOFF source file.  The usual file type 
Xis ````{\tt{.TEX}}''.
XThe files are in simple ASCII format, so that they may be created using an
Xeditor such as EDT, SED or \index{LSE} LSE ({\bf L}anguage 
X{\bf S}ensitive {\bf E}ditor).  As a note, the current version of
XLSE on SMOKE recognizes {\tt{TEX}} files and initializes the programming
Xlanguage to be ````LATEX'', with the appropriate expandable placeholders.
X
XCommands such  as ````\verb+\chapter{Introduction}+'' are 
Xembedded in the~{\tt{.TEX}}
Xfile. The file is run through either the \TeX\ or \LaTeX\ program, 
Vwhich will produces a~{\tt{.DVI}} file (for {\bf D}e{\bf{V}}ice {\bf I}ndepende
Xnt).
XThis {\tt{.DVI}} file must be converted to the local print format, which in our
Xcase is done by the program {\bf DVI2LN3}.  
X
XDocumentation on \TeX\ and \LaTeX\ commands are given in Knuth\cite{tex-manual}
Xand Lamport\cite{latex-manual}\footnote{References are listed in the
XBibliography}.
XThe user requires some familiarity with either \TeX\ or \LaTeX\ 
Xto use the conversion programs described in this document.
X
XProgram {\bf RNOTOTEX} reads a DSR format file 
X(i.e.~FOO.RNO) and writes the equivalent\footnote{Well, not {\em really}
Xequivalent, as you will find out in later} TEX format
Xfile (FOO.TEX).
X
X\chapter{RNOTOTEX}
XProgram {\bf RNOTOTEX} will read a DEC Standard RUNOFF (DSR) format text file,
Xtranslate the RUNOFF commands to \LaTeX\ commands and write the corresponding
XTEX file.  The output file may then be processed by \LaTeX\ and printed
Xon the local high quality printer.  To use {\bf RNOTOTEX} one must have
Xexecuted the DCL command procedure
X````SETUP'' as described
Xin the first chapter.
X
X\section{Execution}
XProgram {\bf RNOTOTEX} requires two files names on the command line : the
Xinput~.RNO file and the output~{\tt{.TEX}} file.  For example~:
X\begin{verbatim}
X
X  $ RNOTOTEX FOO.RNO FOO.TEX
X
X\end{verbatim}
Xtranslates the file FOO.RNO to the file FOO.TEX.   The program does not
Xrequire any user input.
X
X\section{Translation Actions}
-+-+-+-+-+ End of part 4 +-+-+-+-+-

