home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / os2tex_3.zip / disk6.zip / disk_6 / support.cmd < prev    next >
OS/2 REXX Batch file  |  1997-12-29  |  4KB  |  218 lines

  1. /**/
  2.  
  3.  
  4. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  5. call SysLoadFuncs
  6.  
  7.  
  8.  
  9.  
  10. parse arg language texmf source options
  11.  
  12.  
  13.  
  14.  
  15.  
  16. packages = 8
  17.  
  18.  
  19. ins.1 = "a4.ins"
  20. ins.2 = "dinbrief.ins"
  21. ins.3 = "float.ins"
  22. ins.4 = "subfigure.ins"
  23. ins.5 = "supertabular.ins"
  24. ins.6 = "subeqnarray.ins"
  25. ins.7 = ""
  26. ins.8 = "rotating.ins"
  27.  
  28. doc.1 = "a4.dtx"
  29. doc.2 = "dinbrief.drv"
  30. doc.3 = "float.dtx"
  31. doc.4 = "subfigure.dtx"
  32. doc.5 = "supertabular.dtx"
  33. doc.6 = "subeqnarray.dtx"
  34. doc.7 = ""
  35. doc.8 = "examples.tex"
  36.  
  37. dvi.1 = "a4.dvi"
  38. dvi.2 = "dinbrief.dvi"
  39. dvi.3 = "float.dvi"
  40. dvi.4 = "subfigure.dvi"
  41. dvi.5 = "supertabular.dvi"
  42. dvi.6 = "subeqnarray.dvi"
  43. dvi.7 = "fancyhdr.dvi"
  44. dvi.8 = "examples.dvi"
  45.  
  46. dir.1 = "a4"
  47. dir.2 = "dinbrief"
  48. dir.3 = "float"
  49. dir.4 = "subfigure"
  50. dir.5 = "supertabular"
  51. dir.6 = "subeqnarray"
  52. dir.7 = "fancyhdr"
  53. dir.8 = "rotating"
  54.  
  55. tit.1 = "a4 [NTG]"
  56. tit.2 = "dinbrief [K.D. Braune]"
  57. tit.3 = "float [A. Lingnau]"
  58. tit.4 = "subfigure [FSF]"
  59. tit.5 = "supertabular [J. Braams]"
  60. tit.6 = "subeqnarray [J. Braams]"
  61. tit.7 = "fancyhdr []"
  62. tit.8 = "rotating [S. Rahtz]"
  63.  
  64. say "msg:LaTeX2e supported:"
  65.  
  66.  
  67. install = texmf"\os2tex\install"
  68.  
  69.  
  70.  
  71. do i = 1 to packages
  72.   obj.i = "<OS2TeX_supported_"dir.i".dvi>"
  73. end
  74.  
  75.  
  76.  
  77. if "" = directory(texmf"\tex\latex") then do
  78.   say "err:Verzeichniswechsel nicht möglich"
  79.   exit 1
  80. end
  81.  
  82.  
  83.  
  84. if Pos("InstallFiles", options) > 0 then do
  85.  
  86.  
  87. /* delete target directories */
  88.  
  89.    do i = 1 to packages
  90.       install"\kdir "dir.i
  91.    end
  92.  
  93.  
  94.  
  95.  
  96.  
  97. /* unzip packages */
  98.  
  99.  
  100.  
  101.    say "msg:LaTeX2e supported: unpacking support.zip"
  102.  
  103.  
  104.  
  105.    install"\unzip -o "source"\support.zip"
  106.  
  107.    call directory texmf
  108.  
  109.  
  110. /* delete and create documentation directories */
  111.  
  112.  
  113.    do i = 1 to packages
  114.       install"\kdir "texmf"\doc\latex\"dir.i
  115.       "md "texmf"\doc\latex\"dir.i
  116.    end
  117.  
  118.  
  119. /* unpack *.ins files via LaTeXs docstrip utility */
  120.  
  121.  
  122.    do i = 1 to packages
  123.       if ins.i \= "" then do
  124.  
  125.          say "msg:LaTeX2e supported: "ins.i
  126.  
  127.          texmf"\os2tex\bin\tex.exe -r -ff latex.fmt -pf "texmf"\os2tex\bin -po "texmf"\tex\latex\"dir.i" -pi "texmf"\tex\latex\"dir.i";"texmf"\tex "ins.i" -a "source"\support.ans"
  128.  
  129.       end
  130.    end
  131.  
  132.  
  133. /* create documentation (dvi files) */
  134.  
  135.  
  136.    do i = 1 to packages
  137.  
  138.       if doc.i \= "" then do
  139.  
  140.          do j = 1 to 3
  141.  
  142.             say "msg:LaTeX2e supported: "dir.i".dvi pass "j" of 3"
  143.  
  144.             texmf"\os2tex\bin\tex.exe -r -ff latex.fmt -pt "texmf"\fonts\tfm -pf "texmf"\os2tex\bin -po "texmf"\doc\latex\"dir.i" -pi "texmf"\doc\latex\"dir.i";"texmf"\tex\latex\"dir.i";"texmf"\tex "doc.i
  145.  
  146.          end
  147.  
  148.       end
  149.       else do
  150.  
  151.          "copy "texmf"\tex\latex\"dir.i"\"dir.i".dvi "texmf"\doc\latex\"dir.i
  152.          "del "texmf"\tex\latex\"dir.i"\"dir.i".dvi"
  153.  
  154.       end
  155.  
  156.    end
  157.  
  158. end
  159.  
  160.  
  161.  
  162. /* create WPS objects */
  163.  
  164.  
  165.  
  166. if Pos("CreateObjects", options) > 0 then do
  167.  
  168.    say "msg:LaTeX2e supported: creating WPS objects"
  169.  
  170.  
  171.    do i = 1 to packages
  172.  
  173.       classname = 'WPProgram'
  174.       objtitle  = tit.i
  175.  
  176.       location  = '<OS2TEX_MISC_FOLDER>'
  177.       setup     = 'EXENAME='texmf'\os2tex\bin\dvi.exe;PROGTYPE=PM;STARTUPDIR='texmf'\os2tex\bin;OBJECTID='obj.i';PARAMETERS='texmf'\doc\latex\'dir.i"\"dvi.i
  178.       duplicate = 'replace'
  179.  
  180.       rc = SysCreateObject(classname,objtitle,location,setup,duplicate)
  181.  
  182.    end
  183.  
  184. end
  185.  
  186.  
  187.  
  188. /* copy rotating documentation */
  189.  
  190.  
  191. if Pos("InstallFiles", options) > 0 then do
  192.  
  193.  
  194.    "copy "texmf"\tex\latex\rotating\cat.eps "texmf"\doc\latex\rotating"
  195.    "copy "texmf"\tex\latex\rotating\example* "texmf"\doc\latex\rotating"
  196.  
  197.    "del "texmf"\tex\latex\rotating\cat.eps"
  198.    "del "texmf"\tex\latex\rotating\example*"
  199.  
  200.  
  201. /* clean up files */
  202.  
  203.  
  204.  
  205.    say "msg:LaTeX2e supported: clean up files"
  206.  
  207.  
  208.    do i = 1 to packages
  209.  
  210.       "del "texmf"\tex\latex\"dir.i"\*.ins"
  211.       "del "texmf"\tex\latex\"dir.i"\*.dtx"
  212.  
  213.    end
  214.  
  215. end
  216.  
  217.  
  218.