yatex

view yatexmth.el @ 287:5921f28ef77c

Change the first lines.
author HIROSE Yuuji <yuuji@gentei.org>
date Sat, 01 Sep 2012 08:14:41 +0900
parents 922f031af983
children 1a4332ecc58b
line source
1 ;;; yatexmth.el --- YaTeX math-mode-specific functions
2 ;;;
3 ;;; (c)1993-2012 by HIROSE Yuuji [yuuji@yatex.org]
4 ;;; Last modified Sat Sep 1 08:13:08 2012 on firestorm
5 ;;; $Id$
7 ;;; Commentary:
8 ;;; [Customization guide]
9 ;;;
10 ;;; By default, you can use two completion groups in YaTeX math
11 ;;; mode, `;' for mathematical signs and `:' for greek letters. But
12 ;;; you can add other completion groups by defining the alist of
13 ;;; `prefix key' vs `completion list' into the variable
14 ;;; YaTeX-math-key-list-private. If you wish to accomplish the
15 ;;; completion as follows(prefix key is `,'):
16 ;;;
17 ;;; KEY COMPLETION
18 ;;; s \sin
19 ;;; S \arcsin
20 ;;; c \cos
21 ;;; C \arccos
22 ;;; :
23 ;;; T \arctan
24 ;;; l \log
25 ;;; hs \sinh
26 ;;;
27 ;;; Typing `s' after `,' makes `\sin', `hs' after `,' makes `\sinh'
28 ;;; and so on. First, you have to define list of key-completion
29 ;;; pairs. Variable name(YaTeX-math-funcs-list) is arbitrary.
30 ;;;
31 ;;; (setq YaTeX-math-funcs-list
32 ;;; '(("s" "sin")
33 ;;; ("S" "arcsin")
34 ;;; :
35 ;;; ("hs" "sinh")))
36 ;;;
37 ;;; Next, define the list of prefix-key vs completion list(defined
38 ;;; above) into the variable YaTeX-math-key-list-private.
39 ;;;
40 ;;; (setq YaTeX-math-key-list-private
41 ;;; '(("," . YaTeX-math-funcs-list)
42 ;;; ("'" . Other-List-if-any)))
43 ;;;
44 ;;; Put these expressions into your ~/.emacs, and you can use this
45 ;;; completion in the math-mode.
46 ;;;
47 ;;; And you can add your favorite completion sequences to the
48 ;;; default completion list invoked with `;', by defining those lists
49 ;;; into variable YaTeX-math-sign-alist-private.
51 ;;; 【イメージ補完の追加方法】
52 ;;;
53 ;;; 標準のイメージ補完では、「;」で始まる数式記号補完と、「:」で始
54 ;;; まるギリシャ文字補完が使用可能ですが、これ以外の文字で始まる補完
55 ;;; シリーズも定義することができます。例えば、「,」で始まる次のよう
56 ;;; な補完シリーズを定義する場合を考えてみます。
57 ;;;
58 ;;; 補完キー 補完結果
59 ;;; s \sin
60 ;;; S \arcsin
61 ;;; c \cos
62 ;;; C \arccos
63 ;;; :
64 ;;; T \arctan
65 ;;; l \log
66 ;;; hs \sinh
67 ;;;
68 ;;; 「,」のあとに s を押すと \sin が、hs を押すと \sinh が入力されま
69 ;;; す。このような補完リストの登録は以下のようにします(変数名は任意)。
70 ;;;
71 ;;; (setq YaTeX-math-funcs-list
72 ;;; '(("s" "sin")
73 ;;; ("S" "arcsin")
74 ;;; :
75 ;;; ("hs" "sinh")))
76 ;;;
77 ;;; さらに、「,」を押した時にイメージ補完が始まるよう次の変数に、起動キー
78 ;;; と上で定義した補完用変数の登録を行ないます。
79 ;;;
80 ;;; (setq YaTeX-math-key-list-private
81 ;;; '(("," . YaTeX-math-funcs-list)
82 ;;; ("'" . ほかに定義したいシリーズがあれば…)))
83 ;;;
84 ;;; これらを ~/.emacs に書いておけば、math-mode で自分専用のイメージ
85 ;;; 補完が利用できます。
87 ;;; Code:
88 (defvar YaTeX-jisold
89 (and (boundp 'dos-machine-type)
90 (eq dos-machine-type 'pc98)))
92 (defmacro YaTeX-setq-math-sym (sym old new)
93 (list 'setq sym (list 'if 'YaTeX-jisold old new)))
95 (YaTeX-setq-math-sym YaTeX-image-in "E" "∈")
96 (YaTeX-setq-math-sym YaTeX-image-ni "ヨ" "∋")
97 (YaTeX-setq-math-sym YaTeX-image-subset " _\n(\n ~" "⊂")
98 (YaTeX-setq-math-sym YaTeX-image-subseteq " _\n(_\n ~" "⊆")
99 (YaTeX-setq-math-sym YaTeX-image-supset "_\n )\n~" "⊃")
100 (YaTeX-setq-math-sym YaTeX-image-supseteq "_\n_)\n~" "⊇")
101 (YaTeX-setq-math-sym YaTeX-image-nabla "___\n\\\\/" "∇")
102 (YaTeX-setq-math-sym YaTeX-image-partial " -+\n+-+\n+-+" "∂")
103 (YaTeX-setq-math-sym YaTeX-image-dagger "+\n|" "†")
104 (YaTeX-setq-math-sym YaTeX-image-ddagger "+\n+\n|" "‡")
105 (YaTeX-setq-math-sym YaTeX-image-equiv "=\n ̄" "≡")
106 (YaTeX-setq-math-sym YaTeX-image-int " /\\\n \\\n\\/" "∫")
107 (YaTeX-setq-math-sym YaTeX-image-bot "|\n ̄" "⊥")
108 (YaTeX-setq-math-sym YaTeX-image-neg "イ" "¬")
109 (YaTeX-setq-math-sym YaTeX-image-flat "b" "♭")
110 (YaTeX-setq-math-sym YaTeX-image-sqrt "" "√")
111 (defvar YaTeX-image-nearrow '("__\n /|\n/" " _\n /|\n/" ))
112 (defvar YaTeX-image-nwarrow '(" __\n|\\\n \\" " _\n|\\n \"))
113 (defvar YaTeX-image-searrow '("\\\n \\|\n--`" "\\n \|\n  ̄"))
114 (defvar YaTeX-image-swarrow '(" /\n|/\n'~~" " /\n|/\n  ̄"))
117 (defvar
118 YaTeX-math-sign-alist-default
119 '(
120 ;frequently used
121 ("||" "|" ("||" "‖"))
122 ("sum" "sum" ("\\-+\n >\n/-+" "Σ"))
123 ("sigma" "sum" ("\\-+\n >\n/-+" "Σ"))
124 ("integral" "int" (" /\\\n \\\n\\/" YaTeX-image-int))
125 ("ointegral" "oint" " /\\\n(\\)\n\\/")
126 ("sqrt" "sqrt" (" __\n,/" YaTeX-image-sqrt))
127 ("root" "sqrt" (" __\n,/" YaTeX-image-sqrt))
128 ("A" "forall" "|_|\nV")
129 ("E" "exists" "-+\n-+\n-+")
130 ("!" "neg" ("--+\n |" YaTeX-image-neg))
131 ("oo" "infty" ("oo" "∞"))
132 ("\\" "backslash" ("\\" "\"))
133 ("..." "cdots" ("..." "…"))
135 ;;binary operators
136 ("+-" "pm" ("+\n-" "±"))
137 ("-+" "mp" "-\n+")
138 ("x" "times" ("x" "×"))
139 ("/" "div" (",\n-\n'" "÷"))
140 ("f" "frac" "xxx\n---\nyyy" "÷")
141 ("*" "ast" "*")
142 ("#" "star" ("_/\\_\n\\ /\n//\\\\" "★"))
143 ("o" "circ" "o")
144 ("o*" "bullet" " _\n(*)\n ~")
145 ("." "cdot" ".")
146 ("cap" "cap" "/-\\\n| |")
147 ("cup" "cup" "| |\n\\-/")
148 ("u+" "uplus" "|+|\n\\-/")
149 ("|~|" "sqcap" "|~|")
150 ("|_|" "sqcup" "|_|")
151 ("v" "vee" "v")
152 ("^" "wedge" "^")
153 ("\\\\" "setminus" "\\")
154 (")(" "wr" " )\n(")
155 ("<>" "diamond" "<>")
156 ("/\\-" "bigtriangleup" ("/\\\n~~" "△"))
157 ("-\\/" "bigtriangledown" ("__\n\\/" "▽"))
158 ("<|" "triangleleft" "<|")
159 ("|>" "triangleright" "|>")
160 ("<||" "lhd" "/|\n\\|")
161 ("||>" "rhd" "|\\\n|/")
162 ("<|-" "unlhd" "<|\n~~")
163 ("|>-" "unrhd" "|>\n~~")
164 ("o+" "oplus" " _\n(+)\n ~")
165 ("o-" "ominus" " _\n(-)\n ~")
166 ("ox" "otimes" " _\n(x)\n ~")
167 ("o/" "oslash" " _\n(/)\n ~")
168 ("o." "odot" "(.)")
169 ("O" "bigcirc" "O")
170 ("t" "dagger" ("+\n|" YaTeX-image-dagger))
171 ("tt" "ddagger" ("+\n+\n|" YaTeX-image-ddagger))
172 ("II" "amalg" "II")
173 ; :
174 ;;relational operators
175 ("<" "leq" ("<\n-" "<\n-"))
176 ("=<" "leqq" ("<\n=" "≦"))
177 (">" "geq" (">\n-" ">\n-"))
178 (">=" "geqq" (">\n=" "≧"))
179 ("=:" "fallingdotseq" (".\n==\n ." "≒"))
180 ("-=" "equiv" ("=\n-" YaTeX-image-equiv))
181 ("=-" "equiv" ("=\n-" YaTeX-image-equiv))
182 ("---" "equiv" ("=\n-" YaTeX-image-equiv))
183 ("(" "subset" (" _\n(\n ~" YaTeX-image-subset))
184 ("(-" "subseteq" (" _\n(_\n ~" YaTeX-image-subseteq))
185 (")" "supset" ("_\n )\n~" YaTeX-image-supset))
186 (")-" "supseteq" ("_\n_)\n~" YaTeX-image-supseteq))
187 ("[" "sqsubset" "[")
188 ("[-" "sqsubseteq" "[\n~")
189 ("]" "sqsupset" "]")
190 ("]-" "sqsupseteq" "]\n~")
191 ("{" "in" ("(-" YaTeX-image-in))
192 ("}" "ni" ("-)" YaTeX-image-ni))
193 ("|-" "vdash" "|-")
194 ("-|" "dashv" "-|")
195 ("~" "sim" "~(tild)")
196 ("~-" "simeq" "~\n-")
197 ("asymp" "asymp" "v\n^")
198 ("~~" "approx" "~\n~")
199 ("~=" "cong" "~\n=")
200 ("=/" "neq" ("=/=" "≠"))
201 (".=" "doteq" ".\n=")
202 ("o<" "propto" "o<")
203 ("|=" "models" "|=")
204 ("_|_" "perp" "_|_")
205 ("|" "mid" "|")
206 ("||" "parallel" "||")
207 ("bowtie" "bowtie" "|><|(wide)")
208 ("|><|" "join" "|><|")
209 ("\\_/" "smile" "\\_/")
210 ("/~\\" "frown" "/~~\\")
211 ("-<" "prec" ("-<" "く"))
212 ("-<=" "preceq" ("-<\n-" "く\n="))
213 ("<<" "ll" ("<<" "《"))
214 ("<<" "lll" "<<<")
215 (">>" "gg" (">>" "》"))
216 (">>>" "ggg" ">>>")
217 ; :
218 ;;arrows
219 ("<-" "leftarrow" ("<-" "←"))
220 ("\C-b" "leftarrow" ("<-" "←"))
221 ("<--" "longleftarrow" ("<--" "←--"))
222 ("<=" "Leftarrow" "<=")
223 ("<==" "Longleftarrow" "<==")
224 ("->" "rightarrow" ("->" "→"))
225 ("\C-f" "rightarrow" ("->" "→"))
226 ("-->" "longrightarrow" ("-->" "--→"))
227 ("=>" "Rightarrow" "=>")
228 ("==>" "Longrightarrow" "==>")
229 ("<->" "leftrightarrow" ("<->" "←→"))
230 ("<-->" "longleftrightarrow" ("<---->" "←--→"))
231 ("<=>" "Leftrightarrow" "<=>")
232 ("<==>" "Longleftrightarrow" "<==>")
233 ("^|" "uparrow" ("^\n|" "↑"))
234 ("\C-p" "uparrow" ("^\n|" "↑"))
235 ("^||" "Uparrow" "/\\\n||")
236 ("\C-n" "downarrow" ("|\nv" "↓"))
237 ("v|" "downarrow" ("|\nv" "↓"))
238 ("v||" "Downarrow" "||\n\\/")
239 ("\C-p\C-f" "nearrow" YaTeX-image-nearrow)
240 ("\C-f\C-p" "nearrow" YaTeX-image-nearrow)
241 ("ne" "nearrow" YaTeX-image-nearrow)
242 ("\C-p\C-b" "nwarrow" YaTeX-image-nwarrow)
243 ("\C-b\C-p" "nwarrow" YaTeX-image-nwarrow)
244 ("nw" "nwarrow" YaTeX-image-nwarrow)
245 ("\C-n\C-f" "searrow" YaTeX-image-searrow)
246 ("\C-f\C-n" "searrow" YaTeX-image-searrow)
247 ("se" "searrow" YaTeX-image-searrow)
248 ("\C-n\C-b" "swarrow" YaTeX-image-swarrow)
249 ("\C-b\C-n" "swarrow" YaTeX-image-swarrow)
250 ("sw" "swarrow" YaTeX-image-swarrow)
251 ("|->" "mapsto" ("|->" "|→"))
252 ("<-)" "hookleftarrow" (" ,\n<--+" " ヽ\n<--/"))
253 ("(->" "hookrightarrow" ("`\n+-->" "/\n\-->"))
254 ("/-" "leftharpoonup" "/\n~~~")
255 ("\\-" "leftharpoondown" "__\n\\")
256 ("-/" "rightharpoondown" "__\n/")
257 ("-\\" "rightharpoonup" "~~\n\\")
258 ;;left and right
259 ("left" "left" "(leftmark)")
260 ("right" "right" "(rightmark)")
261 ;;accent marks
262 ("tilde" "tilde" "~\n?")
263 ("T" "tilde" "~\n?")
264 ("wtilde" "widetilde" "~\n?")
265 ("hat" "hat" "^\n?")
266 ("what" "widehat" "/\\\n??")
267 ("w^" "widehat" "/\\\n?")
268 ("check" "check" "v\n?")
269 ("bar" "bar" "_\n?")
270 ("overline" "overline" "_\n?")
271 ("wbar" "overline" "--\n??")
272 ("dot" "dot" ".\n?")
273 ("ddot" "ddot" "..\n??")
274 ("vec" "vec" ("->\n??" "→\n??"))
275 ("~>" "overrightarrow" ("-->\nAB" "→\nAB"))
276 ("VEC" "overrightarrow" ("-->\nAB" "→\nAB"))
277 ;;rage-aware stuffs
278 ("prod" "prod" ("-+--+-\n | |" "Π"))
279 ("CUP" "bigcup" "|~~|\n| |\n| |")
280 ("union" "bigcup" "|~~|\n| |\n| |")
281 ("CAP" "bigcap" "| |\n| |\n|__|")
282 ("isc" "bigcap" "| |\n| |\n|__|")
283 ("O+" "bigoplus" "/~~~\\\n| + |\n\\___/")
284 ("Ox" "bigotimes" "/~~~\\\n| X |\n\\___/")
285 ;;other marks
286 ("angle" "angle" ("/\n~" "∠"))
287 ("/_" "angle" ("/\n~" "∠"))
288 ("Z" "aleph" "|\\|")
289 ("|\\|" "aleph" "|\\|")
290 ("h-" "hbar" "_\nh")
291 ; ("i" "imath" "i") ;These chars are appeared only
292 ; ("j" "jmath" "j") ;as section-type arguments
293 ("l" "ell" "l")
294 ("wp" "wp" "???")
295 ("R" "Re" ")R")
296 ("Im" "Im" "???")
297 ("mho" "mho" "~|_|~")
298 ("'" "prime" "'")
299 ("0" "emptyset" "0")
300 ("nabla" "nabla" ("___\n\\\\/" YaTeX-image-nabla))
301 ("\\/" "surd" "-\\/")
302 ("surd" "surd" "-\\/")
303 ("top" "top" "T")
304 ("bot" "bot" ("_|_" YaTeX-image-bot))
305 ("b" "flat" ("b" YaTeX-image-flat))
306 ("LT" "natural" "|\nLT\n |")
307 ("6" "partial" (" -+\n+-+\n+-+" YaTeX-image-partial))
308 ("partial" "partial" (" -+\n+-+\n+-+" YaTeX-image-partial))
309 ("round" "partial" (" -+\n+-+\n+-+" YaTeX-image-partial))
310 ("[]" "Box" "[]")
311 ("no" "notag" "\\notag")
312 (":" "colon" ":")
313 ("Diamond" "Diamond" "/\\\n\\/")
314 ("3" "triangle" "/\\\n~~")
315 ("C" "clubsuit" " o\no+o\n |")
316 ("D" "diamondsuit" "/\\\n\\/")
317 ("H" "heartsuit" "<^^>\n \\/")
318 ("S" "spadesuit" " /\\\n<++>\n /\\")
319 ("mi" "mathit" "\\mathit{}")
320 ("mr" "mathrm" "\\mathrm{}")
321 ("mb" "mathbf" "\\mathbf{}")
322 ("mt" "mathtt" "\\mathtt{}")
323 ("ms" "mathsf" "\\mathsf{}")
324 ("mc" "mathcal" "\\mathcal{}")
325 ("mn" "mathnormal" "\\mathnormal{}")
326 )
327 "Default LaTeX-math-command alist.")
329 (defvar YaTeX-math-sign-alist-private nil
330 "*User definable key vs LaTeX-math-command alist.")
332 (defvar YaTeX-math-quit-with-strict-match nil
333 "*T for quitting completion as soon as strict-match is found.")
334 (defvar YaTeX-math-sign-alist
335 (append YaTeX-math-sign-alist-private YaTeX-math-sign-alist-default))
337 ;;(defun YaTeX-math-alist2array (alist array)
338 ;; (set array
339 ;; (let ((array (make-vector (length alist) "")) (list alist) (i 0))
340 ;; (while list
341 ;; (aset array i (car (car list)))
342 ;; (setq i (1+ i) list (cdr list)))
343 ;; array))
344 ;;)
346 (defvar YaTeX-greek-key-alist-default
347 '(
348 ("a" "alpha" ("a" "α"))
349 ("b" "beta" ("|>\n|>\n|" "β"))
350 ("g" "gamma" ("~r" "γ"))
351 ("G" "Gamma" ("|~" "Γ"))
352 ("d" "delta" ("<~\n<>" "δ"))
353 ("D" "Delta" ("/\\\n~~" "Δ"))
354 ("e" "epsilon" "<\n<~")
355 ("e-" "varepsilon" ("(\n(~" "ε"))
356 ("z" "zeta" ("(~\n >" "ζ"))
357 ("et" "eta" ("n\n/" "η"))
358 ("th" "theta" ("8" "θ"))
359 ("Th" "Theta" ("(8)" "Θ"))
360 ("th-" "vartheta" ("-8" "-θ"))
361 ("i" "iota" ("i\n\\_/" "ι"))
362 ("k" "kappa" ("k" "κ"))
363 ("l" "lambda" ("\\n/\\" "λ"))
364 ("L" "Lambda" ("/\\" "Λ"))
365 ("m" "mu" (" u_\n/" "μ"))
366 ("n" "nu" ("|/" "ν"))
367 ("x" "xi" ("E\n >" "ξ"))
368 ("X" "Xi" ("---\n -\n---" "Ξ"))
369 ("p" "pi" ("__\n)(" "π"))
370 ("P" "Pi" ("__\n||" "Π"))
371 ("p-" "varpi" ("_\nw" "__\nω"))
372 ("r" "rho" ("/O" "ρ"))
373 ("r-" "varrho" ("/O\n~~" "ρ\n~~"))
374 ("s" "sigma" ("o~" "σ"))
375 ("S" "Sigma" ("\\-+\n >\n/-+" "Σ"))
376 ("s-" "varsigma" "(~~ \n>")
377 ("t" "tau" ("__\n(" "τ"))
378 ("u" "upsilon" ("~v" "υ"))
379 ("y" "upsilon" ("~v" "υ"))
380 ("U" "Upsilon" ("~Y~" "Υ"))
381 ("Y" "Upsilon" ("~Y~" "Υ"))
382 ("ph" "phi" (" /\n(/)\n/" "φ"))
383 ("Ph" "Phi" (" _\n(|)\n ~" "Φ"))
384 ("ph-" "varphi" "\\O\n|")
385 ("c" "chi" ("x" "χ"))
386 ("ps" "psi" ("\\|/\\n |" "ψ"))
387 ("Ps" "Psi" (" ~\n\\|/\\n |" "Ψ"))
388 ("o" "omega" ("w" "ω"))
389 ("w" "omega" ("w" "ω"))
390 ("O" "Omega" ("(~)\n~ ~" "Ω"))
391 ("W" "Omega" ("(~)\n~ ~" "Ω"))
392 ("f" "foo")
393 )
394 "Default LaTeX-math-command alist.")
396 (defvar YaTeX-greek-key-alist-private nil
397 "*User definable key vs LaTeX-math-command alist.")
399 (defvar YaTeX-greek-key-alist
400 (append YaTeX-greek-key-alist-private YaTeX-greek-key-alist-default))
402 ;;(mapcar (function (lambda (x) (YaTeX-math-alist2array x)))
403 ;; YaTeX-math-key-list)
405 (defvar YaTeX-math-indicator "KEY\tLaTeX sequence\t\tsign")
407 (defvar YaTeX-math-need-image t
408 "*T for displaying pseudo image momentarily.")
409 (defvar YaTeX-math-max-key 8)
410 (defvar YaTeX-math-max-seq
411 (* 8 (1+ (/ (length "\\longleftrightarrow") 8))))
412 (defvar YaTeX-math-max-sign 5)
413 (defvar YaTeX-math-sign-width
414 (+ YaTeX-math-max-key YaTeX-math-max-seq YaTeX-math-max-sign))
415 (defvar YaTeX-math-display-width
416 (* 8 (1+ (/ YaTeX-math-sign-width 8))))
417 (defvar YaTeX-math-menu-map nil
418 "Keymap used in YaTeX mathematical sign menu mode.")
420 (if YaTeX-math-menu-map nil
421 (setq YaTeX-math-menu-map (make-sparse-keymap))
422 (define-key YaTeX-math-menu-map "n" 'next-line)
423 (define-key YaTeX-math-menu-map "p" 'previous-line)
424 (define-key YaTeX-math-menu-map "f" 'YaTeX-math-forward)
425 (define-key YaTeX-math-menu-map "b" 'YaTeX-math-backward)
426 (define-key YaTeX-math-menu-map "v" 'scroll-up)
427 (define-key YaTeX-math-menu-map " " 'scroll-up)
428 (define-key YaTeX-math-menu-map "c" 'scroll-up)
429 (define-key YaTeX-math-menu-map "V" 'scroll-down)
430 (define-key YaTeX-math-menu-map "r" 'scroll-down)
431 (define-key YaTeX-math-menu-map "\^h" 'scroll-down)
432 (define-key YaTeX-math-menu-map "<" 'beginning-of-buffer)
433 (define-key YaTeX-math-menu-map ">" 'end-of-buffer)
434 (define-key YaTeX-math-menu-map "\^m" 'exit-recursive-edit)
435 (define-key YaTeX-math-menu-map "q" 'abort-recursive-edit))
437 (defvar YaTeX-math-exit-key "\e"
438 "*Key sequence after prefix key of YaTeX-math-mode to exit from math-mode.")
440 (defmacro YaTeX-math-japanese-sign (list)
441 (list 'nth 1 list))
443 (defvar YaTeX-math-cmd-regexp (concat (regexp-quote YaTeX-ec) "[A-z|]"))
445 ;;; alltt goes into YaTeX-verbatim-environments 2011/3/16
446 ;;(defvar YaTeX-math-verbatim-environments
447 ;; '("alltt")
448 ;; "*List of environments in which LaTeX math mode is disabled.
449 ;;This value is appended with YaTeX-verbatim-environments.")
451 ;;;
452 ;;YaTeX math-mode functions
453 ;;;
454 ;;;###autoload from yatex.el
455 (defun YaTeX-toggle-math-mode (&optional arg)
456 (interactive "P")
457 (or (memq 'YaTeX-math-mode mode-line-format) nil
458 (setq mode-line-format
459 (append (list "" 'YaTeX-math-mode) mode-line-format)))
460 (if YaTeX-auto-math-mode nil ;Only effective on manual mode.
461 (if (or arg (null YaTeX-math-mode))
462 (let (keys)
463 (setq YaTeX-math-mode "math:")
464 (message "Turn on math mode. Prefix keys are %s"
465 (mapconcat 'car YaTeX-math-key-list " "))
466 (sit-for 3)
467 (message
468 (concat "To exit from math-mode, type `ESC' after prefix, "
469 "or type `"
470 (key-description
471 (car
472 (where-is-internal
473 'YaTeX-switch-mode-menu YaTeX-mode-map)))
474 " $'")))
475 (setq YaTeX-math-mode nil)
476 (message "Exit from math mode."))
477 (set-buffer-modified-p (buffer-modified-p))))
479 (defun YaTeX-math-forward (arg)
480 (interactive "p")
481 (re-search-forward YaTeX-math-cmd-regexp nil t arg))
483 (defun YaTeX-math-backward (arg)
484 (interactive "p")
485 (re-search-backward YaTeX-math-cmd-regexp nil t arg))
487 (defun YaTeX-math-gets (sign)
488 (cond
489 ((null sign) nil)
490 ((listp sign)
491 (setq sign
492 (cond
493 (YaTeX-japan (YaTeX-math-japanese-sign sign))
494 (t (car sign))))
495 (YaTeX-math-gets sign))
496 ((symbolp sign)
497 (YaTeX-math-gets (symbol-value sign)))
498 (t sign)))
500 (defun YaTeX-math-get-sign (list)
501 (YaTeX-math-gets (car (cdr-safe (cdr-safe list)))))
503 (defvar YaTeX-math-section-type-regexp
504 "eqn\\\\\\sw+\\b"
505 "*Regexp of section-type math-mode macro")
507 (defun YaTeX-in-math-mode-p ()
508 "If current position is supposed to be in LaTeX-math-mode, return t.
509 This function refers a local variable `source-window' in YaTeX-make-section."
510 (save-excursion
511 (and (boundp 'source-window) source-window
512 (set-buffer (window-buffer source-window)))
513 (or (YaTeX-quick-in-environment-p
514 (append
515 '("math" "eqnarray" "equation" "eqnarray*" "displaymath") ;LaTeX
516 (if YaTeX-use-AMS-LaTeX
517 ;; And math modes of AMS-LaTeX
518 ;;'("align" "align*" "split" "multline" "multline*" "gather"
519 ;; "gather*" "aligned*" "gathered" "gathered*" "alignat"
520 ;; "equation*" "cases" "flalign" "flalign*"
521 ;; "alignat*" "xalignat" "xalignat*" "xxalignat" "xxalignat*"
522 YaTeX-math-begin-list
523 )))
524 (let*((p (point)) (nest 0) me0 r firstp dollar
525 (delim (concat YaTeX-sectioning-regexp "\\|^$\\|^\C-l"))
526 (boundary
527 (save-excursion
528 (if (looking-at delim)
529 (goto-char (max (point-min) (1- (point)))))
530 (re-search-backward delim nil 1)
531 (point))))
532 (save-excursion
533 (cond
534 ((catch 'open
535 (save-excursion
536 (while (and (>= nest 0)
537 (re-search-backward
538 (concat YaTeX-ec-regexp ;\
539 "\\([()]\\|[][]\\)") boundary t))
540 (setq me0 (match-end 0))
541 (if (or (YaTeX-on-comment-p)
542 (YaTeX-literal-p)) nil
543 (if (or (= (char-after (1- me0)) ?\))
544 (= (char-after (1- me0)) ?\]))
545 (setq nest (1+ nest))
546 (if (= (preceding-char) ?\\ ) nil ;;\\[5pt]
547 (setq nest (1- nest))))))
548 (if (< nest 0)
549 (throw 'open (cons (YaTeX-match-string 0) (point)))))))
550 ((and (setq r (YaTeX-on-section-command-p
551 YaTeX-math-section-type-regexp))
552 (numberp r)
553 (> r 0))
554 t)
555 (t (catch 'dollar
556 (while ;(search-backward "$" boundary t);little bit fast.
557 (YaTeX-re-search-active-backward ;;;;;; Too slow???
558 "\\$" (concat "[^\\\\]" YaTeX-comment-prefix) boundary t)
559 (setq dollar "$")
560 (cond
561 ((equal (char-after (1- (point))) ?$) ; $$ equation $$
562 (setq dollar "$$")
563 (backward-char 1)
564 (setq nest (1+ nest)))
565 ((YaTeX-literal-p)
566 nil)
567 ((and (equal (char-after (1- (point))) ?\\ )
568 (not (equal (char-after (- (point) 3)) ?\\ )))
569 nil) ;\$
570 (t (setq nest (1+ nest))))
571 (if (and (= nest 1) (null firstp))
572 (setq firstp (cons dollar (point)))))
573 (if (= (% nest 2) 1)
574 (throw 'dollar firstp))))))))))
576 (defun YaTeX-mark-mathenv ()
577 "Mark current mathematic environment."
578 (interactive)
579 (let ((mmp (YaTeX-in-math-mode-p)) type bpt)
580 (if (or (null mmp) (not (stringp (setq type (car mmp)))))
581 nil ;if nil or not string, do nothing
582 (setq bpt (cdr mmp))
583 (goto-char bpt)
584 (cond
585 ((string-match "\\$" type)
586 (set-mark-command nil)
587 (skip-chars-forward "$")
588 (YaTeX-search-active-forward
589 type YaTeX-comment-prefix nil) ;if it cause error, obey it
590 (goto-char (match-end 0)))
591 ;;
592 ((string-match "^\\\\[\\[(]" type)
593 (set-mark-command nil)
594 (YaTeX-goto-corresponding-leftright)
595 (skip-chars-forward "])\\\\"))
596 ;;
597 ((string-match "^[a-z]" type) ; \begin\end type math
598 (set-mark-command nil)
599 (YaTeX-goto-corresponding-environment)
600 (goto-char (match-end 0)))))))
602 (defun YaTeX-math-display-list (list cols)
603 (goto-char (point-max))
604 (if (= cols 0) (if (not (eolp)) (newline 1))
605 (forward-line -1)
606 (while (looking-at "[ \t\n]") (forward-line -1)))
607 (end-of-line)
608 (let ((indent (* YaTeX-math-display-width cols)) sign str to)
609 (indent-to indent)
610 (insert (car list))
611 (indent-to (setq indent (+ indent YaTeX-math-max-key)))
612 (insert "\\" (car (cdr list)))
613 (setq indent (+ indent YaTeX-math-max-seq))
614 (setq sign (YaTeX-math-get-sign list))
615 (while (and sign (not (string= "" sign)))
616 (setq to (string-match "\n" sign)
617 str (if to (substring sign 0 to) sign))
618 (end-of-line)
619 (indent-to indent)
620 (insert str)
621 (cond ((eobp) (newline 1))
622 ((> cols 0) (forward-line 1)))
623 (setq sign (if to (substring sign (1+ to)) "")))))
625 (defvar YaTeX-math-menu-buffer "*math-mode-signs*")
627 (defun YaTeX-math-show-menu (match-str)
628 (save-window-excursion
629 (YaTeX-showup-buffer YaTeX-math-menu-buffer nil t)
630 (let ((maxcols (max 1 (/ (YaTeX-screen-width) YaTeX-math-sign-width)))
631 (case-fold-search nil)
632 (cols 0) (list alist) command)
633 (erase-buffer)
634 (insert
635 "Candidates of sign. [n:next p:prev f:forw b:back q:quit RET:select]\n")
636 (insert YaTeX-math-indicator "\t")
637 (insert YaTeX-math-indicator)
638 (newline 1)
639 (insert-char ?- (1- (YaTeX-screen-width)))
640 (newline 1)
641 (while list
642 (if (string-match match-str (car (car list)))
643 (progn (YaTeX-math-display-list (car list) cols)
644 (setq cols (% (1+ cols) maxcols))))
645 (setq list (cdr list)))
646 (goto-char (point-min)) (forward-line 3)
647 (use-local-map YaTeX-math-menu-map)
648 (setq buffer-read-only t)
649 (unwind-protect
650 (recursive-edit)
651 (skip-chars-backward "^ \t\n")
652 (setq command
653 (if (re-search-forward YaTeX-math-cmd-regexp nil t)
654 (buffer-substring
655 (match-beginning 0)
656 (prog2 (skip-chars-forward "^ \t\n") (point)))
657 nil))
658 (kill-buffer YaTeX-math-menu-buffer))
659 command)))
661 ;
662 (defun YaTeX-math-show-image (image &optional exit-char)
663 "Momentarily display IMAGE at the beginning of the next line;
664 erase it on the next keystroke. The window is recentered if necessary
665 to make the whole string visible. If the window isn't large enough,
666 at least you get to read the beginning."
667 (if (and image (not (string= image "")))
668 (let ((buffer-read-only nil)
669 (modified (buffer-modified-p))
670 (name buffer-file-name)
671 insert-start
672 insert-end)
673 (unwind-protect
674 (progn
675 (save-excursion
676 ;; defeat file locking... don't try this at home, kids!
677 (setq buffer-file-name nil)
678 (forward-line 1)
679 (setq insert-start (point))
680 (if (eobp) (newline))
681 (insert image)
682 (setq insert-end (point)))
683 ; make sure the whole string is visible
684 (if (not (pos-visible-in-window-p insert-end))
685 (recenter (max 0
686 (- (window-height)
687 (count-lines insert-start insert-end)
688 2))))
689 (let ((char (read-char)))
690 (or (eq char exit-char)
691 (setq unread-command-char char))))
692 (if insert-end
693 (save-excursion
694 (delete-region insert-start insert-end)))
695 (setq buffer-file-name name)
696 (set-buffer-modified-p modified)))))
698 (defun YaTeX-math-insert-sequence (&optional force initial)
699 "Insert math-mode sequence with image completion."
700 (interactive "P")
701 (let*((key (or initial "")) regkey str last-char list i
702 (case-fold-search nil) match sign
703 (this-key (char-to-string last-command-char))
704 (alistsym (cdr (assoc this-key YaTeX-math-key-list)))
705 (alistname (symbol-name alistsym))
706 (alist (symbol-value alistsym))
707 (n (length alist)) (beg (point)) result)
708 (if initial (insert YaTeX-ec (car (cdr (assoc initial alist)))))
709 (if (string-match "^YaTeX-" alistname)
710 (setq alistname (substring alistname (length "YaTeX-"))))
711 (setq alistname (substring alistname 0 (string-match "-" alistname)))
712 (setq result
713 (catch 'complete
714 (if (and (not force)
715 (if YaTeX-auto-math-mode
716 (not (YaTeX-in-math-mode-p))
717 (not YaTeX-math-mode)))
718 (throw 'complete 'escape));this tag should be exit, but...
719 (while t
720 (message "%ssequence%s: %s"
721 (if YaTeX-simple-messages "" (concat alistname " "))
722 (if YaTeX-simple-messages "" "(TAB for menu)") key)
723 (setq last-char (read-char)
724 key (concat key (char-to-string last-char))
725 i 0)
726 (cond
727 ((string= key this-key) ;;invoke key itself
728 (throw 'complete 'escape))
729 ((string= key YaTeX-math-exit-key) ;;exit from math-mode
730 (throw 'complete 'exit))
731 ((string-match "\r" key) ;;RET = kakutei
732 (throw 'complete 'select))
733 ((string-match "[\C-g\C-c]" key) ;;C-g = abort
734 (throw 'complete 'abort))
735 ((string-match "[\t\n]" key) ;;TAB, LFD = menu
736 (throw 'complete 'menu))
737 ((string-match "[\C-h\C-?]" key) ;;BS, DEL = BS
738 (if (< (length key) 2) (throw 'complete 'abort))
739 (setq key (substring key 0 -2))))
741 (setq regkey (concat "^" (regexp-quote key)))
742 (message "Sequence%s: %s"
743 (if YaTeX-simple-messages "" "(TAB for menu)") key)
744 (if
745 (catch 'found
746 ;;(1)input string strictly matches with alist
747 (setq match (assoc key alist))
748 ;;remember previous match
750 ;;(2)search partial match into alist
751 (setq list alist)
752 (while (< i n)
753 (if (string-match
754 regkey
755 ;;(aref array i)
756 ;;(car (nth i alist))
757 (car (car list)))
758 (progn
759 (or match
760 ;;(setq match (nth i alist))
761 (setq match (car list)))
762 (throw 'found t)))
763 (setq i (1+ i) list (cdr list)))) ;catch 'found
764 nil ;;if any match, continue reading
765 ;;else reading of sequence has been done.
766 (message "complete.")
767 (throw 'complete t))
769 (if match
770 (progn (delete-region beg (point))
771 (setq YaTeX-single-command (car (cdr match)))
772 (insert YaTeX-ec YaTeX-single-command)
773 (if (and YaTeX-math-need-image
774 (setq sign (YaTeX-math-get-sign match)))
775 (YaTeX-math-show-image (concat sign "\n")))
776 )
777 nil)
778 )))
779 (delete-region beg (point))
780 (cond
781 ((memq result '(t select))
782 (if (eq result t)
783 (setq unread-command-char last-char)
784 (message "Done."))
785 (if (assoc YaTeX-single-command section-table)
786 (YaTeX-make-section nil nil nil YaTeX-single-command)
787 (setq YaTeX-current-completion-type 'maketitle)
788 (YaTeX-make-singlecmd YaTeX-single-command)))
789 ((eq result 'abort)
790 (message "Abort."))
791 ((eq result 'escape)
792 (call-interactively (lookup-key global-map this-key)))
793 ((eq result 'exit)
794 (YaTeX-toggle-math-mode))
795 ((eq result 'menu)
796 (setq key (concat "^" (regexp-quote (substring key 0 -1))))
797 (insert (YaTeX-math-show-menu key))))))
799 ;; ----- Change image completion types -----
800 (defun YaTeX-math-member-p (item)
801 "Check if ITEM is a member of image completion.
802 If so return the cons of its invocation key and image-string."
803 (let ((lists YaTeX-math-key-list) list)
804 (catch 'found
805 (while lists
806 (setq list (symbol-value (cdr (car lists))))
807 (while list
808 (if (string= item (nth 1 (car list)))
809 (throw 'found (cons (car (car lists)) (nth 0 (car list)))))
810 (setq list (cdr list)))
811 (setq lists (cdr lists))))))
813 ;;; ----- for AMS LaTeX (by matsu<at>math.s.chiba-u.ac.jp) -----
814 (defvar YaTeX-ams-paren-modifier
815 '(("Biggl" . "Biggr") ("biggl" . "biggr")
816 ("Bigl" . "Bigr") ("bigl" . "bigr")
817 ("left" . "right") ("" . ""))
818 "Alist of modifier of parentheses.")
820 (defvar YaTeX-left-paren "(\\|\\[\\|\\\\{")
821 (defvar YaTeX-right-paren ")\\|\\]\\|\\\\}")
822 (defvar YaTeX-paren
823 (concat YaTeX-left-paren "\\|" YaTeX-right-paren))
825 (defun YaTeX-on-parenthesis-p ()
826 "If cursor is on an (AMS-LaTeX) parenthesis, return the parenthesis."
827 (interactive)
828 (let* ((list YaTeX-ams-paren-modifier)
829 (longest 0) ;; the longest length of parenthesis command strings
830 (flag t) ;; flag for whether on braces not following \
831 (point (point))
832 (move 0)
833 (paren))
834 (while list
835 (setq longest
836 (max longest (length (car (car list))) (length (cdr (car list)))))
837 (setq list (cdr list)))
838 (save-excursion
839 ;; search {} and, if it does not follow `\', set flag nil.
840 ;; if it is right after `\', set flag t and move to the position of \.
841 ;; mmmmm.
842 (if (looking-at "{\\|}")
843 (if (not (equal (char-after (1- (point))) 92))
844 (setq flag nil)
845 (forward-char -1)))
846 ;; if flag is nil, do nothing.
847 (if (and flag (re-search-forward YaTeX-paren
848 (+ (point) 3 longest) t))
849 (progn
850 (setq move (- (point) point))
851 (setq paren (YaTeX-match-string 0))
852 (setq list YaTeX-ams-paren-modifier)
853 ;; criterion for whether on [] () \{\} or not.
854 (if (string-match YaTeX-left-paren paren)
855 (while (and list flag)
856 (let* ((mod (car (car list)))
857 (mod-length 0) ;; length of modifier
858 paren-regexp ;; regexp of paren.
859 mod-regexp) ;; regexp of modifier.
860 (if (> (length mod) 0)
861 (setq mod-regexp (concat "\\\\" mod)
862 mod-length (1+ (length mod))))
863 (cond ((string= paren "\\{")
864 (setq paren-regexp (concat "\\" paren)))
865 ((string= paren "[")
866 (setq paren-regexp "\\["))
867 (t (setq paren-regexp paren)))
868 (save-excursion
869 (if (and (>= (- (point) (point-min))
870 (+ mod-length (length paren)))
871 (not (forward-char
872 (- 0 mod-length (length paren))))
873 (looking-at (concat "\\(" mod-regexp "\\)\\("
874 paren-regexp "\\)")))
875 (setq flag nil)))
876 (setq list (cdr list))))
877 (while (and list flag)
878 (let* ((mod (cdr (car list)))
879 (mod-length 0)
880 paren-regexp
881 mod-regexp)
882 (if (> (length mod) 0)
883 (setq mod-regexp (concat "\\\\" mod)
884 mod-length (1+ (length mod))))
885 (cond ((string= paren "\\}")
886 (setq paren-regexp (concat "\\" paren)))
887 ((string= paren "]")
888 (setq paren-regexp "\\]"))
889 (t (setq paren-regexp paren)))
890 (save-excursion
891 (if (and (>= (- (point) (point-min))
892 (+ mod-length (length paren)))
893 (not (forward-char
894 (- 0 mod-length (length paren))))
895 (looking-at (concat "\\(" mod-regexp "\\)\\("
896 paren-regexp "\\)")))
897 (setq flag nil)))
898 (setq list (cdr list)))))
899 (if (<= move (length (YaTeX-match-string 0)))
900 (YaTeX-match-string 0)))))))
902 (defun YaTeX-goto-open-paren (&optional jumpto-co)
903 "Jump to the exact position of open parenthesis.
904 If optional argument JUMPTO-CO is non-nil, goto corresponding parentheses."
905 (interactive)
906 (let ((paren)
907 (backslash-syntax (char-to-string (char-syntax ?\\))))
908 (if (setq paren (YaTeX-on-parenthesis-p))
909 (if (string-match "(\\|{\\|\\[" paren (1- (length paren)))
910 (progn
911 (re-search-forward "(\\|{\\|\\[" (+ (point) (length paren)) t)
912 (backward-char)
913 (if jumpto-co
914 (unwind-protect
915 (progn
916 (modify-syntax-entry ?\\ " ")
917 (forward-list)
918 (backward-char))
919 (modify-syntax-entry ?\\ backslash-syntax)))
920 (point))
921 (re-search-forward ")\\|}\\|\\]" (+ (point) (length paren)) t)
922 (unwind-protect
923 (progn
924 (modify-syntax-entry ?\\ " ")
925 (backward-list)
926 (point))
927 (modify-syntax-entry ?\\ backslash-syntax))))))
929 ;;;###autoload
930 (defun YaTeX-goto-corresponding-paren ()
931 "Go to corresponding mathematical parentheses."
932 (if (YaTeX-on-parenthesis-p)
933 (YaTeX-goto-open-paren t)
934 nil))
936 (defun YaTeX-change-parentheses ()
937 "Change the size of parentheses, braces, and brackets of AMS-LaTeX."
938 (interactive)
939 (if (not (and YaTeX-use-AMS-LaTeX (YaTeX-on-parenthesis-p)))
940 nil
941 (let* ((mod (YaTeX-match-string 1)) ;; modifier
942 (paren (if mod (YaTeX-match-string 2) (YaTeX-match-string 0))) ;; paren
943 (mod-length (if (or (string= mod "\\left") (string= mod "\\right"))
944 5 ;; 5 in case left or right
945 (length mod))) ;; length of modifier
946 (paren-length (length paren)) ;; length of paren
947 (length (+ mod-length paren-length)) ;; length of whole string
948 (big-p t) ;; flag whether new modifier is "[Bb]ig+" or not.
949 size ;; left, big, Big etc.
950 type ;; parentheses type
951 lr ;; "l" or "r".
952 char newsize newsize-length
953 (backslash-syntax (char-to-string (char-syntax ?\\)))
954 (case-fold-search))
955 ;; decide lr and size from mod and paren.
956 (cond ((string-match "\\(\\\\[Bb]ig+\\)[lr]" mod)
957 (setq size (substring mod 1 (match-end 1))
958 lr (substring mod (match-end 1) (match-end 0))))
959 ((string-match "\\\\left" mod)
960 (setq size "left-right" lr "l"))
961 ((string-match "\\\\right" mod)
962 (setq size "left-right" lr "r"))
963 ((string-match "(\\|\\[\\|\\\\{" paren)
964 (setq size "null" lr "l"))
965 ((string-match ")\\|\\]\\|\\\\}" paren)
966 (setq size "null" lr "r"))
967 (t
968 (setq size nil lr nil)))
969 (while (not newsize)
970 (message (format (concat "Change from %s: "
971 "l(big) L(Big) h(bigg) H(Bigg) "
972 "r(left-right) n(NONE) ( { [") size))
973 (setq char (read-char)
974 newsize (cond ((char-equal char ?l) "\\big")
975 ((char-equal char ?L) "\\Big")
976 ((char-equal char ?h) "\\bigg")
977 ((char-equal char ?H) "\\Bigg")
978 ((char-equal char ?r)
979 (setq big-p nil) "\\left")
980 ((memq char '(?\( ?\)))
981 (setq big-p nil type '("(" . ")")) "")
982 ((memq char '(?\{ ?\}))
983 (setq big-p nil type '("\\{" . "\\}")) "")
984 ((memq char '(?\[ ?\]))
985 (setq big-p nil type '("[" . "]")) "")
986 ((char-equal char ?n)
987 (setq big-p nil) "")
988 (t nil))
989 newsize-length (length newsize)))
990 (YaTeX-goto-open-paren)
991 (forward-char)
992 (cond
993 (type
994 (delete-region (point) (- (point) paren-length))
995 (save-excursion (insert (car type))))
996 (t
997 (delete-region (- (point) length) (- (point) paren-length))
998 (backward-char paren-length)))
999 (insert-string newsize)
1000 (if big-p (insert ?l))
1001 (unwind-protect
1002 (progn
1003 (modify-syntax-entry ?\\ " ")
1004 (forward-list)
1005 (if (string= size "left-right") (setq length (1+ length)))
1006 (if (eq char ?r) (setq newsize "\\right"))
1007 (cond
1008 (type
1009 (delete-region (point) (- (point) paren-length))
1010 (insert (cdr type)))
1011 (t
1012 (delete-region (- (point) length) (- (point) paren-length))
1013 (backward-char paren-length)
1014 (insert-string newsize)
1015 (if big-p (insert ?r))
1016 (forward-char paren-length)))
1017 (if (string= lr "l") (backward-list)))
1018 (modify-syntax-entry ?\\ backslash-syntax))
1019 t)))
1021 (defun YaTeX-insert-amsparens-region (beg end char)
1022 (interactive "r\ncWhich one ? l(big) L(Big) h(bigg) H(Bigg): ")
1023 (let* ((case-fold-search)
1024 (st (cond ((char-equal char ?l) "big")
1025 ((char-equal char ?L) "Big")
1026 ((char-equal char ?h) "bigg")
1027 ((char-equal char ?H) "Bigg"))))
1028 (if st
1029 (YaTeX-insert-braces-region
1030 beg end (concat "\\" st "l(") (concat "\\" st "r)"))
1031 (YaTeX-insert-braces-region beg end "(" ")"))))
1033 (defun YaTeX-insert-amsbraces-region (beg end char)
1034 (interactive "r\ncWhich one ? l(big) L(Big) h(bigg) H(Bigg): ")
1035 (let* ((case-fold-search)
1036 (st (cond ((char-equal char ?l) "big")
1037 ((char-equal char ?L) "Big")
1038 ((char-equal char ?h) "bigg")
1039 ((char-equal char ?H) "Bigg"))))
1040 (if st
1041 (YaTeX-insert-braces-region
1042 beg end (concat "\\" st "l\\{") (concat "\\" st "r\\}"))
1043 (YaTeX-insert-braces-region beg end "\\{" "\\}"))))
1045 (defun YaTeX-insert-amsbrackets-region (beg end char)
1046 (interactive "r\ncWhich one ? l(big) L(Big) h(bigg) H(Bigg): ")
1047 (let* ((case-fold-search)
1048 (st (cond ((char-equal char ?l) "big")
1049 ((char-equal char ?L) "Big")
1050 ((char-equal char ?h) "bigg")
1051 ((char-equal char ?H) "Bigg"))))
1052 (if st
1053 (YaTeX-insert-braces-region
1054 beg end (concat "\\" st "l[") (concat "\\" st "r]"))
1055 (YaTeX-insert-braces-region beg end "[" "]"))))
1058 ;;
1059 (provide 'yatexmth)
1061 ; Local variables:
1062 ; fill-prefix: ";;; "
1063 ; paragraph-start: "^$\\| \\|;;;$"
1064 ; paragraph-separate: "^$\\| \\|;;;$"
1065 ; End: