Xref: utzoo comp.text.tex:3119 gnu.emacs:4004 Path: utzoo!attcan!uunet!wuarchive!cs.utexas.edu!ut-emx!myers From: myers@ut-emx.uucp (Eric Myers) Newsgroups: comp.text.tex,gnu.emacs Subject: Re: Altarnative to standard TeX-mode in GNUemacs? Message-ID: <37703@ut-emx.uucp> Date: 27 Sep 90 15:36:23 GMT References: Followup-To: comp.text.tex Distribution: comp Organization: Center for Relativity, University of Texas Lines: 72 In article 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