[*]#(F:save-all-libs)[*] ------------------------------------------------------------------------------- Press C-c C-c (= M:done-editing) to install, then answer 'y' to write the changes to disk. ------------------------------------------------------------------------------- Name:Tfilename [*]tex[*] Name:T-TeX-mode-description tex.min - major mode for editing TeX and LaTeX with Freemacs. Copyright (C) 1989, 1990 by Thorsten Ohl, td12@ddagsi3.bitnet TeX mode is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. TeX mode is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with TeX mode; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ------------------------------------------------------------------------------- This should really become a TeXinfo file, but nobody has volunteered to code TeXinfo-format-buffer in MINT yet. (Someday the Free Software Foundation might release the 'makeinfo' program.) ------------------------------------------------------------------------------- Major mode for editing files of input for LaTeX or plain TeX ============================================================ Here we should write down some more documentation .... If you have to debug a complicated formula, picture or table in a large document the function TeX-region (bound to C-c C-r by default) is very useful. It simply passes the region between point and mark to TeX or LaTeX. If you have some macros which are needed for this formatting this region, you can include them by placing them between "%**start of header" and "%**end of header" in plain mode. In LaTeX mode the "preamble" is included by default. If there is no such header, you can include macros by using TeX-macros-region or TeX-edit-macros. Possible improvements: (PROBABLY in the next release, no promises) * include LaTeX preamble from driver file which normally includes the current file. * parse TeX error messages in the .log file like make does. ------------------------------------------------------------------------------- Credits: TeX mode was derived from code provided by Michael Hirsch Tim Hoverd much inspiration came from the GNU Emacs TeX mode. ------------------------------------------------------------------------------- Functions: (invoked by M-x fun-name) ------------------------------------ * TeX-mode, tex-mode Switch to TeX-mode. * TeX-help Give some help. * plain-mode Toggle plain TeX mode mode (TeX mode defaults to LaTeX mode). * german-mode Toggle german mode (TeX mode defaults to english). * TeX-flash-$ Flash the nearest $ no farther away than the current paragraph. * TeX-insert-quote Attempts to deduce whether point is at the beginning of a word or the end, and inserts either `` or '' as appropriate. * TeX-insert-braces Embrace point. If a numerical argument is given to this or the following four functions, the corresponding number of words before or after point are enclosed. * TeX-quote Quote point. * TeX-dollar Put $'s around point. * TeX-emphasize Emphasize point. * TeX-index-entry Create an index entry for the word under point. * TeX-close-LaTeX-environment If the current line has a \begin{} structure on it, insert the appropriate \end{} structure and indent. * TeX-macros-region Read macros to be included by (TeX-region) from the current region. * TeX-edit-macros Create a buffer in other window to edit the macros for the default header included by (TeX-region). Exit with C-c C-c (TTeX-edit-macros-note-changes) * TeX-region Run TeX on the current region. * TeX-buffer Run TeX on the current buffer. * TeX-preview Use the TeX previewer to view the compiled file. * TeX-print Use the TeX dvi-to-paper converter to print the file. * TeX-version Echo the current RCS Header of the MINT file. Locally redefined keys: ----------------------- * $ (TeX-flash-$) * C-c $ (TeX-dollar) * { (TeX-insert-braces) * M-{ (TeX-emphasize) * M-" (TeX-insert-quote) * C-c " (TeX-quote) * C-c i (TeX-index-entry) * C-c C-f (TeX-close-LaTeX-environment) * C-c C-h (TeX-help) * C-c C-b (TeX-buffer) * C-c C-r (TeX-region) * C-c C-v (TeX-preview) * C-c C-p (TeX-print) * C-c v (TeX-version) Configuration variables: ------------------------ * T-TeX-environment-indent Amount of indentation in environments. Default: 4 * T-TeX-macros Macros to be included by TeX-region. * T-TeX-command The command used to run TeX. Default: latex * T-TeX-dvi-preview-command Command to call dvi-previewer. Default: v * T-TeX-dvi-print-command Command to call dvi-to-paper converter. Default: dvielq * T-TeX-zap-file Temporary file name used for text being sent as input to TeX. (Should be a simple file name with no extension or directory specification.) * T-TeX-directory The directory to store temporary files in. * T-TeX-startup-message Set to nil to inhibit message first time TeX mode is used. ------------------------------------------------------------------------------- If you find bugs or miss a feature, please feel free to contact the author: Thorsten Ohl, td12@ddagsi3.bitnet. (If you're not on the net: Jahnstrasse 80, 6100 Darmstadt, F.R.G.) I can make no promises, but if you notify me of a bug, chances are much better that it will be fixed in a future release. Please quote always the version of TeX mode you're working with. (Use C-c v if you're in TeX mode or see below.) ------------------------------------------------------------------------------- Revision information: $Source: c:/emacs/RCS/tex.m'v $ $Revision: 1.1 $ $Date: 90/03/27 19:22:05 $ $Author: tho $ [*]dummy[*] Name:T-TeX-startup-message Set to nil to inhibit message first time TeX-mode is used. [*](major mode for editing TeX and LaTeX with Freemacs. Copyright (C) 1989, 1990 by Thorsten Ohl, td12@ddagsi3.bitnet use `C-c C-h' for quick help and `F1 m' for detailed information. Name:T-RCS-Id [*]$Header: c:/emacs/RCS/tex.m'v 1.1 90/03/27 19:22:05 tho Rel $[*] ------------------------------------------------------------------------------- setting things up: ------------------------------------------------------------------------------- Name:F:TeX-mode Switch to TeX-mode, i.e. enable TeX-specific extensions. #(Fexit-mode) #(n?,Tfilename,,( #(Fload-lib,tex) ))#(T!TeX-mode) Name:T!TeX-mode Meaty part of F:TeX-mode. #(Flocal-bind-key,K.$,T:TeX-flash-$) #(Flocal-bind-key,K.M-",T:TeX-insert-quote) #(Flocal-bind-key,K.{,T:TeX-insert-braces) #(Flocal-bind-key,K.M-{,T:TeX-emphasize) #(Flocal-bind-key,K.C-c C-f,T:TeX-close-LaTeX-environment) #(Flocal-bind-key,K.C-c C-b,T:TeX-buffer) #(Flocal-bind-key,K.C-c C-r,T:TeX-region) #(Flocal-bind-key,K.C-c C-v,T:TeX-preview) #(Flocal-bind-key,K.C-c C-p,T:TeX-print) #(Flocal-bind-key,K.C-c ",T:TeX-quote) #(Flocal-bind-key,K.C-c $,T:TeX-dollar) #(Flocal-bind-key,K.C-c i,T:TeX-index-entry) #(Flocal-bind-key,K.C-c v,T:TeX-version) #(Flocal-bind-key,K.C-c C-h,T:TeX-help) #(Flocal-bind-key,F-left-comment,% ) #(Flocal-bind-key,F-prefix-comment,% ) #(Flocal-bind-key,F-right-comment,) #(Fset-modename,TeX) #(ds,syntax,##(Fsyntax)) #(Fmodify-syntax,syntax,##(bc,\),1) #(Fmodify-syntax,syntax,##(bc,@),1) #(Fmodify-syntax,syntax,##(bc,"),1) #(st,syntax) #(Fenter-minor-mode,Fill) Name:F:tex-mode Synonym for TeX-mode. [*]#(F:TeX-mode)[*] ---------------------------------------------------------------------- macro packages and language dependend stuff: ---------------------------------------------------------------------- Name:T-TeX-left-quote [*]#(Fin-minor-mode,german,("`),(``))[*] Name:T-TeX-right-quote [*]#(Fin-minor-mode,german,("'),(''))[*] Name:T-TeX-start-of-header [*]#(Fin-minor-mode,plain,(%**start of header),(\documentstyle))[*] Name:T-TeX-end-of-header [*]#(Fin-minor-mode,plain,(%**end of header),(\begin{document}))[*] Name:T-TeX-macros [*][*] Name:T:TeX-edit-macros Create a buffer in other window to edit the macros for the default header. #(F:split-window-vertically) #(Ffind-or-make-buffer,*TeX-macros*) #(Flocal-bind-key,K.C-c C-c,TTeX-edit-macros-note-changes) #(sv,bl,23) #(sv,tl,15) #(is,##(T-TeX-macros)( #(sp,[) #(an,To install changes(,) type C-c C-c) Name:TTeX-edit-macros-note-changes [*]#(sp,[) #(ds,T-TeX-macros,##(rm,])) #(F:delete-window) Name:T:TeX-macros-region Read macros from region. [*]#(ds,T-TeX-macros,##(rm,#(Fmark)))[*] Name:T-TeX-default-header If no header can be found, use this one. [*]#(Fin-minor-mode,plain,,(( \documentstyle[12pt) #(Fin-minor-mode,german,((,)dina4(,)german)) (]{article} )))##(T-TeX-macros)( )#(Fin-minor-mode,plain,,((\begin{document} )))[*] Name:T-TeX-trailer [*]#(Fin-minor-mode,plain,(( )),(( \end{document} )))[*] Name:T:plain-mode Toggle plain mode. [*]#(Fset-minor-mode,plain)[*] Name:T:german-mode Toggle german mode. [*]#(Fset-minor-mode,german)[*] Name:T&setup Display startup message. [*]#(==,##(T-TeX-startup-message),,,( #(xy,0,0) #(ow,#(T-TeX-startup-message)) #(Fmode-line) #(Fhit-any-key) ))[*] ------------------------------------------------------------------------------- give help: ------------------------------------------------------------------------------- Name:T-TeX-help-screen [*](Special keys in the TeX mode: ------------------------------------------------ insert double quotes: M-" insert pair of braces: { emphasize point/word: M-{ quote point/words: C-c " put point/words in math-mode: C-c $ create index entry: C-c i close LaTeX environment: C-c C-f run (La)TeX on buffer: C-c C-b run (La)TeX on region: C-c C-r preview dvi file: C-c C-v print dvi file: C-c C-p help (this screen): C-c C-h describe TeX mode: F1 m show revision of TeX mode: C-c v Name:T:TeX-help Give some help. [*]#(ow,#(T-TeX-help-screen)) #(Fmore) Name:T:TeX-version Echo the current RCS Header of the MINT file. [*]#(an,#(T-RCS-Id))[*] ---------------------------------------------------------------------- save typing: ---------------------------------------------------------------------- Name:Tembrace If no ARG3 is void, insert ARG1 and ARG2 and plac point between them. If ARG3 is non void, place ARG1 and ARG2 around the number of words given by this argument. (Positive: backward, Negative: forward) [*]#(==,(arg3),,( #(is,arg1) #(pm,1)#(sm,0,<) #(is,arg2) #(F:backward-word,(arg3)) #(is,#(Fsignum,(arg3),(arg1),(arg2))) #(F:forward-word,(arg3)) #(pm,1)#(sm,0,<) #(is,#(Fsignum,(arg3),(arg2),(arg1))) #(sp,0>)#(pm)[*] Name:T:TeX-insert-braces Embrace point. #(Tembrace,{,},(arg1)) Name:T:TeX-emphasize Emphasize point. #(Tembrace,{\em ,\/},(arg1)) Name:T:TeX-quote Quote point. #(Tembrace,##(T-TeX-left-quote),##(T-TeX-right-quote),(arg1)) Name:T:TeX-dollar Put $'s around point. #(Tembrace,$,$,(arg1)) Name:T:TeX-insert-quote Attempts to deduce whether the point is at the beginning of a word or the end, and inserts either `` or '' as appropriate. The following feature has been removed: [tho] Mon Nov 06 23:34:29 1989 If the point is at the right of a backslash, a double quote is inserted. #(Fcase,#(rm,<), ( ,(#(is,#(T-TeX-left-quote)))), (,(#(is,#(T-TeX-left-quote)))), (#(is,#(T-TeX-right-quote))) Name:T-TeX-environment-indent Amount of indentation in environments. [*]4[*] Name:T:TeX-close-LaTeX-environment The current line has a \begin{} structure on it. Insert the appropriate \end structure and indent. [*]#(pm,4) #(lp,\\begin[ ( )]*{,,R) #(l?,$,^,1,2,( #(sp,2) #(lp,})#(l?,.,$,,3) #(sp,3<)#(sm,3) #(sp,2) #(ds,temp,#(rm,3)) #(sp,1) #(ds,white,#(lv,cs)) #(sp,$) #(Fcrlf)#(Fcrlf) #(Fpad-to-column,#(white))#(is,\end{#(temp)}) #(sp,^<) #(Fpad-to-column,#(++,#(white), #(T-TeX-environment-indent))) #(Ttemplates,#(temp)) #(an,Can't find \begin{environment} on this line!) #(pm) Name:Ttemplates Insert template for LaTeX environment. [*]#(ds,temp,(arg1)) #(Fcase,#(temp), (array, (#(Tarray))), (description, (#(is,\item ))), (enumerate, (#(is,\item ))), (eqnarray, (#(Tarray))), (eqnarray*, (#(Tarray))), (figure, (#(Tcaption))), (()) #(Fcase,#(temp), (itemize, (#(is,\item ))), (list, (#(is,\item ))), (table, (#(Tcaption))), (tabular, (#(Tarray))), (trivlist, (#(is,\item ))), (()) Name:Tarray [*]#(pm,1) #(sm,0,<) #(is,& & \\) #(F:newline-and-indent) #(is,& &) #(sp,0) #(pm) Name:Tcaption #(F:newline-and-indent) #(is,\caption{}) #(sp,<) Name:T:TeX-flash-$ Flash the nearest $ no farther away than the current paragraph. #(an) #(pm,3) #(sm,0,<) #(is,$) #(lp,( #(l?,.,[,,2,,( #(sm,2,[) #(lp,$) #(l?,0,2,0,,( #(sp,0) #(rd) #(n?,kbd-buffer,,( #(ds,temp,#(it,100)) #(==,##(temp),Timeout,,( #(Fkbd-in,##(temp)) #(sp,1) #(an,Can't find a $ in this paragraph))) #(pm) Name:T:TeX-index-entry Create an index entry for the word under point. #(F:backward-word,(arg1)) #(pm,1) #(F:forward-word,(arg1)) #(ds,index-entry,##(rm,0)) #(F:kill-whitespace) #(is,( )\index{) #(sm,0,<)#(is,##(index-entry)}( ))#(es,index-entry) #(sp,0>)#(pm)[*] ---------------------------------------------------------------------- invocation of TeX and previewer: ---------------------------------------------------------------------- Name:T-TeX-command The command used to run TeX. Depends on appropiate batch file. [*]#(Fin-minor-mode,plain,,La)TeX#(Fin-minor-mode,german,,e)[*] Name:T-TeX-directory The directory to store temporary files. [*]#(env.TMP)\[*] Name:T-TeX-zap-file Temporary file name used for text being sent as input to TeX. Should be a simple file name with no extension or directory specification. [*]$-TeX-$[*] Name:T-TeX-dvi-preview-command Command to call dvi-previewer. Depends on appropiate batch file. [*]v[*] Name:T-TeX-dvi-print-command Command to call dvi-to-paper converter. Depends on appropiate batch file. [*]dvielq[*] Name:TTeX-header Return the header for running TeX on region. [*]#(pm,3)#(sm,0) #(lp,#(T-TeX-start-of-header)) #(l?,[,],1,,( #(sp,1^)#(sm,1) #(lp,#(T-TeX-end-of-header)) #(l?,.,],,2,( #(sp,2$) ##(rm,1) ),( #(T-TeX-default-header) )) #(T-TeX-default-header) #(sp,0)#(pm) Name:T:TeX-region Run TeX on the current region. [*]#(Fremember-buffer) #(ds,source-modes,#(minor-modes.##(ba,-1))) #(ds,header,#(TTeX-header)) #(ds,region,##(rm,#(Fmark))) #(ds,trailer,#(T-TeX-trailer)) #(Ffind-or-make-buffer,*TeX-scratch*) #(F:TeX-mode)#(ds,minor-modes.##(ba,-1),#(source-modes)) #(is,( )##(header)( )##(region)( )##(trailer)( #(es,header)#(es,region)#(es,trailer) #(T:TeX-buffer) #(Fswitch-to-buffer,#(Frecall-buffer)) Name:T:TeX-buffer Run TeX on the current buffer. Using some half understood code from F:make to show .log-file in other window. [*]#(pm,1)#(sm,0) #(sp,[) #(wf,#(T-TeX-directory)##(T-TeX-zap-file).tex,]) #(ds,temp,#(lv,cd))#(sv,cd,#(T-TeX-directory)) #(ex,#(env.COMSPEC),#(env.SWITCHAR)C #(T-TeX-command) ##(T-TeX-zap-file)) #(sv,cd,#(temp)) #(Ffind-or-make-buffer,*TeX-log*) #(rf,#(T-TeX-directory)##(T-TeX-zap-file).log) #(ds,k,##(gs,Fredisplay-two)) #(sv,ow,##(ba,-1)) #(sp,[) #(Fmode-line) #(..,##(ba,##(old-buffer))) #(Fenter-local-modes) #(sp,0) #(pm) Name:T:TeX-preview Use the TeX previewer to view the compiled file. [*]#(ex,#(env.COMSPEC),#(env.SWITCHAR)C #(T-TeX-dvi-preview-command) #(T-TeX-directory)##(T-TeX-zap-file)) Name:T:TeX-print Use the TeX dvi-to-paper converter print the compiled file. [*]#(ex,#(env.COMSPEC),#(env.SWITCHAR)C #(T-TeX-dvi-print-command) #(T-TeX-directory)##(T-TeX-zap-file)) ---------------------------------------------------------------------- that's it. ----------------------------------------------------------------------