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

  1. /* REXX script for transforming C/C++ file to .dvi using c2ps.awk */
  2. /* This is optimized for OS/2 Warp */
  3.  
  4. /*
  5.    This script overcomes the problem of emTeX: tex386 changes 
  6.    myunits.cpp.tex -> myunits.dvi 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: c2dvi _file_"
  17.   say
  18.   say "This script converts a C/C++ file to a .dvi file. It uses C++2ltx.awk."
  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.  
  28. /* NO:
  29. say 'Preview by dvipm? [Y=yes]'
  30. pull answer .
  31. if answer='Y' then 'start dvipm @dvipm.cnf 'NEWFILE
  32. */
  33.  
  34. /* NO:
  35. say 'Clean the garbage except 'NEWFILE'.ps [N=no]?'
  36. pull answer .
  37. if answer<>'N' then 
  38.   'rm 'NEWFILE'.tex ' NEWFILE'.log ' NEWFILE'.aux' NEWFILE'.dvi'
  39. */
  40.