home *** CD-ROM | disk | FTP | other *** search
/ Mega CD-ROM 1 / megacd_rom_1.zip / megacd_rom_1 / FREEMACS / FORTEX.ZIP / TEX.MIN (.txt) < prev   
LaTeX Document  |  1990-03-27  |  17KB  |  489 lines

  1. [*]#(F:save-all-libs)[*]
  2. -------------------------------------------------------------------------------
  3. Press C-c C-c (= M:done-editing) to install,
  4. then answer 'y' to write the changes to disk.
  5. -------------------------------------------------------------------------------
  6. Name:Tfilename
  7. [*]tex[*]
  8. Name:T-TeX-mode-description
  9. tex.min - major mode for editing TeX and LaTeX with Freemacs.
  10. Copyright (C) 1989, 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  11.     TeX mode is free software; you can redistribute it and/or modify
  12.     it under the terms of the GNU General Public License as published by
  13.     the Free Software Foundation; either version 1, or (at your option)
  14.     any later version.
  15.     TeX mode is distributed in the hope that it will be useful,
  16.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.     GNU General Public License for more details.
  19.     You should have received a copy of the GNU General Public License
  20.     along with TeX mode; if not, write to the Free Software
  21.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. -------------------------------------------------------------------------------
  23. This should really become a TeXinfo file, but nobody has volunteered
  24. to code TeXinfo-format-buffer in MINT yet. (Someday the Free Software
  25. Foundation might release the 'makeinfo' program.)
  26. -------------------------------------------------------------------------------
  27. Major mode for editing files of input for LaTeX or plain TeX
  28. ============================================================
  29. Here we should write down some more documentation ....
  30. If you have to debug a complicated formula, picture or table in a large
  31. document the function TeX-region (bound to C-c C-r by default) is very
  32. useful.  It simply passes the region between point and mark to TeX or
  33. LaTeX.  If you have some macros which are needed for this formatting this
  34. region, you can include them by placing them between "%**start of header"
  35. and "%**end of header" in plain mode.  In LaTeX mode the "preamble" is
  36. included by default.  If there is no such header, you can include macros by
  37. using TeX-macros-region or TeX-edit-macros.
  38. Possible improvements: (PROBABLY in the next release, no promises)
  39.   * include LaTeX preamble from driver file which normally includes
  40.     the current file.
  41.   * parse TeX error messages in the .log file like make does.
  42. -------------------------------------------------------------------------------
  43. Credits:
  44.    TeX mode was derived from code provided by
  45.    Michael Hirsch <mhirsch@garnet.berkeley.edu>
  46.    Tim Hoverd <logcam!timh@uunet.UU.NET>
  47.    much inspiration came from the GNU Emacs TeX mode.
  48. -------------------------------------------------------------------------------
  49. Functions: (invoked by M-x fun-name)
  50. ------------------------------------
  51.   * TeX-mode, tex-mode
  52.     Switch to TeX-mode.
  53.   * TeX-help
  54.     Give some help.
  55.   * plain-mode
  56.     Toggle plain TeX mode mode (TeX mode defaults to LaTeX mode).
  57.   * german-mode
  58.     Toggle german mode (TeX mode defaults to english).
  59.   * TeX-flash-$
  60.     Flash the nearest $ no farther away than the current paragraph.
  61.   * TeX-insert-quote
  62.     Attempts to deduce whether point is at the beginning of a word
  63.     or the end, and inserts either `` or '' as appropriate.
  64.   * TeX-insert-braces
  65.     Embrace point. If a numerical argument is given to this or the
  66.     following four functions, the corresponding number of words before
  67.     or after point are enclosed.
  68.   * TeX-quote
  69.     Quote point.
  70.   * TeX-dollar
  71.     Put $'s around point.
  72.   * TeX-emphasize
  73.     Emphasize point.
  74.   * TeX-index-entry
  75.     Create an index entry for the word under point.
  76.   * TeX-close-LaTeX-environment
  77.     If the current line has a \begin{} structure on it,
  78.     insert the appropriate \end{} structure and indent.
  79.   * TeX-macros-region
  80.     Read macros to be included by (TeX-region) from the
  81.     current region.
  82.   * TeX-edit-macros
  83.     Create a buffer in other window to edit the macros
  84.     for the default header included by (TeX-region).
  85.     Exit with C-c C-c (TTeX-edit-macros-note-changes)
  86.   * TeX-region
  87.     Run TeX on the current region.
  88.   * TeX-buffer
  89.     Run TeX on the current buffer.
  90.   * TeX-preview
  91.     Use the TeX previewer to view the compiled file.
  92.   * TeX-print
  93.     Use the TeX dvi-to-paper converter to print the file.
  94.   * TeX-version
  95.     Echo the current RCS Header of the MINT file.
  96. Locally redefined keys:
  97. -----------------------
  98.   * $        (TeX-flash-$)
  99.   * C-c $    (TeX-dollar)
  100.   * {        (TeX-insert-braces)
  101.   * M-{        (TeX-emphasize)
  102.   * M-"        (TeX-insert-quote)
  103.   * C-c "    (TeX-quote)
  104.   * C-c i    (TeX-index-entry)
  105.   * C-c C-f    (TeX-close-LaTeX-environment)
  106.   * C-c C-h    (TeX-help)
  107.   * C-c C-b    (TeX-buffer)
  108.   * C-c C-r    (TeX-region)
  109.   * C-c C-v    (TeX-preview)
  110.   * C-c C-p    (TeX-print)
  111.   * C-c v    (TeX-version)
  112. Configuration variables:
  113. ------------------------
  114.   * T-TeX-environment-indent
  115.     Amount of indentation in environments.
  116.     Default: 4
  117.   * T-TeX-macros
  118.     Macros to be included by TeX-region.
  119.   * T-TeX-command
  120.     The command used to run TeX.
  121.     Default: latex
  122.   * T-TeX-dvi-preview-command
  123.     Command to call dvi-previewer.
  124.     Default: v
  125.   * T-TeX-dvi-print-command
  126.     Command to call dvi-to-paper converter.
  127.     Default: dvielq
  128.   * T-TeX-zap-file
  129.     Temporary file name used for text being sent as input to TeX.
  130.     (Should be a simple file name with no extension or directory
  131.     specification.)
  132.   * T-TeX-directory
  133.     The directory to store temporary files in.
  134.   * T-TeX-startup-message
  135.     Set to nil to inhibit message first time TeX mode is used.
  136. -------------------------------------------------------------------------------
  137. If you find bugs or miss a feature, please feel free to contact the
  138. author: Thorsten Ohl, td12@ddagsi3.bitnet.  (If you're not on the net:
  139. Jahnstrasse 80, 6100 Darmstadt, F.R.G.)
  140. I can make no promises, but if you notify me of a bug, chances are much
  141. better that it will be fixed in a future release. Please quote always the
  142. version of TeX mode you're working with. (Use C-c v if you're in TeX mode
  143. or see below.)
  144. -------------------------------------------------------------------------------
  145. Revision information:
  146.     $Source: c:/emacs/RCS/tex.m'v $
  147.     $Revision: 1.1 $
  148.     $Date: 90/03/27 19:22:05 $
  149.     $Author: tho $
  150. [*]dummy[*]
  151. Name:T-TeX-startup-message
  152. Set to nil to inhibit message first time TeX-mode is used.
  153. [*](major mode for editing TeX and LaTeX with Freemacs.
  154. Copyright (C) 1989, 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  155. use `C-c C-h' for quick help and `F1 m' for detailed information.
  156. Name:T-RCS-Id
  157. [*]$Header: c:/emacs/RCS/tex.m'v 1.1 90/03/27 19:22:05 tho Rel $[*]
  158. -------------------------------------------------------------------------------
  159. setting things up:
  160. -------------------------------------------------------------------------------
  161. Name:F:TeX-mode
  162. Switch to TeX-mode, i.e. enable TeX-specific extensions.
  163. #(Fexit-mode)
  164. #(n?,Tfilename,,(
  165.         #(Fload-lib,tex)
  166. ))#(T!TeX-mode)
  167. Name:T!TeX-mode
  168. Meaty part of F:TeX-mode.
  169. #(Flocal-bind-key,K.$,T:TeX-flash-$)
  170. #(Flocal-bind-key,K.M-",T:TeX-insert-quote)
  171. #(Flocal-bind-key,K.{,T:TeX-insert-braces)
  172. #(Flocal-bind-key,K.M-{,T:TeX-emphasize)
  173. #(Flocal-bind-key,K.C-c C-f,T:TeX-close-LaTeX-environment)
  174. #(Flocal-bind-key,K.C-c C-b,T:TeX-buffer)
  175. #(Flocal-bind-key,K.C-c C-r,T:TeX-region)
  176. #(Flocal-bind-key,K.C-c C-v,T:TeX-preview)
  177. #(Flocal-bind-key,K.C-c C-p,T:TeX-print)
  178. #(Flocal-bind-key,K.C-c ",T:TeX-quote)
  179. #(Flocal-bind-key,K.C-c $,T:TeX-dollar)
  180. #(Flocal-bind-key,K.C-c i,T:TeX-index-entry)
  181. #(Flocal-bind-key,K.C-c v,T:TeX-version)
  182. #(Flocal-bind-key,K.C-c C-h,T:TeX-help)
  183. #(Flocal-bind-key,F-left-comment,% )
  184. #(Flocal-bind-key,F-prefix-comment,% )
  185. #(Flocal-bind-key,F-right-comment,)
  186. #(Fset-modename,TeX)
  187. #(ds,syntax,##(Fsyntax))
  188. #(Fmodify-syntax,syntax,##(bc,\),1)
  189. #(Fmodify-syntax,syntax,##(bc,@),1)
  190. #(Fmodify-syntax,syntax,##(bc,"),1)
  191. #(st,syntax)
  192. #(Fenter-minor-mode,Fill)
  193. Name:F:tex-mode
  194. Synonym for TeX-mode.
  195. [*]#(F:TeX-mode)[*]
  196. ----------------------------------------------------------------------
  197. macro packages and language dependend stuff:
  198. ----------------------------------------------------------------------
  199. Name:T-TeX-left-quote
  200. [*]#(Fin-minor-mode,german,("`),(``))[*]
  201. Name:T-TeX-right-quote
  202. [*]#(Fin-minor-mode,german,("'),(''))[*]
  203. Name:T-TeX-start-of-header
  204. [*]#(Fin-minor-mode,plain,(%**start of header),(\documentstyle))[*]
  205. Name:T-TeX-end-of-header
  206. [*]#(Fin-minor-mode,plain,(%**end of header),(\begin{document}))[*]
  207. Name:T-TeX-macros
  208. [*][*]
  209. Name:T:TeX-edit-macros
  210. Create a buffer in other window to edit the macros for the default header.
  211. #(F:split-window-vertically)
  212. #(Ffind-or-make-buffer,*TeX-macros*)
  213. #(Flocal-bind-key,K.C-c C-c,TTeX-edit-macros-note-changes)
  214. #(sv,bl,23)
  215. #(sv,tl,15)
  216. #(is,##(T-TeX-macros)(
  217. #(sp,[)
  218. #(an,To install changes(,) type C-c C-c)
  219. Name:TTeX-edit-macros-note-changes
  220. [*]#(sp,[)
  221. #(ds,T-TeX-macros,##(rm,]))
  222. #(F:delete-window)
  223. Name:T:TeX-macros-region
  224. Read macros from region.
  225. [*]#(ds,T-TeX-macros,##(rm,#(Fmark)))[*]
  226. Name:T-TeX-default-header
  227. If no header can be found, use this one.
  228. [*]#(Fin-minor-mode,plain,,((
  229. \documentstyle[12pt)
  230. #(Fin-minor-mode,german,((,)dina4(,)german))
  231. (]{article}
  232. )))##(T-TeX-macros)(
  233. )#(Fin-minor-mode,plain,,((\begin{document}
  234. )))[*]
  235. Name:T-TeX-trailer
  236. [*]#(Fin-minor-mode,plain,((
  237. )),((
  238. \end{document}
  239. )))[*]
  240. Name:T:plain-mode
  241. Toggle plain mode.
  242. [*]#(Fset-minor-mode,plain)[*]
  243. Name:T:german-mode
  244. Toggle german mode.
  245. [*]#(Fset-minor-mode,german)[*]
  246. Name:T&setup
  247. Display startup message.
  248. [*]#(==,##(T-TeX-startup-message),,,(
  249.     #(xy,0,0)
  250.     #(ow,#(T-TeX-startup-message))
  251.     #(Fmode-line)
  252.     #(Fhit-any-key)
  253. ))[*]
  254. -------------------------------------------------------------------------------
  255. give help:
  256. -------------------------------------------------------------------------------
  257. Name:T-TeX-help-screen
  258. [*](Special keys in the TeX mode:
  259. ------------------------------------------------
  260. insert double quotes:            M-"
  261. insert pair of braces:            {
  262. emphasize point/word:            M-{
  263. quote point/words:            C-c "
  264. put point/words in math-mode:        C-c $
  265. create index entry:            C-c i
  266. close LaTeX environment:        C-c C-f
  267. run (La)TeX on buffer:            C-c C-b
  268. run (La)TeX on region:            C-c C-r
  269. preview dvi file:            C-c C-v
  270. print dvi file:                C-c C-p
  271. help (this screen):            C-c C-h
  272. describe TeX mode:            F1 m
  273. show revision of TeX mode:        C-c v
  274. Name:T:TeX-help
  275. Give some help.
  276. [*]#(ow,#(T-TeX-help-screen))
  277. #(Fmore)
  278. Name:T:TeX-version
  279. Echo the current RCS Header of the MINT file.
  280. [*]#(an,#(T-RCS-Id))[*]
  281. ----------------------------------------------------------------------
  282. save typing:
  283. ----------------------------------------------------------------------
  284. Name:Tembrace
  285. If no ARG3 is void, insert ARG1 and ARG2 and plac point between them.
  286. If ARG3 is non void, place ARG1 and ARG2 around the number of words
  287. given by this argument. (Positive: backward, Negative: forward)
  288. [*]#(==,(arg3),,(
  289.         #(is,arg1)
  290.         #(pm,1)#(sm,0,<)
  291.         #(is,arg2)
  292.         #(F:backward-word,(arg3))
  293.         #(is,#(Fsignum,(arg3),(arg1),(arg2)))
  294.         #(F:forward-word,(arg3))
  295.         #(pm,1)#(sm,0,<)
  296.         #(is,#(Fsignum,(arg3),(arg2),(arg1)))
  297. #(sp,0>)#(pm)[*]
  298. Name:T:TeX-insert-braces
  299. Embrace point.
  300. #(Tembrace,{,},(arg1))
  301. Name:T:TeX-emphasize
  302. Emphasize point.
  303. #(Tembrace,{\em ,\/},(arg1))
  304. Name:T:TeX-quote
  305. Quote point.
  306. #(Tembrace,##(T-TeX-left-quote),##(T-TeX-right-quote),(arg1))
  307. Name:T:TeX-dollar
  308. Put $'s around point.
  309. #(Tembrace,$,$,(arg1))
  310. Name:T:TeX-insert-quote
  311. Attempts to deduce whether the point is at the beginning of a word or the
  312. end, and inserts either `` or '' as appropriate.
  313. The following feature has been removed: [tho] Mon Nov 06 23:34:29 1989
  314. If the point is at the right of a backslash, a double quote is inserted.
  315. #(Fcase,#(rm,<),
  316.     ( ,(#(is,#(T-TeX-left-quote)))),
  317.     (,(#(is,#(T-TeX-left-quote)))),
  318.     (#(is,#(T-TeX-right-quote)))
  319. Name:T-TeX-environment-indent
  320. Amount of indentation in environments.
  321. [*]4[*]
  322. Name:T:TeX-close-LaTeX-environment
  323. The current line has a \begin{} structure on it.  Insert the appropriate
  324. \end structure and indent.
  325. [*]#(pm,4)
  326. #(lp,\\begin[ (    )]*{,,R)
  327. #(l?,$,^,1,2,(
  328.         #(sp,2)
  329.         #(lp,})#(l?,.,$,,3)
  330.             #(sp,3<)#(sm,3)
  331.         #(sp,2)
  332.             #(ds,temp,#(rm,3))
  333.         #(sp,1)
  334.             #(ds,white,#(lv,cs))
  335.         #(sp,$)
  336.             #(Fcrlf)#(Fcrlf)
  337.             #(Fpad-to-column,#(white))#(is,\end{#(temp)})
  338.         #(sp,^<)
  339.             #(Fpad-to-column,#(++,#(white),
  340.                     #(T-TeX-environment-indent)))
  341.             #(Ttemplates,#(temp))
  342.         #(an,Can't find \begin{environment} on this line!)
  343. #(pm)
  344. Name:Ttemplates
  345. Insert template for LaTeX environment.
  346. [*]#(ds,temp,(arg1))
  347. #(Fcase,#(temp),
  348.     (array,        (#(Tarray))),
  349.     (description,    (#(is,\item ))),
  350.     (enumerate,    (#(is,\item ))),
  351.     (eqnarray,    (#(Tarray))),
  352.     (eqnarray*,    (#(Tarray))),
  353.     (figure,    (#(Tcaption))),
  354.     (())
  355. #(Fcase,#(temp),
  356.     (itemize,    (#(is,\item ))),
  357.     (list,        (#(is,\item ))),
  358.     (table,        (#(Tcaption))),
  359.     (tabular,    (#(Tarray))),
  360.     (trivlist,    (#(is,\item ))),
  361.     (())
  362. Name:Tarray
  363. [*]#(pm,1)
  364. #(sm,0,<)
  365. #(is,&  &  \\)
  366. #(F:newline-and-indent)
  367. #(is,&  &)
  368. #(sp,0)
  369. #(pm)
  370. Name:Tcaption
  371. #(F:newline-and-indent)
  372. #(is,\caption{})
  373. #(sp,<)
  374. Name:T:TeX-flash-$
  375. Flash the nearest $ no farther away than the current paragraph.
  376. #(an)
  377. #(pm,3)
  378. #(sm,0,<)
  379. #(is,$)
  380. #(lp,(
  381. #(l?,.,[,,2,,(
  382.     #(sm,2,[)
  383. #(lp,$)
  384. #(l?,0,2,0,,(
  385.     #(sp,0)
  386.     #(rd)
  387.     #(n?,kbd-buffer,,(
  388.         #(ds,temp,#(it,100))
  389.         #(==,##(temp),Timeout,,(
  390.             #(Fkbd-in,##(temp))
  391.     #(sp,1)
  392.     #(an,Can't find a $ in this paragraph)))
  393. #(pm)
  394. Name:T:TeX-index-entry
  395. Create an index entry for the word under point.
  396. #(F:backward-word,(arg1))
  397. #(pm,1)
  398. #(F:forward-word,(arg1))
  399. #(ds,index-entry,##(rm,0))
  400. #(F:kill-whitespace)
  401. #(is,(
  402. )\index{)
  403. #(sm,0,<)#(is,##(index-entry)}(
  404. ))#(es,index-entry)
  405. #(sp,0>)#(pm)[*]
  406. ----------------------------------------------------------------------
  407. invocation of TeX and previewer:
  408. ----------------------------------------------------------------------
  409. Name:T-TeX-command
  410. The command used to run TeX.
  411. Depends on appropiate batch file.
  412. [*]#(Fin-minor-mode,plain,,La)TeX#(Fin-minor-mode,german,,e)[*]
  413. Name:T-TeX-directory
  414. The directory to store temporary files.
  415. [*]#(env.TMP)\[*]
  416. Name:T-TeX-zap-file
  417. Temporary file name used for text being sent as input to TeX.
  418. Should be a simple file name with no extension or directory specification.
  419. [*]$-TeX-$[*]
  420. Name:T-TeX-dvi-preview-command
  421. Command to call dvi-previewer.
  422. Depends on appropiate batch file.
  423. [*]v[*]
  424. Name:T-TeX-dvi-print-command
  425. Command to call dvi-to-paper converter.
  426. Depends on appropiate batch file.
  427. [*]dvielq[*]
  428. Name:TTeX-header
  429. Return the header for running TeX on region.
  430. [*]#(pm,3)#(sm,0)
  431. #(lp,#(T-TeX-start-of-header))
  432. #(l?,[,],1,,(
  433.         #(sp,1^)#(sm,1)
  434.         #(lp,#(T-TeX-end-of-header))
  435.         #(l?,.,],,2,(
  436.                 #(sp,2$)
  437.                 ##(rm,1)
  438.             ),(
  439.                 #(T-TeX-default-header)
  440.             ))
  441.         #(T-TeX-default-header)
  442. #(sp,0)#(pm)
  443. Name:T:TeX-region
  444. Run TeX on the current region.
  445. [*]#(Fremember-buffer)
  446. #(ds,source-modes,#(minor-modes.##(ba,-1)))
  447. #(ds,header,#(TTeX-header))
  448. #(ds,region,##(rm,#(Fmark)))
  449. #(ds,trailer,#(T-TeX-trailer))
  450. #(Ffind-or-make-buffer,*TeX-scratch*)
  451. #(F:TeX-mode)#(ds,minor-modes.##(ba,-1),#(source-modes))
  452. #(is,(
  453. )##(header)(
  454. )##(region)(
  455. )##(trailer)(
  456. #(es,header)#(es,region)#(es,trailer)
  457. #(T:TeX-buffer)
  458. #(Fswitch-to-buffer,#(Frecall-buffer))
  459. Name:T:TeX-buffer
  460. Run TeX on the current buffer.
  461. Using some half understood code from F:make to show .log-file in other window.
  462. [*]#(pm,1)#(sm,0)
  463. #(sp,[)
  464. #(wf,#(T-TeX-directory)##(T-TeX-zap-file).tex,])
  465. #(ds,temp,#(lv,cd))#(sv,cd,#(T-TeX-directory))
  466. #(ex,#(env.COMSPEC),#(env.SWITCHAR)C #(T-TeX-command) ##(T-TeX-zap-file))
  467. #(sv,cd,#(temp))
  468. #(Ffind-or-make-buffer,*TeX-log*)
  469. #(rf,#(T-TeX-directory)##(T-TeX-zap-file).log)
  470. #(ds,k,##(gs,Fredisplay-two))
  471. #(sv,ow,##(ba,-1))
  472. #(sp,[)
  473. #(Fmode-line)
  474. #(..,##(ba,##(old-buffer)))
  475. #(Fenter-local-modes)
  476. #(sp,0)
  477. #(pm)
  478. Name:T:TeX-preview
  479. Use the TeX previewer to view the compiled file.
  480. [*]#(ex,#(env.COMSPEC),#(env.SWITCHAR)C
  481.     #(T-TeX-dvi-preview-command) #(T-TeX-directory)##(T-TeX-zap-file))
  482. Name:T:TeX-print
  483. Use the TeX dvi-to-paper converter print the compiled file.
  484. [*]#(ex,#(env.COMSPEC),#(env.SWITCHAR)C
  485.     #(T-TeX-dvi-print-command) #(T-TeX-directory)##(T-TeX-zap-file))
  486. ----------------------------------------------------------------------
  487. that's it.
  488. ----------------------------------------------------------------------
  489.