home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / cpp2tex.zip / C++2ltx.zip / C++2ps.cmd < prev    next >
OS/2 REXX Batch file  |  1997-01-28  |  1KB  |  41 lines

  1. /* REXX script (mostly for OS/2) for transforming C/C++ file to PostScript 
  2.    using the program  C++2ltx.awk 
  3.  
  4.    This script overcomes the problem of emTeX and input TeX files with many 
  5.    dots: program tex386 changes e.g. myunits.cpp.tex -> myunits.dvi 
  6.    (middle part taken away) instead of myunits.cpp.dvi
  7.  
  8.    Requirements: your AWKPATH environmental variable must point to 
  9.    a directory where the file  C++2ltx.awk  is located 
  10. */
  11.  
  12. parse arg FILE
  13.  
  14. if (FILE="") then do
  15.   say
  16.   say "Syntax: C++2ps _file_"
  17.   say
  18.   say "This script converts a C/C++ file to a .ps file. It uses C++2ltx.cmd."
  19.   say "The C/C++ extended comments are denoted by /*+ ... */ and //+ ..."
  20.   exit
  21.   end
  22.  
  23. NEWFILE=translate(FILE,"_",".")  /* replace dots by underscores */
  24. '@echo off'
  25. 'call C++2ltx 'FILE'>'NEWFILE'.tex'
  26. 'call latex 'NEWFILE
  27. 'call dvips 'NEWFILE
  28.  
  29. say 'Preview by dvipm? [Y=yes]'
  30. pull answer .
  31. if answer='Y' then 'start dvipm @dvipm.cnf 'NEWFILE
  32.  
  33. say 'Preview by GhostView? [Y=yes]'
  34. pull answer .
  35. if answer='Y' then 'start gvpm 'NEWFILE'.ps'
  36.  
  37. say 'Clean the garbage except 'NEWFILE'.ps [N=no]?'
  38. pull answer .
  39. if answer<>'N' then 
  40.   'rm 'NEWFILE'.tex ' NEWFILE'.log ' NEWFILE'.aux' NEWFILE'.dvi'
  41.