yatex

view yatexmth.el @ 270:1b4e0acd0106

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