annotate yatexadd.el @ 49:eb0512bfcb7f

Abolish user-article table. Use normal read-string instead. Supply smart add-in function for documentstyle. Update user dictionary whenever new words entered. Enhance [prefix] c. Allow user defined sectioning commands in yatexsec.
author yuuji
date Fri, 25 Nov 1994 08:26:13 +0000
parents a0640ff3f72f
children b0371b6ed799
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
1 ;;; -*- Emacs-Lisp -*-
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
2 ;;; YaTeX add-in functions.
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
3 ;;; yatexadd.el rev.9
14
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
4 ;;; (c )1991-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
5 ;;; Last modified Sat Nov 12 07:03:15 1994 on VFR
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
6 ;;; $Id$
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
7
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
8 ;;;
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
9 ;;Sample functions for LaTeX environment.
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
10 ;;;
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
11 (defvar YaTeX:tabular-default-rule
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
12 "@{\\vrule width 1pt\\ }c|c|c@{\\ \\vrule width 1pt}"
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
13 "*Your favorite default rule format."
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
14 )
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
15 (defvar YaTeX:tabular-thick-vrule "\\vrule width %s"
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
16 "*Vertical thick line format (without @{}). %s'll be replaced by its width."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
17 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
18 (defvar YaTeX:tabular-thick-hrule "\\noalign{\\hrule height %s}"
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
19 "*Horizontal thick line format. %s will be replaced by its width."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
20 )
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
21 (defun YaTeX:tabular ()
18
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
22 "YaTeX add-in function for tabular environment.
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
23 Notice that this function refers the let-variable `env' in
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
24 YaTeX-make-begin-end."
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
25 (let ((width "") bars (rule "") (and "") (j 1) loc ans (hline "\\hline"))
18
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
26 (if (string= env "tabular*")
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
27 (setq width (concat "{" (read-string "Width: ") "}")))
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
28 (setq loc (YaTeX:read-position "tb")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
29 bars (string-to-int
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
30 (read-string "Number of columns(0 for default format): " "3")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
31 (if (<= bars 0)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
32 (setq ;if 0, simple format
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
33 rule YaTeX:tabular-default-rule
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
34 and "& &")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
35 (while (< j bars) ;repeat bars-1 times
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
36 (setq rule (concat rule "c|")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
37 and (concat and "& ")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
38 j (1+ j)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
39 (setq rule (concat rule "c"))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
40 (message "(N)ormal-frame or (T)hick frame? [nt]")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
41 (setq ans (read-char))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
42 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
43 ((or (equal ans ?t) (equal ans ?T))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
44 (setq ans (read-string "Rule width: " "1pt")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
45 rule (concat
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
46 "@{" (format YaTeX:tabular-thick-vrule ans) "}"
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
47 rule
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
48 "@{\\ " (format YaTeX:tabular-thick-vrule ans) "}")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
49 hline (format YaTeX:tabular-thick-hrule ans)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
50 (t (setq rule (concat "|" rule "|")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
51 hline "\\hline"))))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
52
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
53 (setq rule (read-string "rule format: " rule))
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
54
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
55 (message "Dont forget to remove null line at the end of tabular.")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
56 (format "%s%s{%s}%s"
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
57 width loc rule
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
58 (if (and (boundp 'region-mode) region-mode)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
59 "" ;do nothing in region-mode
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
60 (format "\n%s\n%s \\\\ \\hline\n%s\n\\\\ %s"
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
61 hline and and hline))))
18
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
62 )
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
63 (fset 'YaTeX:tabular* 'YaTeX:tabular)
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
64 (defun YaTeX:array ()
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
65 (concat (YaTeX:read-position "tb")
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
66 "{" (read-string "Column format: ") "}")
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
67 )
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
68
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
69 (defun YaTeX:read-oneof (oneof)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
70 (let ((pos "") loc (guide ""))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
71 (and (boundp 'name) name (setq guide (format "%s " name)))
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
72 (while (not (string-match
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
73 (setq loc (read-key-sequence
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
74 (format "%s position (`%s') [%s]: "
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
75 guide oneof pos)));name is in YaTeX-addin
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
76 "\r\^g\n"))
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
77 (cond
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
78 ((string-match loc oneof)
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
79 (if (not (string-match loc pos))
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
80 (setq pos (concat pos loc))))
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
81 ((and (string-match loc "\C-h\C-?") (> (length pos) 0))
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
82 (setq pos (substring pos 0 (1- (length pos)))))
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
83 (t
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
84 (ding)
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
85 (message "Please input one of `%s'." oneof)
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
86 (sit-for 3))))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
87 (message "")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
88 pos)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
89 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
90
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
91 (defun YaTeX:read-position (oneof)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
92 "Read a LaTeX (optional) position format such as `[htbp]'."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
93 (let ((pos (YaTeX:read-oneof oneof)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
94 (if (string= pos "") "" (concat "[" pos "]")))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
95 )
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
96
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
97 (defun YaTeX:table ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
98 "YaTeX add-in function for table environment."
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
99 (YaTeX:read-position "htbp")
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
100 )
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
101
46
cd1b63102eed Support Mule2
yuuji
parents: 43
diff changeset
102 (fset 'YaTeX:figure 'YaTeX:table)
cd1b63102eed Support Mule2
yuuji
parents: 43
diff changeset
103 (fset 'YaTeX:figure* 'YaTeX:table)
cd1b63102eed Support Mule2
yuuji
parents: 43
diff changeset
104
cd1b63102eed Support Mule2
yuuji
parents: 43
diff changeset
105
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
106 (defun YaTeX:description ()
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
107 "Truly poor service:-)"
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
108 (setq single-command "item[]")
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
109 ""
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
110 )
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
111
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
112 (defun YaTeX:itemize ()
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
113 "It's also poor service."
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
114 (setq single-command "item")
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
115 ""
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
116 )
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
117
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
118 (fset 'YaTeX:enumerate 'YaTeX:itemize)
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
119
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
120 (defun YaTeX:picture ()
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
121 "Ask the size of coordinates of picture environment."
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
122 (concat (YaTeX:read-coordinates "Picture size")
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
123 (YaTeX:read-coordinates "Initial position"))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
124 )
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
125
12
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
126 (defun YaTeX:equation ()
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
127 (if (fboundp 'YaTeX-toggle-math-mode)
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
128 (YaTeX-toggle-math-mode t)) ;force math-mode ON.
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
129 )
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
130 (fset 'YaTeX:eqnarray 'YaTeX:equation)
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
131 (fset 'YaTeX:displaymath 'YaTeX:equation)
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
132
16
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
133 (defun YaTeX:list ()
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
134 "%\n{} %default label\n{} %formatting parameter"
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
135 )
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
136
18
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
137 (defun YaTeX:minipage ()
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
138 (concat (YaTeX:read-position "cbt")
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
139 "{" (read-string "Width: ") "}")
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
140 )
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
141
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
142 ;;;
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
143 ;;Sample functions for section-type command.
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
144 ;;;
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
145 (defun YaTeX:multiput ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
146 (concat (YaTeX:read-coordinates "Pos")
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
147 (YaTeX:read-coordinates "Step")
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
148 "{" (read-string "How many times: ") "}")
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
149 )
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
150
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
151 (defun YaTeX:put ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
152 (YaTeX:read-coordinates "Pos")
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
153 )
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
154
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
155 (defun YaTeX:makebox ()
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
156 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
157 ((YaTeX-in-environment-p "picture")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
158 (concat (YaTeX:read-coordinates "Dimension")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
159 (YaTeX:read-position "lrtb")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
160 (t
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
161 (let ((width (read-string "Width: ")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
162 (if (string< "" width)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
163 (progn
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
164 (or (equal (aref width 0) ?\[)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
165 (setq width (concat "[" width "]")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
166 (concat width (YaTeX:read-position "lr")))))))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
167 )
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
168
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
169 (defun YaTeX:framebox ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
170 (if (YaTeX-quick-in-environment-p "picture")
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
171 (YaTeX:makebox))
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
172 )
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
173
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
174 (defun YaTeX:dashbox ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
175 (concat "{" (read-string "Dash dimension: ") "}"
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
176 (YaTeX:read-coordinates "Dimension"))
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
177 )
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
178
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
179 (defun YaTeX:left ()
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
180 (let (c)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
181 (while (not (string-match
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
182 (progn (message "Which parenthesis? One of [{(|)}]: ")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
183 (setq c (regexp-quote (char-to-string (read-char)))))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
184 "[{(|)}]")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
185 (setq single-command "right")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
186 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
187 ((string-match c "[(|)]") c)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
188 (t (concat "\\" c))))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
189 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
190 (fset 'YaTeX:right 'YaTeX:left)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
191
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
192 (defun YaTeX:read-coordinates (&optional mes varX varY)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
193 (concat
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
194 "("
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
195 (read-string (format "%s %s: " (or mes "Dimension") (or varX "X")))
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
196 ","
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
197 (read-string (format "%s %s: " (or mes "Dimension") (or varY "Y")))
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
198 ")")
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
199 )
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
200
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
201 ;;;
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
202 ;;Sample functions for maketitle-type command.
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
203 ;;;
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
204 (defun YaTeX:sum ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
205 "Read range of summation."
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
206 (YaTeX:check-completion-type 'maketitle)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
207 (concat (YaTeX:read-boundary "_") (YaTeX:read-boundary "^"))
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
208 )
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
209
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
210 (fset 'YaTeX:int 'YaTeX:sum)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
211
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
212 (defun YaTeX:lim ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
213 "Insert limit notation of \\lim."
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
214 (YaTeX:check-completion-type 'maketitle)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
215 (let ((var (read-string "Variable: ")) limit)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
216 (if (string= "" var) ""
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
217 (setq limit (read-string "Limit ($ means infinity): "))
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
218 (if (string= "$" limit) (setq limit "\\infty"))
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
219 (concat "_{" var " \\rightarrow " limit "}")))
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
220 )
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
221
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
222 (defun YaTeX:gcd ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
223 "Add-in function for \\gcd(m,n)."
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
224 (YaTeX:check-completion-type 'maketitle)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
225 (YaTeX:read-coordinates "\\gcd" "(?,)" "(,?)")
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
226 )
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
227
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
228 (defun YaTeX:read-boundary (ULchar)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
229 "Read boundary usage by _ or ^. _ or ^ is indicated by argument ULchar."
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
230 (let ((bndry (read-string (concat ULchar "{???} ($ for infinity): "))))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
231 (if (string= bndry "") ""
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
232 (if (string= bndry "$") (setq bndry "\\infty"))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
233 (concat ULchar "{" bndry "}")))
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
234 )
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
235
14
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
236 (defun YaTeX:verb ()
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
237 "Enclose \\verb's contents with the same characters."
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
238 (let ((quote-char (read-string "Quoting char: " "|"))
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
239 (contents (read-string "Quoted contents: ")))
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
240 (concat quote-char contents quote-char))
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
241 )
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
242 (fset 'YaTeX:verb* 'YaTeX:verb)
14
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
243
43
ef686a35472d Change the default section-type command to footnotetext after
yuuji
parents: 23
diff changeset
244 (defun YaTeX:footnotemark ()
ef686a35472d Change the default section-type command to footnotetext after
yuuji
parents: 23
diff changeset
245 (setq section-name "footnotetext")
ef686a35472d Change the default section-type command to footnotetext after
yuuji
parents: 23
diff changeset
246 nil
ef686a35472d Change the default section-type command to footnotetext after
yuuji
parents: 23
diff changeset
247 )
ef686a35472d Change the default section-type command to footnotetext after
yuuji
parents: 23
diff changeset
248
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
249 (defun YaTeX:cite ()
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
250 (let ((comment (read-string "Comment for citation: ")))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
251 (if (string= comment "") ""
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
252 (concat "[" comment "]")))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
253 )
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
254
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
255 (defun YaTeX:bibitem ()
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
256 (let ((label (read-string "Citation label: ")))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
257 (if (string= label "") ""
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
258 (concat "[" label "]")))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
259 )
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
260
14
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
261 ;;;
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
262 ;;Subroutine
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
263 ;;;
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
264
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
265 (defun YaTeX:check-completion-type (type)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
266 "Check valid completion type."
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
267 (if (not (eq type YaTeX-current-completion-type))
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
268 (error "This should be completed with %s-type completion." type))
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
269 )
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
270
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
271
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
272 ;;;
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
273 ;;; [[Add-in functions for reading section arguments]]
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
274 ;;;
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
275 ;; All of add-in functions for reading sections arguments should
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
276 ;; take an argument ARGP that specify the argument position.
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
277 ;; If argument position is out of range, nil should be returned,
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
278 ;; else nil should NOT be returned.
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
279
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
280 ;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
281 ; Label selection
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
282 ;;
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
283 (defvar YaTeX-label-menu-other
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
284 (if YaTeX-japan "':‘¼‚̃oƒbƒtƒ@‚̃‰ƒxƒ‹\n" "':LABEL IN OTHER BUFFER.\n"))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
285 (defvar YaTeX-label-menu-repeat
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
286 (if YaTeX-japan ".:’¼‘O‚Ì\\ref‚Æ“¯‚¶\n" "/:REPEAT LAST \ref{}\n"))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
287 (defvar YaTeX-label-menu-any
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
288 (if YaTeX-japan "*:”CˆÓ‚Ì•¶Žš—ñ\n" "*:ANY STRING.\n"))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
289 (defvar YaTeX-label-buffer "*Label completions*")
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
290 (defvar YaTeX-label-guide-msg "Select label and hit RETURN.")
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
291 (defvar YaTeX-label-select-map nil
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
292 "Key map used in label selection buffer.")
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
293 (defun YaTeX::label-setup-key-map ()
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
294 (if YaTeX-label-select-map nil
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
295 (message "Setting up label selection mode map...")
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
296 (setq YaTeX-label-select-map (copy-keymap global-map))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
297 (suppress-keymap YaTeX-label-select-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
298 (substitute-all-key-definition
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
299 'previous-line 'YaTeX::label-previous YaTeX-label-select-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
300 (substitute-all-key-definition
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
301 'next-line 'YaTeX::label-next YaTeX-label-select-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
302 (define-key YaTeX-label-select-map "\C-n" 'YaTeX::label-next)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
303 (define-key YaTeX-label-select-map "\C-p" 'YaTeX::label-previous)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
304 (define-key YaTeX-label-select-map "<" 'beginning-of-buffer)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
305 (define-key YaTeX-label-select-map ">" 'end-of-buffer)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
306 (define-key YaTeX-label-select-map "\C-m" 'exit-recursive-edit)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
307 (define-key YaTeX-label-select-map "\C-j" 'exit-recursive-edit)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
308 (define-key YaTeX-label-select-map " " 'exit-recursive-edit)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
309 (define-key YaTeX-label-select-map "\C-g" 'abort-recursive-edit)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
310 (define-key YaTeX-label-select-map "/" 'isearch-forward)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
311 (define-key YaTeX-label-select-map "?" 'isearch-backward)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
312 (define-key YaTeX-label-select-map "'" 'YaTeX::label-search-tag)
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
313 (define-key YaTeX-label-select-map "." 'YaTeX::label-search-tag)
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
314 (define-key YaTeX-label-select-map "*" 'YaTeX::label-search-tag)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
315 (message "Setting up label selection mode map...Done")
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
316 (let ((key ?A))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
317 (while (<= key ?Z)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
318 (define-key YaTeX-label-select-map (char-to-string key)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
319 'YaTeX::label-search-tag)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
320 (define-key YaTeX-label-select-map (char-to-string (+ key (- ?a ?A)))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
321 'YaTeX::label-search-tag)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
322 (setq key (1+ key)))))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
323 )
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
324 (defun YaTeX::label-next ()
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
325 (interactive) (forward-line 1) (message YaTeX-label-guide-msg))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
326 (defun YaTeX::label-previous ()
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
327 (interactive) (forward-line -1) (message YaTeX-label-guide-msg))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
328 (defun YaTeX::label-search-tag ()
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
329 (interactive)
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
330 (let ((case-fold-search t) (tag (regexp-quote (this-command-keys))))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
331 (cond
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
332 ((save-excursion
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
333 (forward-char 1)
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
334 (re-search-forward (concat "^" tag) nil t))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
335 (goto-char (match-beginning 0)))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
336 ((save-excursion
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
337 (goto-char (point-min))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
338 (re-search-forward (concat "^" tag) nil t))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
339 (goto-char (match-beginning 0))))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
340 (message YaTeX-label-guide-msg))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
341 )
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
342 (defun YaTeX::ref (argp &optional labelcmd refcmd)
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
343 (cond
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
344 ((= argp 1)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
345 (save-excursion
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
346 (let ((lnum 0) e0 label label-list (buf (current-buffer))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
347 (labelcmd (or labelcmd "label")) (refcmd (or refcmd "ref"))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
348 (p (point)) initl line)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
349 (goto-char (point-min))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
350 (message "Collecting labels...")
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
351 (save-window-excursion
12
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
352 (YaTeX-showup-buffer
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
353 YaTeX-label-buffer (function (lambda (x) (window-width x))))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
354 (with-output-to-temp-buffer YaTeX-label-buffer
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
355 (while (YaTeX-re-search-active-forward
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
356 (concat "\\\\" labelcmd)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
357 (regexp-quote YaTeX-comment-prefix) nil t)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
358 (goto-char (match-beginning 0))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
359 (skip-chars-forward "^{")
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
360 (setq label
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
361 (buffer-substring
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
362 (1+ (point))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
363 (prog2 (forward-list 1) (setq e0 (1- (point)))))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
364 label-list (cons label label-list))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
365 (or initl
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
366 (if (< p (point)) (setq initl lnum)))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
367 (beginning-of-line)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
368 (skip-chars-forward " \t\n" nil)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
369 (princ (format "%c:{%s}\t<<%s>>\n" (+ (% lnum 26) ?A) label
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
370 (buffer-substring (point) (point-end-of-line))))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
371 (setq lnum (1+ lnum))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
372 (message "Collecting \\%s{}... %d" labelcmd lnum)
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
373 (goto-char e0))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
374 (princ YaTeX-label-menu-other)
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
375 (princ YaTeX-label-menu-repeat)
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
376 (princ YaTeX-label-menu-any)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
377 );with
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
378 (goto-char p)
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
379 (message "Collecting %s...Done" labelcmd)
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
380 (pop-to-buffer YaTeX-label-buffer)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
381 (YaTeX::label-setup-key-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
382 (setq truncate-lines t)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
383 (setq buffer-read-only t)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
384 (use-local-map YaTeX-label-select-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
385 (message YaTeX-label-guide-msg)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
386 (goto-line (or initl lnum)) ;goto recently defined label line
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
387 (unwind-protect
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
388 (progn
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
389 (recursive-edit)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
390 (set-buffer (get-buffer YaTeX-label-buffer)) ;assertion
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
391 (beginning-of-line)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
392 (setq line (count-lines (point-min)(point)))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
393 (cond
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
394 ((= line lnum) (setq label (YaTeX-label-other)))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
395 ((= line (1+ lnum))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
396 (save-excursion
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
397 (switch-to-buffer buf)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
398 (goto-char p)
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
399 (if (re-search-backward
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
400 (concat "\\\\" refcmd "{\\([^}]+\\)}") nil t)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
401 (setq label (YaTeX-match-string 1))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
402 (setq label ""))))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
403 ((>= line (+ lnum 2))
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
404 (setq label (read-string (format "\\%s{???}: " refcmd))))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
405 (t (setq label (nth (- lnum line 1) label-list)))))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
406 (bury-buffer YaTeX-label-buffer)))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
407 label
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
408 ))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
409 ))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
410 )
16
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
411 (fset 'YaTeX::pageref 'YaTeX::ref)
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
412 (defun YaTeX::cite (argp)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
413 (cond
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
414 ((eq argp 1)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
415 (YaTeX::ref argp "bibitem\\(\\[.*\\]\\)?" "cite"))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
416 (t nil)))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
417
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
418 (defun YaTeX-yatex-buffer-list ()
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
419 (save-excursion
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
420 (delq nil (mapcar (function (lambda (buf)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
421 (set-buffer buf)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
422 (if (eq major-mode 'yatex-mode) buf)))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
423 (buffer-list))))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
424 )
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
425
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
426 (defun YaTeX-select-other-yatex-buffer ()
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
427 "Select buffer from all yatex-mode's buffers interactivelly."
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
428 (interactive)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
429 (let ((lbuf "*YaTeX mode buffers*") (blist (YaTeX-yatex-buffer-list))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
430 (lnum -1) buf rv
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
431 (ff "**find-file**"))
12
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
432 (YaTeX-showup-buffer
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
433 lbuf (function (lambda (x) 1))) ;;Select next window surely.
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
434 (with-output-to-temp-buffer lbuf
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
435 (while blist
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
436 (princ
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
437 (format "%c:{%s}\n" (+ (% (setq lnum (1+ lnum)) 26) ?A)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
438 (buffer-name (car blist))))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
439 (setq blist (cdr blist)))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
440 (princ (format "':{%s}" ff)))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
441 (pop-to-buffer lbuf)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
442 (YaTeX::label-setup-key-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
443 (setq buffer-read-only t)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
444 (use-local-map YaTeX-label-select-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
445 (message YaTeX-label-guide-msg)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
446 (unwind-protect
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
447 (progn
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
448 (recursive-edit)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
449 (set-buffer lbuf)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
450 (beginning-of-line)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
451 (setq rv
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
452 (if (re-search-forward "{\\([^\\}]+\\)}" (point-end-of-line) t)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
453 (buffer-substring (match-beginning 1) (match-end 1)) nil)))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
454 (kill-buffer lbuf))
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
455 (if (string= rv ff)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
456 (progn
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
457 (call-interactively 'find-file)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
458 (current-buffer))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
459 rv))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
460 )
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
461
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
462 (defun YaTeX-label-other ()
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
463 (let ((rv (YaTeX-select-other-yatex-buffer)))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
464 (cond
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
465 ((null rv) "")
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
466 (t
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
467 (set-buffer rv)
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
468 (YaTeX::ref argp labelcmd refcmd)))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
469 )
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
470 )
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
471
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
472 ;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
473 ; completion for the arguments of \newcommand
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
474 ;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
475 (defun YaTeX::newcommand (&optional argp)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
476 (cond
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
477 ((= argp 1)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
478 (let ((command (read-string "Define newcommand: " "\\")))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
479 (put 'YaTeX::newcommand 'command (substring command 1))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
480 command))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
481 ((= argp 2)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
482 (let ((argc
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
483 (string-to-int (read-string "Number of arguments(Default 0): ")))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
484 (def (read-string "Definition: "))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
485 (command (get 'YaTeX::newcommand 'command)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
486 ;;!!! It's illegal to insert string in the add-in function !!!
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
487 (if (> argc 0) (insert (format "[%d]" argc)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
488 (if (and (stringp command)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
489 (string< "" command)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
490 (y-or-n-p "Update user completion table?"))
18
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
491 (cond
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
492 ((= argc 0)
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
493 (YaTeX-update-table
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
494 (list command)
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
495 'singlecmd-table 'user-singlecmd-table 'tmp-singlecmd-table))
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
496 ((= argc 1)
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
497 (YaTeX-update-table
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
498 (list command)
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
499 'section-table 'user-section-table 'tmp-section-table))
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
500 (t (YaTeX-update-table
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
501 (list command argc)
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
502 'section-table 'user-section-table 'tmp-section-table))))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
503 (message "")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
504 def ;return command name
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
505 ))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
506 (t ""))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
507 )
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
508
16
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
509 ;;
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
510 ; completion for the arguments of \pagestyle
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
511 ;;
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
512 (defun YaTeX::pagestyle (&optional argp)
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
513 "Read the pagestyle with completion."
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
514 (completing-read
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
515 "Page style: "
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
516 '(("plain") ("empty") ("headings") ("myheadings") ("normal") nil))
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
517 )
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
518 ;;
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
519 ; completion for the arguments of \pagenumbering
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
520 ;;
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
521 (defun YaTeX::pagenumbering (&optional argp)
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
522 "Read the numbering style."
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
523 (completing-read
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
524 "Page numbering style: "
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
525 '(("arabic") ("Alpha") ("alpha") ("Roman") ("roman")))
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
526 )
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
527
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
528 ;;
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
529 ; Length
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
530 ;;
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
531 (defvar YaTeX:style-parameters-default
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
532 '(("\\arraycolsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
533 ("\\arrayrulewidth")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
534 ("\\baselineskip")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
535 ("\\columnsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
536 ("\\columnseprule")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
537 ("\\doublerulesep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
538 ("\\evensidemargin")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
539 ("\\footheight")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
540 ("\\footskip")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
541 ("\\headheight")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
542 ("\\headsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
543 ("\\itemindent")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
544 ("\\itemsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
545 ("\\labelsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
546 ("\\labelwidth")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
547 ("\\leftmargin")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
548 ("\\linewidth")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
549 ("\\listparindent")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
550 ("\\marginparsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
551 ("\\marginparwidth")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
552 ("\\mathindent")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
553 ("\\oddsidemargin")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
554 ("\\parindent")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
555 ("\\parsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
556 ("\\parskip")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
557 ("\\partopsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
558 ("\\rightmargin")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
559 ("\\tabcolsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
560 ("\\textheight")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
561 ("\\textwidth")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
562 ("\\topmargin")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
563 ("\\topsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
564 ("\\topskip")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
565 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
566 "Alist of LaTeX style parameters.")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
567 (defvar YaTeX:style-parameters-private nil
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
568 "*User definable alist of style parameters.")
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
569 (defvar YaTeX:style-parameters-local nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
570 "*User definable alist of local style parameters.")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
571
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
572 (defvar YaTeX:length-history nil "Holds history of length.")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
573 (defun YaTeX::setlength (&optional argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
574 "YaTeX add-in function for arguments of \\setlength."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
575 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
576 ((equal 1 argp)
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
577 ;;(completing-read "Length variable: " YaTeX:style-parameters nil nil "\\")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
578 (YaTeX-cplread-with-learning
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
579 "Length variable: "
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
580 'YaTeX:style-parameters-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
581 'YaTeX:style-parameters-private
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
582 'YaTeX:style-parameters-local
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
583 nil nil "\\")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
584 )
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
585 ((equal 2 argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
586 (let ((minibuffer-history-symbol 'YaTeX:length-history))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
587 (read-string "Length: "))))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
588 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
589 (fset 'YaTeX::addtolength 'YaTeX::setlength)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
590
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
591 (defun YaTeX::settowidth (&optional argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
592 "YaTeX add-in function for arguments of \\settowidth."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
593 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
594 ((equal 1 argp)
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
595 (YaTeX-cplread-with-learning
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
596 "Length variable: "
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
597 'YaTeX:style-parameters-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
598 'YaTeX:style-parameters-private
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
599 'YaTeX:style-parameters-local
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
600 nil nil "\\"))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
601 ((equal 2 argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
602 (read-string "Text: ")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
603 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
604 (defun YaTeX::newlength (&optional argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
605 "YaTeX add-in function for arguments of \\newlength"
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
606 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
607 ((equal argp 1)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
608 (let ((length (read-string "Length variable: " "\\")))
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
609 (if (string< "" length)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
610 (YaTeX-update-table
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
611 (list length)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
612 'YaTeX:style-parameters-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
613 'YaTeX:style-parameters-private
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
614 'YaTeX:style-parameters-local))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
615 length)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
616 ))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
617 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
618
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
619 ;; \multicolumn's arguments
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
620 (defun YaTeX::multicolumn (&optional argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
621 "YaTeX add-in function for arguments of \\multicolumn."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
622 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
623 ((equal 1 argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
624 (read-string "Number of columns: "))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
625 ((equal 2 argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
626 (let (c)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
627 (while (not (string-match
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
628 (progn (message "Format(one of l,r,c): ")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
629 (setq c (char-to-string (read-char))))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
630 "lrc")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
631 c))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
632 ((equal 3 argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
633 (read-string "Item: ")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
634 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
635
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
636 (defvar YaTeX:documentstyles-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
637 '(("article") ("jarticle") ("j-article")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
638 ("book") ("jbook") ("j-book")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
639 ("report") ("jreport") ("j-report")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
640 ("letter") ("ascjletter"))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
641 "List of LaTeX documentstyles.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
642 (defvar YaTeX:documentstyles-private nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
643 "*User defined list of LaTeX documentstyles.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
644 (defvar YaTeX:documentstyles-local nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
645 "*User defined list of local LaTeX documentstyles.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
646 (defvar YaTeX:documentstyle-options-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
647 '(("a4j") ("a5j") ("b4j") ("b5j")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
648 ("twocolumn") ("jtwocolumn") ("epsf") ("epsfig") ("epsbox") ("nfig"))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
649 "List of LaTeX documentstyle options.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
650 (defvar YaTeX:documentstyle-options-private nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
651 "*User defined list of LaTeX documentstyle options.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
652 (defvar YaTeX:documentstyle-options-local nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
653 "List of LaTeX local documentstyle options.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
654
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
655 (defvar YaTeX-minibuffer-completion-map nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
656 "Minibuffer completion key map that allows comma completion.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
657 (if YaTeX-minibuffer-completion-map nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
658 (setq YaTeX-minibuffer-completion-map
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
659 (copy-keymap minibuffer-local-completion-map))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
660 (define-key YaTeX-minibuffer-completion-map " "
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
661 'YaTeX-minibuffer-complete)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
662 (define-key YaTeX-minibuffer-completion-map "\t"
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
663 'YaTeX-minibuffer-complete))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
664
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
665 (defun YaTeX:documentstyle ()
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
666 (let*((delim ",")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
667 (dt (append YaTeX:documentstyle-options-local
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
668 YaTeX:documentstyle-options-private
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
669 YaTeX:documentstyle-options-default))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
670 (minibuffer-completion-table dt)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
671 (opt (read-from-minibuffer
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
672 "Style options ([opt1,opt2,...]): "
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
673 nil YaTeX-minibuffer-completion-map))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
674 (substr opt) o)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
675 (if (string< "" opt)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
676 (progn
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
677 (while substr
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
678 (setq o (substring substr 0 (string-match delim substr)))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
679 (or (assoc o dt)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
680 (YaTeX-update-table
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
681 (list o)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
682 'YaTeX:documentstyle-options-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
683 'YaTeX:documentstyle-options-private
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
684 'YaTeX:documentstyle-options-local))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
685 (setq substr
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
686 (if (string-match delim substr)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
687 (substring substr (1+ (string-match delim substr))))))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
688 (concat "[" opt "]"))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
689 "")))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
690
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
691 (defun YaTeX::documentstyle (&optional argp)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
692 "YaTeX add-in function for arguments of \\socumentstyle."
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
693 (cond
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
694 ((equal argp 1)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
695 (let ((sname
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
696 (YaTeX-cplread-with-learning
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
697 (format "Documentstyle (default %s): "
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
698 YaTeX-default-document-style)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
699 'YaTeX:documentstyles-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
700 'YaTeX:documentstyles-private
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
701 'YaTeX:documentstyles-local)))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
702 (if (string= "" sname) (setq sname YaTeX-default-document-style))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
703 (setq YaTeX-default-document-style sname))))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
704 )
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
705
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
706 ;;; -------------------- End of yatexadd --------------------
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
707 (provide 'yatexadd)

yatex.org