yatex

view yatexadd.el @ 6:49be9ccb0b65

Temporary dictionary. Learn the number of argument(section-type completion). Override kill-emacs. Patched posted to fj.sources,fj.editor.emacs,fj.comp.texhax
author yuuji
date Mon, 22 Feb 1993 11:04:53 +0000
parents
children c746646cecf5
line source
1 ;;; -*- Emacs-Lisp -*-
2 ;;; YaTeX add in functions.
3 ;;; yatexadd.el rev.2
4 ;;; (c)1991-1993 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
5 ;;; Last modified Fri Feb 5 09:36:06 1993 on gloria
7 (provide 'yatexadd)
9 ;;;
10 ;;Sample functions for LaTeX environment.
11 ;;;
12 (defvar YaTeX:tabular-default-rule
13 "@{\\vrule width 1pt\\ }c|c|c@{\\ \\vrule width 1pt}"
14 "*Your favorite default rule format."
15 )
16 (defun YaTeX:tabular ()
17 "YaTeX add in function for tabular environment."
18 (let (bars (rule "") (j 0) loc)
19 (setq bars (string-to-int (read-string "Number of `|': ")))
20 (if (> bars 0)
21 (while (< j bars) (setq rule (concat rule "|")) (setq j (1+ j)))
22 (setq rule YaTeX:tabular-default-rule))
23 (setq rule (read-string "rule format: " rule))
25 (insert (format "{%s}" rule))
26 (message ""))
27 )
29 (defun YaTeX:table ()
30 (let ((pos ""))
31 (message "Position []:")
32 (while (not (string-match
33 (setq loc (read-key-sequence (format "Position [%s]: " pos)))
34 "\r\^g\n"))
35 (cond
36 ((string-match loc "htbp")
37 (if (not (string-match loc pos))
38 (setq pos (concat pos loc))))
39 ((and (string-match loc "\C-h\C-?") (> (length pos) 0))
40 (setq pos (substring pos 0 (1- (length pos)))))
41 (t
42 (ding)
43 (message "Please input one of `htbp'.")
44 (sit-for 3))))
45 (if (string= pos "") nil
46 (insert "[" pos "]")))
47 )
49 (defun YaTeX:description ()
50 "Truly poor service:-)"
51 (setq single-command "item[]")
52 )
54 (defun YaTeX:itemize ()
55 "It's also poor service."
56 (setq single-command "item")
57 )
59 (fset 'YaTeX:enumerate 'YaTeX:itemize)