home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / windows / openloo / 3756 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.5 KB  |  69 lines

  1. Xref: sparky comp.windows.open-look:3756 alt.lucid-emacs.help:389
  2. Newsgroups: comp.windows.open-look,alt.lucid-emacs.help
  3. Path: sparky!uunet!elroy.jpl.nasa.gov!ufo!Aig.Jpl.Nasa.Gov!rouquett
  4. From: rouquett@Aig.Jpl.Nasa.Gov (Nicolas Rouquette)
  5. Subject: until one can tooltalk pageview...
  6. Message-ID: <1992Sep8.164110.29741@jpl-devvax.jpl.nasa.gov>
  7. Sender: usenet@jpl-devvax.jpl.nasa.gov (For NNTP so rrn will be able to post)
  8. Nntp-Posting-Host: ai-cyclops
  9. Reply-To: rouquett@aig.jpl.nasa.gov
  10. Organization: NASA/Jet Propulsion Laboratory
  11. Date: Tue, 8 Sep 1992 16:41:10 GMT
  12. Lines: 55
  13.  
  14. Here's a solution for a quick preview of postscript files particularly
  15. useful within lucid emacs. 
  16.  
  17. Note: There is a significant difference in the rendering speed between
  18. pageview and helpviewer. I don't know exactly why since I reckon that
  19. both programs use the NeWS to process postscript.
  20.  
  21.  
  22. First, define a new variable:
  23.  
  24. (defvar tex-print-extension ".dvi"
  25.   "*Normal extension of tex files to be printed.
  26. Normally .dvi to process tex files.
  27. Change to .ps to for tex-print commands
  28. to operate on the ps files instead.")
  29.  
  30. Then modify a bit the tex-print function:
  31.  
  32. (defun tex-print (&optional alt)
  33.   "Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file].
  34. Runs the shell command defined by tex-dvi-print-command.  If prefix argument
  35. is provided, use the alternative command, tex-alt-dvi-print-command."
  36.   (interactive "P")
  37.   (let ((print-file-name-dvi (tex-append tex-print-file tex-print-extension))
  38.     test-name)
  39.     (if (and (not (equal (current-buffer) tex-last-buffer-texed))
  40.          (file-newer-than-file-p
  41.           (setq test-name (tex-append (buffer-file-name)
  42.                       tex-print-extension))
  43.           print-file-name-dvi))
  44.     (setq print-file-name-dvi test-name))
  45.     (if (not (file-exists-p print-file-name-dvi))
  46.         (error "No appropriate `%s' file could be found" tex-print-extension)
  47.       (tex-send-command
  48.         (if alt tex-alt-dvi-print-command tex-dvi-print-command)
  49.         print-file-name-dvi))))
  50.  
  51.  
  52. Finally, customize at will, e.g.:
  53.  
  54.   (setq tex-dvi-print-command "dvips")
  55.   (setq tex-alt-dvi-print-command
  56.     '(format "dvips -p%s -l%s"
  57.       (read-string "First page: ")
  58.       (read-string "Last page: ")))
  59.   (setq tex-dvi-view-command "helpopen")
  60.   (setq tex-dvi-view-extension ".ps")
  61.  
  62. The net effect is that the same helpviewer process is used over and
  63. over again to preview tex files. 
  64.  
  65. -- 
  66. ----------Nicolas Rouquette----------rouquett@aig.jpl.nasa.gov
  67.     Artificial Intelligence Group
  68.       Jet Propulsion Laboratory
  69.