[comp.text.tex] Altarnative to standard TeX-mode in GNUemacs?

dash@delphi.math.uio.no (Dag Asheim) (09/27/90)

I'm sorry if this is a frequently asked question on comp.text.tex
(I don't usually read that group) but I haven't seen this in
gnu.emacs either, so...  Here goes:

Does anyone know of a good Emacs mode for (La)TeX-documents? In an
article of Stephan v. Bechtolsheim in 1988 Conference Proceedings, TeX
Users Group, it is refered to a TeX mode by Nelson Beebe from the
University of Utah, which is "probably much better worked out than any
other TeX mode for this editor".


Dag Asheim
dash@math.uio.no

myers@ut-emx.uucp (Eric Myers) (09/27/90)

In article <DASH.90Sep27120107@delphi.math.uio.no> dash@delphi.math.uio.no
 (Dag Asheim) writes: 
>Does anyone know of a good Emacs mode for (La)TeX-documents? 

I have found the following modifications to TeX-mode, via the
TeX-mode-hook, to be useful for me.  You can modify as you like.
--

;; ---------- Customized TeX mode for GNU emacs

(setq TeX-mode-hook  'my-TeX-mode)

(load "texsis" t t)                    ;; get TeXsis stuff

(defun my-TeX-mode()
  "Additions to standard TeX mode.   E. Myers,  13 June, 1987...7/20/90
   1) line begining with '$$' is recognized as paragraph start.
   2) line begining with '%'  is recognized as paragraph start.
   3) line ending with '$$' is recognized as paragraph separate.
   4) all tabs converted to spaces when file is entered
   5) support for the ispell program to check spelling in .tex files
   6) support TeX-buffer and region commands with a good name for the
      zap file and ability to recognize TeXsis files.  "
  (setq paragraph-start (concat paragraph-start "\\\|^\\\$\\\$" ))
  (setq paragraph-start (concat paragraph-start "\\\|^\%" ))
  (setq paragraph-separate (concat paragraph-separate "\\\|\\\$\\\$" ))
  (setq paragraph-separate (concat paragraph-separate "\\\|^\%" ))
  (untabify (point-min) (point-max))    ; convert all tabs to spaces in file
  (set-fill-column 72)                  ; allow room in right margin
  (setq comment-column 48)              ; indent comments to here
  (setq ispell-filter-hook "detex" )    ; to ispell TeX stuff
  (setq ispell-filter-hook-args '("-iw")); arguments to detex
  (setq ispell-filter-hook-produces-single-column nil); detex does not
  (setq TeX-zap-file "TeXbuffer")       ; name of temporary "zap" file
  (setq TeX-directory ".")              ; tex directory to work in
  (setq TeX-dvi-print-command "dvips")  ; command to print .dvi file
  (look-for-texsis)                     ; texsis-mode if TeXsis file
  (message "TeX mode customized.")
 )

;%======================================================================*
;
; GNU emacs support for TeXsis 
;
; The function texsis-mode makes TeXsis the version of TeX run by the
; commands TeX-buffer and TeX-region.  
;
; The function look-for-texsis looks for "\texsis" (or actually, just
; the word "texsis") and sets texsis-mode if such is found.  Put this
; in your TeX-mode-hook to automatically set texsis-mode for TeXsis files.
;
; Eric Myers, University of Texas at Austin, 22 September 1990
; (with help from lion@navier.stanford.edu -- thanks, leo.)
;======================================================================*

(defun texsis-mode ()  "TeX mode for processing TeXsis files."
  (setq mode-name "TeXsis")        ;; mode name is TeXsis
  (setq TeX-command "texsis")      ;; command to run is "texsis"
 )

(defun look-for-texsis ()  "search for \\texsis, if found turn on texsis-mode"
    (goto-char (point-min))
    (if (search-forward "texsis" nil t)
	(texsis-mode))
    (goto-char (point-min))
 )

-- 
Eric Myers	"If God had intended for man to fly 
			He would have given us the brains to build airplanes."
Center for Relativity, Department of Physics, University of Texas at Austin
myers@emx.utexas.edu  |   myers@utaphy.bitnet   |   myers@ut-emx.UUCP

tatlow@dash.dlb5.dec.com (Tom Tatlow) (09/28/90)

In article <DASH.90Sep27120107@delphi.math.uio.no>, dash@delphi.math.uio.no (Dag
Asheim) writes:
 
|> Does anyone know of a good Emacs mode for (La)TeX-documents?

I use something called "Ultra-TeX Mode," written by two guys from the MIT
Mathematics Department.  It requires a package called "lightning completion"
(which can be used for other things, too).  Lightning completion can be used
for instantaneous completion of commands, file names, etc. It's like typing a 
TAB key after every character, except that you can do special things and
predefine
completion sequences...

Ultra-TeX mode automatically completes on TeX commands and other special
sequences 
(for example, if you type "...", it will be replaced with "\dots" automatically,
etc.
It also has special key sequences for commonly used commands.  For example,
ESC-B 
generated a "\bf{}" around the point.

Finally, there are special commands for special functions, like to bring in
a template file. 


==================================================================
  	    Tom Tatlow	    "The Question"

    Work:  Digital Equipment Corporation, AI Technology Center
           tatlow@dash.enet.dec.com          (508) 490-8500

    Home:  59 Pearl Street, #3, Cambridge, MA 02139
           tom@math.mit.edu                  (617) 876-6216

==================================================================