[comp.sys.next] Emacs/TeX hint

charlie@wam.umd.edu (Charles William Fletcher) (03/21/91)

	Here's a hint for using the TeX mode in emacs. Since on the NeXT, 
the tex option -v will pass the dvi file to the previewer(TeXView), 
then by editing the emacs lisp file this can be done automatically from 
within emacs (in TeX-mode), even when compiling a region with C-c C-r. 
Here's how--
	
 Change the emacs .el file for TeX (/usr/lib/emacs/lisp/tex-mode.el) 
by adding the "-v" option to the file commands corresponding to 
"TeX-command".  That is, search for the string "TeX-command" and 
change 'tex' to 'tex -v' and 'latex' to 'latex -v'. The .elc (compiled file) 
may be obtained by going into the directory as su, and invoking emacs. 
Then use the command "M-x byte-compile-file" and give the file name 
(tex-mode.el) at the prompt. (As usual, it is wise to save copies of 
these files first, before working on them as su.)

-Charlie	                                          

hardy@golem.ps.uci.edu (Meinhard E. Mayer (Hardy)) (03/23/91)

In article <1991Mar21.134445.765@wam.umd.edu> charlie@wam.umd.edu (Charles William Fletcher) writes:

>>           Here's a hint for using the TeX mode in emacs. Since on the NeXT, 
>>   the tex option -v will pass the dvi file to the previewer(TeXView), 
>>   then by editing the emacs lisp file this can be done automatically from 
>>   within emacs (in TeX-mode), even when compiling a region with C-c C-r. 
>>   Here's how--
>>
>>    Change the emacs .el file for TeX (/usr/lib/emacs/lisp/tex-mode.el) 
>>   by adding the "-v" option to the file commands corresponding to 
>>   "TeX-command".  That is, search for the string "TeX-command" and 
>>   change 'tex' to 'tex -v' and 'latex' to 'latex -v'. The .elc (compiled file) 
>>   may be obtained by going into the directory as su, and invoking emacs. 
>>   Then use the command "M-x byte-compile-file" and give the file name 
>>   (tex-mode.el) at the prompt. (As usual, it is wise to save copies of 
>>   these files first, before working on them as su.)

This will automatically bring up the previewer -- and you can print
form it.  Another modification which is useful is to change the line
issuing the print command from lpr -d to  (you may also want to change the /tmp
directory in the first line to something like ~/tex -- where you
usually run your  tex;  the advantage of /tmp is that the #-files
get cleaned at every reboot):

(defvar TeX-directory "/tmp/"
  "*Directory in which to run TeX subjob.  Temporary files are
created in this directory.")
(defvar TeX-dvi-print-command "dvips"
  "*Command string used by \\[TeX-print] to print a .dvi file.")
 You can then print directly (without previewing by using the
command C-c C-p.


Hardy 
			  -------****-------
Meinhard E. Mayer (Prof.) Department of Physics, University of California
Irvine CA 92717;(714) 856 5543; hardy@golem.ps.uci.edu or MMAYER@UCI.BITNET