home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / e / epmtex12.zip / GTEX.E < prev    next >
Text File  |  1993-02-19  |  23KB  |  626 lines

  1. /*
  2. ╔════════════════════════════════════════════════════════════════════════════╗
  3. ║ What's it called: EPMTeX V1.2c   (German Version)                          ║
  4. ║                                                                            ║
  5. ║ What does it do:  The E source code for the EPMTeX enhancements V1.2c      ║
  6. ║                   for EPM.                                                 ║                                                                            ║
  7. ║                                                                            ║
  8. ║ Who and When:     Jon Hacker 2/93                                          ║
  9. ║                   Joachim Koenen 2/93     (syntax assist)                  ║
  10. ║                   Thorsten Domsalla 2/93  (menus, batch files)             ║
  11. ║                                                                            ║
  12. ╚════════════════════════════════════════════════════════════════════════════╝
  13. */
  14.  
  15. /*
  16. ------------------------------------------------------------------------------------
  17. NOTE:  For reasons of speed, I do not load the command processor in spawned
  18.        shells by specifying the /n option in the start command.  This means that
  19.        batch files will not run ( ie. TEX_EXEC=d:\mytex\texit.cmd ) since there
  20.        is no interpreter!  
  21.  
  22.        If you want to specify a batch file as the executable in a *.EXEC 
  23.        variable, then change the corresponding *_IS_CMD variable to 1.
  24.  
  25.        ie.  TEX_EXEC = 'd:\texit.cmd'
  26.             TEX_IS_CMD = 1
  27.  
  28.        Do not use the ^&plain or ^&lplain argument in the start command when
  29.        using batch files as the arguments will not make it through to the 
  30.        command.  
  31.  
  32.        ie.  if you specify TEX_EXEC = 'd:\texit.cmd ^&lplain' then texit.cmd 
  33.        will not receive any arguments.  But, TEX_EXEC = 'd:\texit.cmd' works
  34.        fine!
  35.  
  36.        I have no explanation for this weirdness!  Ask someone smarter.
  37.  
  38.        If you want to run a previewer that is not a PM application, add the
  39.        switch /win or /fs as appropriate in the start commands in the command
  40.        procedure 'texvw'.
  41.  
  42. ------------------------------------------------------------------------------------
  43. */
  44.  
  45. const
  46.  
  47. /* put your TeX executable path, filename and args here */
  48. TEX_EXEC = 'd:\emtex\bin\tex386.exe ^&plain'
  49. TEX_IS_CMD = 0
  50.  
  51. /* put your LaTeX executable path, filename and args here */
  52. LATEX_EXEC = 'd:\emtex\bin\tex386.exe ^&lplain'
  53. LATEX_IS_CMD = 0
  54.  
  55. /* put your Previewer (portrait mode) executable path, filename and args here */
  56. TEX_VIEW_EXEC = 'd:\emtex\dviscr\dvipm7.exe @d:\emtex\dviscr\dvipm.cnf'
  57. TEX_VIEW_IS_CMD = 0
  58.  
  59. /* put your Previewer (landscape mode) executable path, filename and args here */
  60. TEX_VIEWLA_EXEC = 'd:\emtex\dviscr\dvipm7.exe @d:\emtex\dviscr\dvipm.cnf /tr1'
  61. TEX_VIEWLA_IS_CMD = 0
  62.  
  63. /* put your DVI Printer Driver (portrait mode) executable path, filename and args here */
  64. TEX_PRINT_EXEC = 'd:\emtex\dvidrv\dvihplj7.exe @d:\emtex\dvidrv\lj.cnf'
  65. TEX_PRINT_IS_CMD = 0
  66.  
  67. /* put your DVI Printer Driver (landscape mode) executable path, filename and args here */
  68. TEX_PRINTLA_EXEC = 'd:\emtex\dvidrv\dvihplj7.exe @d:\emtex\dvidrv\lj.cnf /tr1'
  69. TEX_PRINTLA_IS_CMD = 0
  70.  
  71. /* OPTIONAL:
  72.    You can define a special mode (German, AMS, Bibtex, ?)  that will appear on
  73.    the TeX menu.  To do this, replace TEX_USER_MENU_TEXT with the label text
  74.    you want to have appear on the menu and edit the *_USER_EXEC variables
  75.    accordingly.
  76.  
  77.    Defining TEX_USER_MENU_TEXT = '' disables this feature.
  78. */
  79.  
  80. TEX_USER_MENU_TEXT = '~German Mode'
  81.  
  82. -- Tex mode 'user' executables
  83. TEX_USER_EXEC = 'd:\emtex\bin\tex386.exe ^&plaing'
  84. TEX_USER_IS_CMD = 0
  85.  
  86. -- Latex mode 'user' executables
  87. LATEX_USER_EXEC = 'd:\emtex\bin\tex386.exe ^&lplaing'
  88. LATEX_USER_IS_CMD = 0
  89.  
  90. --------------------------------------------------------------------------------------
  91. -- startup default conditions
  92.  
  93. compile if not defined(TEX_SYNTAX_ASSIST)
  94. const   TEX_SYNTAX_ASSIST = 1                --  default is to not include TeX syntax expansion 
  95. compile endif
  96.  
  97. compile if not defined(TEX_MARGINS)
  98. const   TEX_MARGINS = '1 80 1'               --  default margins for TeX syntax assist
  99. compile endif
  100.  
  101. compile if not defined(TEX_TABS)
  102. const   TEX_TABS = 8                         --  default tabs for TeX syntax assist
  103. compile endif
  104.  
  105. compile if not defined(TEX_WANT_ACCELERATOR_KEYS)
  106. const   TEX_WANT_ACCELERATOR_KEYS  = 0        -- default is not to add TeX keyboard accelerators
  107. compile endif                                 -- if TeX syntax assist is enabled.
  108.  
  109. compile if not defined(TEX_LATEX_MODE)
  110. const   TEX_LATEX_MODE = 0                    -- default is to turn off latex mode at startup
  111. compile endif                                  
  112.  
  113. compile if not defined(TEX_USER_MODE)
  114. const   TEX_USER_MODE = 0                    -- default is to turn off user mode at startup
  115. compile endif                                  
  116.  
  117. compile if not defined(TEX_LANDSCAPE_MODE)
  118. const   TEX_LANDSCAPE_MODE = 0                -- default is portrait mode at startup
  119. compile endif
  120.  
  121. compile if not defined(TEX_AUTO_DELETE_LOG)
  122. const   TEX_AUTO_DELETE_LOG = 1               -- default is to turn on log file auto-delete
  123. compile endif                                 -- at startup
  124.  
  125. compile if not defined(TEX_AUTO_SAVE_DOC)
  126. const   TEX_AUTO_SAVE_DOC = 1                 -- default is to turn on smart save before TeX
  127. compile endif                                 -- at startup
  128.  
  129. compile if not defined(TEX_DEBUG_MODE)
  130. const   TEX_DEBUG_MODE = 0                  -- default is to turn off verbose mode for debugging TeX
  131. compile endif                               -- at startup
  132. --------------------------------------------------------------------------------------
  133. definit
  134.     universal tex_submenu_on
  135.     universal tex_latex
  136.     universal tex_user
  137.     universal tex_landscape
  138.     universal tex_auto_log
  139.     universal tex_auto_save
  140.     universal tex_syntax
  141.     universal tex_debug
  142.  
  143.     tex_submenu_on=0
  144.     tex_latex=TEX_LATEX_MODE
  145.     tex_user=TEX_USER_MODE
  146.     tex_landscape=TEX_LANDSCAPE_MODE
  147.     tex_auto_log=TEX_AUTO_DELETE_LOG
  148.     tex_auto_save=TEX_AUTO_SAVE_DOC
  149.     tex_syntax=TEX_SYNTAX_ASSIST
  150.     tex_debug=TEX_DEBUG_MODE
  151.  
  152.  
  153. --------------------------------------------------------------------------------------
  154. -- TeX syntax assist 
  155. --    Only include syntax assist if ALTERNATE_KEYSETS flag is on
  156.  
  157. compile if ALTERNATE_KEYSETS
  158.     compile if TEX_SYNTAX_ASSIST
  159.         include 'texkeys.e'
  160.     compile endif
  161. compile endif
  162.  
  163.  
  164. --------------------------------------------------------------------------------
  165. ------
  166. -- English language support for TeX menu help
  167.  
  168. const
  169. TEX_BARP__MSG = \1'Menus related to TeX support'
  170. TEX_TEXP__MSG = \1'TeX the current file'
  171. TEX_VIEWP__MSG = \1'Preview the current associated DVI file'
  172. TEX_PRP__MSG = \1'Print the current associated DVI output file'
  173. TEX_DLOGP__MSG = \1'Delete the current associated LOG file'
  174. TEX_DDVIP__MSG = \1'Delete the current associated DVI file'
  175. TEX_LATEXP__MSG = \1'LaTeX mode'
  176. TEX_USERP__MSG = \1'Toggle German mode on/off'
  177. TEX_LANDSCAPEP__MSG = \1'Preview and print in landscape orientation'
  178. TEX_ADLOGP__MSG = \1'Automatic delete of the associated LOG file after View or Print'
  179. TEX_ASAVEP__MSG = \1'Automatic smart save of TeX file before TeXing document.'
  180. TEX_SYNTAXP__MSG = \1'Global syntax expansion mode (expand_on)'
  181. TEX_DEBUGP__MSG = \1'Verbose mode for troubleshooting TeX commands.'
  182. TEX_C2TEMP__MSG = \1'Copy filename.dvi to temp.dvi.'
  183. TEX_VIEWPTEMP__MSG = \1'Preview the temp.DVI file'
  184.  
  185. /*
  186. ┌───────────────────────────────────────────────────────────────────────────────┐
  187. │  Define TeX menu system                                                       │
  188. └───────────────────────────────────────────────────────────────────────────────┘
  189. */
  190. defselect
  191.    universal defaultmenu, tex_submenu_on, tex_auto_log
  192.    ext = filetype()
  193.    compile if defined(MY_TEX_FILE_TYPE)
  194.       if substr(ext,1,3)='TEX' or ext='STY' or ext='BBL' or ext=MY_TEX_FILE_TYPE then
  195.    compile else
  196.       if substr(ext,1,3)='TEX' or ext='STY' or ext='BBL' then
  197.    compile endif
  198.       if not tex_submenu_on then
  199.          buildsubmenu defaultmenu, 9, '~TeX', TEX_BARP__MSG, 0,0
  200.          buildmenuitem defaultmenu, 9, 901, '~TeX Document',   'tex'TEX_TEXP__MSG, 0,0
  201.          buildmenuitem defaultmenu, 9, 902, \0, '', 4, 0
  202.          buildmenuitem defaultmenu, 9, 903, 'Pre~View Document','texvw'TEX_VIEWP__MSG,  0,0
  203.          buildmenuitem defaultmenu, 9, 904, '~Print Document', 'texpr'TEX_PRP__MSG,  0,0
  204.          buildmenuitem defaultmenu, 9, 905, \0, '', 4, 0
  205.          buildmenuitem defaultmenu, 9, 906, 'Delete LO~G File','tex_del_log'TEX_DLOGP__MSG, 0,0
  206.          buildmenuitem defaultmenu, 9, 907, 'Delete ~DVI File','tex_del_dvi'TEX_DDVIP__MSG, 0,0
  207.          buildmenuitem defaultmenu, 9, 908, \0, '', 4, 0
  208.          buildmenuitem defaultmenu, 9, 909, '~LaTeX Mode','toggle_latex'TEX_LATEXP__MSG, 0,0
  209.          compile if TEX_USER_MENU_TEXT <> ''
  210.             buildmenuitem defaultmenu, 9, 910, TEX_USER_MENU_TEXT,'toggle_user'TEX_USERP__MSG, 0,0
  211.          compile endif
  212.          buildmenuitem defaultmenu, 9, 911, 'La~ndscape Mode','toggle_landscape'TEX_LANDSCAPEP__MSG, 0,0
  213.          buildmenuitem defaultmenu, 9, 912, '~Auto LOG Delete','toggle_auto_log'TEX_ADLOGP__MSG, 0,0
  214.          buildmenuitem defaultmenu, 9, 913, 'Auto ~Save','toggle_auto_save'TEX_ASAVEP__MSG, 0,0
  215.          compile if TEX_SYNTAX_ASSIST
  216.             buildmenuitem defaultmenu, 9, 914, 'Synta~x Expansion','toggle_tex_expand'TEX_SYNTAXP__MSG, 0,0
  217.          compile endif
  218.          buildmenuitem defaultmenu, 9, 915, 'De~bug mode','toggle_debug'TEX_DEBUGP__MSG, 0,0
  219.          buildmenuitem defaultmenu, 9, 916, '~Copy to temp.dvi','c2temp'TEX_C2TEMP__MSG, 0,0
  220.          buildmenuitem defaultmenu, 9, 917, 'PreView temp.dvi','texvwtemp'TEX_VIEWPTEMP__MSG,  0,0
  221.          tex_submenu_on = 1
  222.       endif
  223.    else
  224.       if tex_submenu_on then
  225.          deletemenu defaultmenu, 9, 0, 0    -- remove TeX submenu if not a TeX file
  226.          tex_submenu_on = 0
  227.       endif
  228.    endif
  229.    showmenu defaultmenu
  230.  
  231. /*
  232. ┌───────────────────────────────────────────────────────────────────────────────┐
  233. │  Command definitions                                                          │
  234. └───────────────────────────────────────────────────────────────────────────────┘
  235. */
  236. -- Create a OS/2 window & execute TeX in it.
  237. defc tex =
  238.     universal tex_latex, tex_user, tex_auto_save, tex_debug
  239.     if .modify then               -- Modified since last Save?
  240.        if tex_auto_save then      --  Want auto smart save feature?
  241.            'Save'                 --   Yes - save it before TeXing document
  242.             sayerror 'Saving modified document before calling TeX!'
  243.        else                       --   No - warn user!
  244.             sayerror 'TeXing stale document file... auto_save disabled!'
  245.        endif
  246.     endif
  247.     n=lastpos('\',.filename)+1
  248.     pathname=delstr(.filename,n-1)
  249.     unixfilename = translate(.filename, '/', '\')
  250.     call directory(pathname)
  251.     
  252.     compile if TEX_USER_MENU_TEXT = ''
  253.         if not tex_latex then
  254.             command=TEX_EXEC ' ' unixfilename
  255.             isCMD = TEX_IS_CMD
  256.         else 
  257.             command=LATEX_EXEC ' ' unixfilename
  258.             isCMD = LATEX_IS_CMD
  259.         endif
  260.     compile else
  261.         if not tex_latex and not tex_user then
  262.             command=TEX_EXEC ' ' unixfilename
  263.             isCMD = TEX_IS_CMD
  264.         else if tex_latex and not tex_user then
  265.             command=LATEX_EXEC ' ' unixfilename
  266.             isCMD = LATEX_IS_CMD
  267.              else if not tex_latex and tex_user then
  268.                     command=TEX_USER_EXEC ' ' unixfilename
  269.                     isCMD = TEX_USER_IS_CMD
  270.                   else if tex_latex and tex_user then
  271.                       command=LATEX_USER_EXEC ' ' unixfilename
  272.                       isCMD = LATEX_USER_IS_CMD
  273.                        endif
  274.                   endif
  275.              endif
  276.         endif
  277.     compile endif
  278.  
  279.     if tex_debug then
  280.         sayerror command
  281.     endif
  282.  
  283.     if isCMD then                -- command is a batch file, use command processor
  284.         'start /c /win 'command
  285.     else
  286.         'start /n /win 'command
  287.     endif
  288.     if rc <> 0 then
  289.         sayerror"Caution! Could not start TeX. Exited with return code = "rc
  290.     endif
  291. -------------------------------------------------------------------------------
  292. -- View current TeX file in previewer. 
  293. defc texvw =
  294.     universal tex_landscape, tex_auto_log, tex_debug
  295.     if  tex_auto_log then
  296.         call tex_delete_log_file()
  297.     endif
  298.     n=lastpos('\',.filename)+1;
  299.     filename=substr(.filename,n);
  300.     pathname=delstr(.filename,n-1);
  301.     n=lastpos('.',filename)+1;
  302.     stem=delstr(filename,n-1);
  303.  
  304.     if tex_landscape then
  305.         command= TEX_VIEWLA_EXEC' 'pathname'\'stem'.dvi'
  306.         isCMD = TEX_VIEWLA_IS_CMD
  307.     else
  308.         command= TEX_VIEW_EXEC' 'pathname'\'stem'.dvi'
  309.         isCMD = TEX_VIEW_IS_CMD
  310.     endif
  311.  
  312.     if tex_debug then
  313.         sayerror command
  314.     endif
  315. ----------
  316. -- NOTE: add /fs or /win if previewer is not a PM app
  317.  
  318.     if isCMD then                -- command is a batch file, use command processor
  319.         'start /c 'command
  320.     else
  321.         'start /n 'command
  322.     endif
  323. ----------
  324.     if rc <> 0 then
  325.         sayerror"Caution! Could not start Previewer. Exited with return code = "rc
  326.     endif
  327.  
  328.  
  329.  
  330. -------------------------------------------------------------------------------
  331. -- Create a OS/2 window & execute TeX printer driver.
  332. defc texpr =
  333.     universal tex_landscape, tex_auto_log, tex_debug
  334.  
  335.     if  tex_auto_log then
  336.         call tex_delete_log_file()
  337.     endif
  338.  
  339.     n=lastpos('\',.filename)+1;
  340.     filename=substr(.filename,n);
  341.     pathname=delstr(.filename,n-1);
  342.     n=lastpos('.',filename)+1;
  343.     stem=delstr(filename,n-1);
  344.  
  345.     if tex_landscape then
  346.         command= TEX_PRINTLA_EXEC' 'pathname'\'stem'.dvi'
  347.         isCMD = TEX_PRINTLA_IS_CMD
  348.     else
  349.         command= TEX_PRINT_EXEC' 'pathname'\'stem'.dvi'
  350.         isCMD = TEX_PRINT_IS_CMD
  351.     endif
  352.  
  353.     if tex_debug then
  354.         sayerror command
  355.     endif
  356.  
  357.     if isCMD then                -- command is a batch file, use command processor
  358.         'start /c /win 'command
  359.     else
  360.         'start /n /win 'command
  361.     endif
  362.     if rc <> 0 then
  363.         sayerror"Caution! Could not start Printer driver. Exited with return code = "rc
  364.     endif
  365.  
  366.  
  367. -------------------------------------------------------------------------------
  368. -- Delete current TeX LOG file.
  369. defc tex_del_log = call tex_delete_log_file()
  370.  
  371. -------------------------------------------------------------------------------
  372. -- Delete current TeX DVI file.
  373. defc tex_del_dvi = call tex_delete_dvi_file()
  374.  
  375. -------------------------------------------------------------------------------
  376. -- Toggle LaTeX mode flag.
  377. defc toggle_latex =
  378.     universal tex_latex
  379.     universal tex_debug
  380.     tex_latex = not tex_latex
  381.     if tex_debug then
  382.         sayerror 'tex_latex = 'tex_latex
  383.     endif
  384.  
  385. -------------------------------------------------------------------------------
  386. -- Toggle user mode flag.
  387. compile if TEX_USER_MENU_TEXT <> ''
  388.     defc toggle_user =
  389.     universal tex_user, tex_debug
  390.     tex_user = not tex_user
  391.     if tex_debug then
  392.         sayerror 'tex_user = 'tex_user
  393.     endif
  394. compile endif
  395.  
  396. -------------------------------------------------------------------------------
  397. -- Toggle Landscape mode flag.
  398. defc toggle_landscape =
  399.     universal tex_landscape
  400.     universal tex_debug
  401.     tex_landscape = not tex_landscape
  402.     if tex_debug then
  403.         sayerror 'tex_landscape = 'tex_landscape
  404.     endif
  405.  
  406.  
  407. -------------------------------------------------------------------------------
  408. -- Toggle Auto-Delete current TeX LOG file after View or Print flag.
  409. defc toggle_auto_log =
  410.     universal tex_auto_log
  411.     universal tex_debug
  412.     tex_auto_log = not tex_auto_log
  413.     if tex_debug then
  414.         sayerror 'tex_auto_log = 'tex_auto_log
  415.     endif
  416.  
  417.  
  418. -------------------------------------------------------------------------------
  419. -- Toggle Auto smart-save current TeX file before TeXing document .
  420. defc toggle_auto_save =
  421.     universal tex_auto_save
  422.     universal tex_debug
  423.     tex_auto_save = not tex_auto_save
  424.     if tex_debug then
  425.         sayerror 'tex_auto_save = 'tex_auto_save
  426.     endif
  427.  
  428. -------------------------------------------------------------------------------
  429. -- Toggle EPM syntax expansion flag.
  430. compile if TEX_SYNTAX_ASSIST
  431.     defc toggle_tex_expand =
  432.     universal expand_on, tex_debug
  433.     if expand_on then
  434.         'expand 'OFF__MSG
  435.     else
  436.         'expand 'ON__MSG
  437.     endif
  438.     if tex_debug then
  439.         sayerror 'expand_on = 'expand_on
  440.     endif
  441. compile endif
  442.  
  443. -------------------------------------------------------------------------------
  444. -- Toggle debug mode for troubleshooting TeX commands.
  445. defc toggle_debug =
  446.     universal tex_debug
  447.     tex_debug = not tex_debug
  448.     if tex_debug then
  449.         sayerror 'tex_debug = 'tex_debug
  450.     endif
  451.  
  452.  
  453. -------------------------------------------------------------------------------
  454. -- View temp.dvi file in previewer (this is for DVIPM 1.4s 'reload' command)
  455. defc texvwtemp =
  456.     universal tex_landscape, tex_auto_log, tex_debug
  457.     if  tex_auto_log then
  458.         call tex_delete_log_file()
  459.     endif
  460.     n=lastpos('\',.filename)+1;
  461.     pathname=delstr(.filename,n-1);
  462.  
  463.     if tex_landscape then
  464.         command= TEX_VIEWLA_EXEC' 'pathname'\temp.dvi'
  465.         isCMD = TEX_VIEWLA_IS_CMD
  466.     else
  467.         command= TEX_VIEW_EXEC' 'pathname'\temp.dvi'
  468.         isCMD = TEX_VIEW_IS_CMD
  469.     endif
  470.  
  471.     if tex_debug then
  472.         sayerror command
  473.     endif
  474. ----------
  475. -- NOTE: add /fs or /win if previewer is not a PM app
  476.  
  477.     if isCMD then                -- command is a batch file, use command processor
  478.         'start /c 'command
  479.     else
  480.         'start /n 'command
  481.     endif
  482. ----------
  483.     if rc <> 0 then
  484.         sayerror"Caution! Could not start Previewer. Exited with return code = "rc
  485.     endif
  486.  
  487.  
  488. -------------------------------------------------------------------------------
  489. -- Copy current DVI file to temp.dvi
  490. defc c2temp =
  491.     universal tex_debug
  492.     n=lastpos('\',.filename)+1;
  493.     filename=substr(.filename,n);
  494.     pathname=delstr(.filename,n-1);
  495.     n=lastpos('.',filename)+1;
  496.     stem=delstr(filename,n-1);
  497.     command= 'copy 'pathname'\'stem'.dvi 'pathname'\temp.dvi > nul'
  498.     if tex_debug then
  499.         sayerror command
  500.     endif
  501.  
  502.     'detach ' command
  503.     if rc > 0 then
  504.         sayerror"Caution! c2temp exited with return code = "rc
  505.     endif
  506.  
  507.  
  508.  
  509.  
  510. /*
  511. ┌───────────────────────────────────────────────────────────────────────────────┐
  512. │  Procedure definitions                                                        │
  513. └───────────────────────────────────────────────────────────────────────────────┘
  514. */
  515.  
  516. -- Delete current TeX LOG file.
  517. defproc tex_delete_log_file
  518.     n=lastpos('\',.filename)+1;
  519.     filename=substr(.filename,n);
  520.     pathname=delstr(.filename,n-1);
  521.     n=lastpos('.',filename)+1;
  522.     stem=delstr(filename,n-1);
  523.     rc = erasetemp(pathname'\'stem'.log')
  524.     if rc = 0 then
  525.        sayerror 'File 'stem'.LOG deleted'
  526.     elseif rc = 2 then
  527.         sayerror 'Delete LOG: file 'stem'.LOG could not be found'
  528.     else
  529.         sayerror 'Delete LOG: file 'stem'.LOG could not be deleted'
  530.         beep(1000, 100)
  531.     endif
  532.  
  533.  
  534. -------------------------------------------------------------------------------
  535. -- Delete current TeX DVI file.
  536. defproc tex_delete_dvi_file
  537.     n=lastpos('\',.filename)+1;
  538.     filename=substr(.filename,n);
  539.     pathname=delstr(.filename,n-1);
  540.     n=lastpos('.',filename)+1;
  541.     stem=delstr(filename,n-1);
  542.     rc = erasetemp(pathname'\'stem'.dvi')
  543.     if rc = 0 then
  544.        sayerror 'File 'stem'.DVI deleted'
  545.     elseif rc = 2 then
  546.         sayerror 'Delete DVI: file 'stem'.DVI could not be found'
  547.     else
  548.         sayerror 'Delete DVI: file 'stem'.DVI could not be deleted'
  549.         beep(1000, 100)
  550.     endif
  551.  
  552. -------------------------------------------------------------------------------
  553. -- called in mymnuini.e to get state of global TeX variable tex_latex
  554.  
  555. defproc get_tex_latex =
  556.     universal tex_latex
  557.     return tex_latex
  558.  
  559. -------------------------------------------------------------------------------
  560. -- called in mymnuini.e to get info on user menu options
  561. --  arg = 0 -> query tex_user_defined flag
  562. --        1 -> query tex_user flag
  563.  
  564. defproc get_tex_user =
  565.     compile if TEX_USER_MENU_TEXT = ''
  566.         return 0             -- respond with user menu option undefined
  567.     compile else
  568.         universal tex_user
  569.         if arg(1) = 0 then   -- respond with user menu option defined
  570.             return 1
  571.         else
  572.             return tex_user  -- query tex_user flag
  573.         endif
  574.     compile endif
  575.  
  576. -------------------------------------------------------------------------------
  577. -- called in mymnuini.e to get state of global TeX variable tex_landscape
  578.  
  579. defproc get_tex_landscape =
  580.     universal tex_landscape
  581.     return tex_landscape
  582.  
  583. -------------------------------------------------------------------------------
  584. -- called in mymnuini.e to get state of global TeX variable tex_auto_log
  585.  
  586. defproc get_tex_auto_log =
  587.     universal tex_auto_log
  588.     return tex_auto_log
  589.  
  590. -------------------------------------------------------------------------------
  591. -- called in mymnuini.e to get state of global TeX variable tex_auto_save
  592.  
  593. defproc get_tex_auto_save =
  594.     universal tex_auto_save
  595.     return tex_auto_save
  596.  
  597. -------------------------------------------------------------------------------
  598. -- called in mymnuini.e to get info on syntax menu options
  599. --  arg = 0 -> query tex_syntax flag
  600. --        1 -> query  expand_on flag
  601.  
  602. defproc get_tex_syntax =
  603.     universal tex_syntax, expand_on
  604.     if arg(1) = 0 then           -- query tex_syntax
  605.         return tex_syntax
  606.     else
  607.         return expand_on         -- query expand_on
  608.     endif
  609.  
  610. -------------------------------------------------------------------------------
  611. -- called in mymnuini.e to get state of global EPM variable expand_on
  612.  
  613. defproc get_tex_expand_on =
  614.     universal expand_on
  615.     return expand_on
  616.  
  617. -------------------------------------------------------------------------------
  618. -- called in mymnuini.e to get state of global TeX variable tex_debug
  619.  
  620. defproc get_tex_debug =
  621.     universal tex_debug
  622.     return tex_debug
  623.  
  624. -------------------------------------------------------------------------------
  625.  
  626.