
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; MODULE      : math-kbd.scm
;; DESCRIPTION : keyboard shortcuts for mathematics
;; COPYRIGHT   : (C) 1999  Joris van der Hoeven
;;
;; This software falls under the GNU general public license version 3 or later.
;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
;; in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(texmacs-module (math math-kbd)
  (:use (generic generic-kbd)
        (utils edit auto-close)
        (generic format-edit)
        (math math-edit)
        (table table-edit)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Bypassing the pre-edit mechanism
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(tm-define (disable-pre-edit? key)
  (:mode in-math?)
  (in? key (list "^" "~" "`" "'" "\"")))

(tm-define (downgrade-pre-edit key)
  (:mode in-math?)
  (cond ((in? key (list "à" "á" "â" "ã" "ä")) "a")
        ((in? key (list "ĉ")) "c")
        ((in? key (list "è" "é" "ê" "ẽ" "ë")) "e")
        ((in? key (list "ĝ")) "g")
        ((in? key (list "ĥ")) "h")
        ((in? key (list "ì" "í" "î" "ĩ" "ï")) "i")
        ((in? key (list "ĵ")) "j")
        ((in? key (list "m̂")) "m")
        ((in? key (list "ǹ" "ń" "n̂" "ñ")) "n")
        ((in? key (list "ò" "ó" "ô" "õ" "ö")) "o")
        ((in? key (list "ŝ")) "s")
        ((in? key (list "ù" "ú" "û" "ũ" "ü")) "u")
        ((in? key (list "ṽ")) "v")
        ((in? key (list "ẁ" "ŵ")) "w")
        ((in? key (list "ỳ" "ý" "ŷ" "ỹ" "ÿ")) "y")
        ((in? key (list "ẑ")) "z")
        ((in? key (list "À" "Á" "Â" "Ã" "Ä")) "A")
        ((in? key (list "Ĉ")) "C")
        ((in? key (list "È" "É" "Ê" "Ẽ" "Ë")) "E")
        ((in? key (list "Ĝ")) "G")
        ((in? key (list "Ĥ")) "H")
        ((in? key (list "Ì" "Í" "Î" "Ĩ" "Ï")) "I")
        ((in? key (list "Ĵ")) "J")
        ((in? key (list "M̂")) "M")
        ((in? key (list "Ǹ" "Ń" "N̂" "Ñ")) "N")
        ((in? key (list "Ò" "Ó" "Ô" "Õ" "Ö")) "O")
        ((in? key (list "Ŝ")) "S")
        ((in? key (list "Ù" "Ú" "Û" "Ũ" "Ü")) "U")
        ((in? key (list "Ṽ")) "V")
        ((in? key (list "Ẁ" "Ŵ")) "W")
        ((in? key (list "Ỳ" "Ý" "Ŷ" "Ỹ" "Ÿ")) "Y")
        ((in? key (list "Ẑ")) "Z")
        (else "")))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Main keyboard shortcuts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(kbd-map
  (:mode in-math?)
  ;; must come first in order not to screw the menus up
  ("accent:deadhat" (make-script #t #t))
  ("accent:deadhat var" "^")
  ("math:left accent:deadhat" (make-script #t #f))
  ("math accent:tilde" (make-wide "~"))          ; yields M-M-~
  ("math accent:deadhat" (make-wide "^"))        ; yields M-M-^
  ("math accent:acute" (make-wide "<acute>"))    ; yields M-M-'
  ("math accent:grave" (make-wide "<grave>"))    ; yields M-M-`
  ("accent:abovedot" (make-wide "<dot>"))        ; yields M-.
  ("accent:umlaut" (make-wide "<ddot>"))         ; yields M-\"
  ("accent:breve" (make-wide "<breve>"))         ; yields M-U
  ("accent:invbreve" (make-wide "<invbreve>"))   ; yields M-A
  ("accent:check" (make-wide "<check>"))         ; yields M-V
  ("math:under accent:tilde" (make-wide-under "~"))
  ("math:under accent:deadhat" (make-wide-under "^"))
  ("math:under accent:acute" (make-wide-under "<acute>"))
  ("math:under accent:grave" (make-wide-under "<grave>"))
  ("math:under accent:abovedot" (make-wide-under "<dot>"))
  ("math:under accent:umlaut" (make-wide-under "<ddot>"))
  ("math:under accent:breve" (make-wide-under "<breve>"))
  ("math:under accent:invbreve" (make-wide-under "<invbreve>"))
  ("math:under accent:check" (make-wide-under "<check>"))
  ;; end

  ("S-F5 S-F5" (make 'math-sl))
  ("S-F6 S-F6" (make 'math-up))
  ("F5 F5" (make 'math-it))
  ("F6 F6" (make 'math-bf))
  ("F7 F7" (make 'math-tt))
  ("F8 F8" (make 'math-ss))
  ("altcmd S-F5" (make 'math-sl))
  ("altcmd S-F6" (make 'math-up))
  ("altcmd F5" (make 'math-it))
  ("altcmd F6" (make 'math-bf))
  ("altcmd F7" (make 'math-tt))
  ("altcmd F8" (make 'math-ss))

  ("$" (math-make-math))
  ("math $" (make 'text))
  ("`" (make-lprime "`"))
  ("'" (make-rprime "'"))
  ("\"" (make-rprime "'") (make-rprime "'"))
  ("` var" (make-lprime "'"))
  ("` var var" (make-lprime "<asterisk>"))
  ("` var var var" (make-lprime "<star>"))
  ("` var var var var" (make-lprime "<dag>"))
  ("` var var var var var" (make-lprime "<ddag>"))
  ("` var var var var var var" (make-lprime "<kreuz>"))
  ("' var" (make-rprime "`"))
  ("' var var" (make-rprime "<asterisk>"))
  ("' var var var" (make-rprime "<star>"))
  ("' var var var var" (make-rprime "<dag>"))
  ("' var var var var var" (make-rprime "<ddag>"))
  ("' var var var var var var" (make-rprime "<kreuz>"))
  ("\" var" (make-rprime "`") (make-rprime "`"))
  ("\" var var" (make-rprime "<asterisk>") (make-rprime "<asterisk>"))
  ("\" var var var" (make-rprime "<star>") (make-rprime "<star>"))
  ("\" var var var var" (make-rprime "<dag>") (make-rprime "<dag>"))
  ("\" var var var var var" (make-rprime "<ddag>") (make-rprime "<ddag>"))
  ("\" var var var var var var" (make-rprime "<kreuz>") (make-rprime "<kreuz>"))
  ("math:greek '" (make-rprime "<dag>"))
  ("math:greek \"" (make-rprime "<ddag>"))
  ("math:greek +" (make-rprime "<kreuz>"))
  ("math:greek *" (make-rprime "<asterisk>"))
  ("_" (make-script #f #t))
  ("_ var" "_")
  ("^" (make-script #t #t))
  ("^ var" "^")
  ("math:left _" (make-script #f #f))
  ("math:left ^" (make-script #t #f))
  ("math f" (make-fraction))
  ("math f var" (make 'tfrac))
  ("math f var var" (make 'dfrac))
  ("math f var var var" (make 'frac*))
  ("math f var var var var" (make 'cfrac))
  ("math s" (make-sqrt))
  ("math s var" (make-var-sqrt))
  ("math n" (make-neg))
  ("math O" (make 'op))
  ("math +" (make-rprime "<dag>"))
  ("math a" (make-above))
  ("math b" (make-below))

  ("math:syntax o" (make 'math-ordinary))
  ("math:syntax space" (make 'math-ignore))
  ("math:syntax ," (make 'math-separator))
  ("math:syntax q" (make 'math-quantifier))
  ("math:syntax = >" (make 'math-imply))
  ("math:syntax %" (make 'math-or))
  ("math:syntax &" (make 'math-and))
  ("math:syntax / var" (make 'math-not))
  ("math:syntax =" (make 'math-relation))
  ("math:syntax % var" (make 'math-union))
  ("math:syntax & var" (make 'math-intersection))
  ("math:syntax - var" (make 'math-setminus))
  ("math:syntax +" (make 'math-plus))
  ("math:syntax -" (make 'math-minus))
  ("math:syntax *" (make 'math-times))
  ("math:syntax /" (make 'math-over))
  ("math:syntax #" (make 'math-prefix))
  ("math:syntax !" (make 'math-postfix))
  ("math:syntax (" (make 'math-open))
  ("math:syntax )" (make 'math-close))
  ("math:syntax x" (make 'syntax))

  ("math B" (make-wide "<bar>"))
  ("math C" (make-wide "<check>"))
  ("math U" (make-wide "<breve>"))
  ("math A" (make-wide "<invbreve>"))
  ("math T" (make-wide "<bind>"))
  ("math V" (make-wide "<vect>"))
  ("math ~" (make-wide "~"))
  ("math ^" (make-wide "^"))
  ("math '" (make-wide "<acute>"))
  ("math `" (make-wide "<grave>"))
  ("math -" (make-wide "<wide-bar>"))
  ("math ." (make-wide "<dot>"))
  ("math . var" (make-wide "<ddot>"))
  ("math . var var" (make-wide "<dddot>"))
  ("math . var var var" (make-wide "<ddddot>"))
  ("math \"" (make-wide "<ddot>"))
  ("math \" var" (make-wide "<dddot>"))
  ("math \" var var" (make-wide "<ddddot>"))
  ("math @" (make-wide "<abovering>"))
  ("math _" (make-wide-under "<wide-bar>"))
  ("math:over {" (make-wide "<wide-overbrace>"))
  ("math:over }" (make-wide "<wide-underbrace*>"))
  ("math:over (" (make-wide "<wide-poverbrace>"))
  ("math:over )" (make-wide "<wide-punderbrace*>"))
  ("math:over [" (make-wide "<wide-sqoverbrace>"))
  ("math:over ]" (make-wide "<wide-squnderbrace*>"))
  ("math:over <" (make-wide "<wide-varleftarrow>"))
  ("math:over >" (make-wide "<wide-varrightarrow>"))
  ("math:over < >" (make-wide "<wide-varleftrightarrow>"))
  ("math:over -" (make-wide "<wide-bar>"))
  ("math:under B" (make-wide-under "<bar>"))
  ("math:under C" (make-wide-under "<check>"))
  ("math:under U" (make-wide-under "<breve>"))
  ("math:under A" (make-wide-under "<invbreve>"))
  ("math:under T" (make-wide-under "<bind>"))
  ("math:under V" (make-wide-under "<vect>"))
  ("math:under ~" (make-wide-under "~"))
  ("math:under ^" (make-wide-under "^"))
  ("math:under '" (make-wide-under "<acute>"))
  ("math:under `" (make-wide-under "<grave>"))
  ("math:under -" (make-wide-under "<wide-bar>"))
  ("math:under ." (make-wide-under "<dot>"))
  ("math:under . var" (make-wide-under "<ddot>"))
  ("math:under . var var" (make-wide-under "<dddot>"))
  ("math:under . var var var" (make-wide-under "<ddddot>"))
  ("math:under \"" (make-wide-under "<ddot>"))
  ("math:under \" var" (make-wide-under "<dddot>"))
  ("math:under \" var var" (make-wide-under "<ddddot>"))
  ("math:under @" (make-wide-under "<abovering>"))
  ("math:under {" (make-wide-under "<wide-overbrace*>"))
  ("math:under }" (make-wide-under "<wide-underbrace>"))
  ("math:under (" (make-wide-under "<wide-poverbrace*>"))
  ("math:under )" (make-wide-under "<wide-punderbrace>"))
  ("math:under [" (make-wide-under "<wide-sqoverbrace*>"))
  ("math:under ]" (make-wide-under "<wide-squnderbrace>"))
  ("math:under <" (make-wide-under "<wide-varleftarrow>"))
  ("math:under >" (make-wide-under "<wide-varrightarrow>"))
  ("math:under < >" (make-wide-under "<wide-varleftrightarrow>"))

  ("table N c" (make 'choice))
  ("table N m" (make 'matrix))
  ("table N M" (make 'bmatrix))
  ("table N d" (make 'det))
  ("table N s" (make 'stack))
  ("{ math t" (make 'choice))
  ("( math t" (make 'matrix))
  ("[ math t" (make 'bmatrix))
  ("| math t" (make 'det))
  ("math t" (make 'tabular*))
  ("math t var" (make 'matrix))
  ("math t var var" (make 'det))
  ("math t var var var" (make 'bmatrix))
  ("math t var var var var" (make 'choice))
  ("math t var var var var var" (make 'stack))

  ("font R" (make-with "math-font" "roman"))
  ("font K" (make-with "math-font" "concrete"))
  ("font F" (make-with "math-font" "Euler"))
  ("font E" (make-with "math-font" "ENR"))
  ("font C" (make-with "math-font" "cal"))
  ("font B" (make-with "math-font" "Bbb*"))
  ("font A" (make-with "math-font" "adobe"))
  ("font o" (make-with "math-font-family" "mr"))
  ("font s" (make-with "math-font-family" "ms"))
  ("font t" (make-with "math-font-family" "mt"))
  ("font m" (make-with "math-font-series" "medium"))
  ("font b" (make-with "math-font-series" "bold"))
  ("font n" (make-with "math-font-shape" "normal"))
  ("font r" (make-with "math-font-shape" "right"))
  ("font l" (make-with "math-font-shape" "slanted"))
  ("font i" (make-with "math-font-shape" "italic"))
  ("font u" (make-with "math-font-shape" "semi-right"))

  ("notsign" "<neg>")
  ("plusminus" "<pm>")
  ("twosuperior" (math-insert '(rsup "2")))
  ("threesuperior" (math-insert '(rsup "3")))
  ("mu" "<mu>")
  ("onequarter" (math-insert '(frac "1" "4")))
  ("onehalf" (math-insert '(frac "1" "2")))
  ("threequarters" (math-insert '(frac "3" "4")))

  ("space var" "<space>")
  ("space var var" "<nospace>")
  ("space var var var" (math-insert '(application-space "1em")))
  ("space var var var var" (math-insert '(application-space "2em")))
  (", var" "<comma>")
  (", var var" "<nocomma>")
  (", var var var" (math-insert '(separating-space "0.2em")))
  (", var var var var" (math-insert '(separating-space "1em")))
  (", var var var var var" (math-insert '(separating-space "2em")))
  (", ," ",<ldots>,")
  ("; ;" ";<ldots>;")
  ("." ".")
  (". var" "<point>")
  (". var var" "<cdummy>")
  (". var var var" "<nosymbol>")

  ("math:symbol a" "<amalg>")
  ("math:symbol d" "<partial>")
  ("math:symbol p" "<wp>")
  ("math:symbol n" "<cap>")
  ("math:symbol n var" "<sqcap>")
  ("math:symbol u" "<cup>")
  ("math:symbol u var" "<sqcup>")
  ("math:symbol w" "<wedge>")
  ("math:symbol w var" "<curlywedge>")
  ("math:symbol w var var" "<curlywedgeuparrow>")
  ("math:symbol w var var var" "<curlywedgedownarrow>")
  ("math:symbol w var var var var" "<wedges>")
  ("math:symbol v" "<vee>")
  ("math:symbol v var" "<curlyvee>")
  ("math:symbol v var var" "<curlyveeuparrow>")
  ("math:symbol v var var var" "<curlyveedownarrow>")
  ("math:symbol x" "<times>")

  ("math:symbol:limits I" (math-big-operator "intlim"))
  ("math:symbol:limits I var" (math-big-operator "upintlim"))
  ("math:symbol:limits I I" (math-big-operator "iintlim"))
  ("math:symbol:limits I I var" (math-big-operator "upidotsintlim"))
  ("math:symbol:limits I I var var" (math-big-operator "upiintlim"))
  ("math:symbol:limits I I I" (math-big-operator "iiintlim"))
  ("math:symbol:limits I I I var" (math-big-operator "upiiintlim"))
  ("math:symbol:limits I I I I" (math-big-operator "iiiintlim"))
  ("math:symbol:limits O" (math-big-operator "ointlim"))
  ("math:symbol:limits O var" (math-big-operator "upointlim"))
  ("math:symbol:limits O O" (math-big-operator "oiintlim"))
  ("math:symbol:limits O O var" (math-big-operator "upoiintlim"))
  ("math:symbol:limits O O O" (math-big-operator "oiiintlim"))
  ("math:symbol:limits O O O var" (math-big-operator "upoiiintlim"))

  ("math:symbol I !" (math-big-operator "intlim"))
  ("math:symbol I var !" (math-big-operator "upintlim"))
  ("math:symbol I I" (math-big-operator "iint"))
  ("math:symbol I I var !" (math-big-operator "iintlim"))
  ("math:symbol I I var var !" (math-big-operator "idotsintlim"))
  ("math:symbol I I var var var !" (math-big-operator "upiintlim"))
  ("math:symbol I I I !" (math-big-operator "iiintlim"))
  ("math:symbol I I I var !" (math-big-operator "upiiintlim"))
  ("math:symbol I I I I var" (math-big-operator "iiintlim"))
  ("math:symbol O !" (math-big-operator "ointlim"))
  ("math:symbol O var !" (math-big-operator "upointlim"))
  ("math:symbol O O !" (math-big-operator "oiintlim"))
  ("math:symbol O O var !" (math-big-operator "upoiintlim"))
  ("math:symbol O O O !" (math-big-operator "oiiintlim"))
  ("math:symbol O O O var !" (math-big-operator "upoiiintlim"))

  ("math:symbol I" (math-big-operator "int"))
  ("math:symbol I var" (math-big-operator "upint"))
  ("math:symbol I var var" (math-big-operator "intlim"))
  ("math:symbol I var var var" (math-big-operator "upintlim"))
  ("math:symbol I I" (math-big-operator "iint"))
  ("math:symbol I I var" (math-big-operator "idotsint"))
  ("math:symbol I I var var" (math-big-operator "upiint"))
  ("math:symbol I I var var var" (math-big-operator "iintlim"))
  ("math:symbol I I var var var var" (math-big-operator "idotsintlim"))
  ("math:symbol I I var var var var var" (math-big-operator "upiintlim"))
  ("math:symbol I I I" (math-big-operator "iiint"))
  ("math:symbol I I I var" (math-big-operator "upiiint"))
  ("math:symbol I I I var var" (math-big-operator "iiintlim"))
  ("math:symbol I I I var var var" (math-big-operator "upiiintlim"))
  ("math:symbol I I I I" (math-big-operator "iiiint"))
  ("math:symbol I I I I var" (math-big-operator "iiiintlim"))
  ("math:symbol O" (math-big-operator "oint"))
  ("math:symbol O var" (math-big-operator "upoint"))
  ("math:symbol O var var" (math-big-operator "ointlim"))
  ("math:symbol O var var var" (math-big-operator "upointlim"))
  ("math:symbol O O" (math-big-operator "oiint"))
  ("math:symbol O O var" (math-big-operator "upoiint"))
  ("math:symbol O O var var" (math-big-operator "oiintlim"))
  ("math:symbol O O var var var" (math-big-operator "upoiintlim"))
  ("math:symbol O O O" (math-big-operator "oiiint"))
  ("math:symbol O O O var" (math-big-operator "upoiiint"))
  ("math:symbol O O O var var" (math-big-operator "oiiintlim"))
  ("math:symbol O O O var var var" (math-big-operator "upoiiintlim"))

  ("math:symbol A" (math-big-operator "amalg"))
  ("math:symbol B" (math-big-operator "parallel"))
  ("math:symbol B var" (math-big-operator "interleave"))
  ("math:symbol N" (math-big-operator "cap"))
  ("math:symbol N var" (math-big-operator "sqcap"))
  ("math:symbol N var var" (math-big-operator "box"))
  ("math:symbol S" (math-big-operator "sum"))
  ("math:symbol P" (math-big-operator "prod"))
  ("math:symbol U" (math-big-operator "cup"))
  ("math:symbol U +" (math-big-operator "pluscup"))
  ("math:symbol U var" (math-big-operator "sqcup"))
  ("math:symbol U var var" (math-big-operator "box"))
  ("math:symbol V" (math-big-operator "vee"))
  ("math:symbol V var" (math-big-operator "curlyvee"))
  ("math:symbol V var var" (math-big-operator "triangledown"))
  ("math:symbol W" (math-big-operator "wedge"))
  ("math:symbol W var" (math-big-operator "curlywedge"))
  ("math:symbol W var var" (math-big-operator "triangleup"))
  ("math:symbol:circled ." (math-big-operator "odot"))
  ("math:symbol:circled +" (math-big-operator "oplus"))
  ("math:symbol:circled x" (math-big-operator "otimes"))
  ("math:symbol:circled *" (math-big-operator "otimes"))

  ("symbol &" "&")
  ("symbol %" "%")
  ("symbol % var" "<permil>")
  ("symbol \\" "\\")
  ("symbol \\ var" "<setminus>")
  ("symbol \\ var var" "<smallsetminus>")
  ("symbol |" "|")
  ("symbol | /" "<nmid>")
  ("symbol | var" "<shortmid>")
  ("symbol | var /" "<nshortmid>")
  ("symbol | var var" "<divides>")
  ("symbol | var var /" "<ndivides>")
  ("symbol | |" "<||>")
  ("symbol | | /" "<nparallel>")
  ("symbol | | var" "<shortparallel>")
  ("symbol | | var /" "<nshortparallel>")
  ("symbol | | var var" "<varparallel>")
  ("symbol | | var var /" "<nvarparallel>")

  ("math:small (" (math-bracket-open "(" ")" #f))
  ("math:small ( var" (math-bracket-open "<nobracket>" "<nobracket>" #f))
  ("math:small )" (math-bracket-close ")" "(" #f))
  ; ("math:small [" (math-bracket-open "[" "]" #f))
  ("math:small [ var" (math-bracket-open "[" "[" #f))
  ("math:small [ var var" (math-bracket-open "]" "]" #f))
  ("math:small [ var var var" (math-bracket-open "]" "[" #f))
  ; ("math:small ]" (math-bracket-close "]" "[" #f))
  ("math:small [ [" (twice (math-bracket-open "[" "]" #f)))
  ("math:small ] ]" (twice (math-bracket-close "]" "[" #f)))
  ("math:small [ [ var" (math-bracket-open "<llbracket>" "<rrbracket>" #f))
  ("math:small ] ] var" (math-bracket-close "<llbracket>" "<rrbracket>" #f))
  ("math:small {" (math-bracket-open "{" "}" #f))
  ("math:small }" (math-bracket-close "}" "{" #f))
  ("math:small <" (math-bracket-open "<langle>" "<rangle>" #f))
  ("math:small < var" (math-bracket-open "<llangle>" "<rrangle>" #f))
  ("math:small < <" (math-bracket-open "<llangle>" "<rrangle>" #f))
  ("math:small >" (math-bracket-close "<rangle>" "<langle>" #f))
  ("math:small > var" (math-bracket-close "<rrangle>" "<llangle>" #f))
  ("math:small > >" (math-bracket-close "<rrangle>" "<llangle>" #f))
  ("math:small |" (math-bracket-open "|" "|" #f))
  ("math:small | var" (math-separator "|" #f))
  ("math:small | |" (math-bracket-open "<||>" "<||>" #f))
  ("math:small | | var" (math-separator "<||>" #f))
  ("math:small | | |" (math-bracket-open "<interleave>" "<interleave>" #f))
  ("math:small /" (math-bracket-open "/" "\\" #f))
  ("math:small / var" (math-separator "/" #f))
  ("math:small \\" (math-bracket-open "\\" "/" #f))
  ("math:small \\ var" (math-separator "\\" #f))
  ("math:small | ." (math-bracket-open "<lfloor>" "<rfloor>" #f))
  ("math:small . |" (math-bracket-close "<rfloor>" "<lfloor>" #f))
  ("math:small | `" (math-bracket-open "<lceil>" "<rceil>" #f))
  ("math:small ` |" (math-bracket-close "<rceil>" "<lceil>" #f))
  ("math:small | accent:grave" (math-bracket-open "<lceil>" "<rceil>" #f))
  ("math:small accent:grave |" (math-bracket-close "<rceil>" "<lceil>" #f))

  ("math:left (" (math-bracket-open "(" ")" #t))
  ("math:left )" (math-bracket-open ")" "(" #t))
  ("math:left [" (math-bracket-open "[" "]" #t))
  ("math:left ]" (math-bracket-open "]" "[" #t))
  ("math:left {" (math-bracket-open "{" "}" #t))
  ("math:left }" (math-bracket-open "}" "{" #t))
  ("math:left <" (math-bracket-open "<langle>" "<rangle>" #t))
  ("math:left >" (math-bracket-open "<rangle>" "<langle>" #t))
  ("math:left |" (math-bracket-open "|" "|" #t))
  ("math:left | |" (math-bracket-open "<||>" "<||>" #t))
  ("math:left /" (math-bracket-open "/" "\\" #t))
  ("math:left \\" (math-bracket-open "\\" "/" #t))
  ("math:left | ." (math-bracket-open "<lfloor>" "<rfloor>" #t))
  ("math:left | . var" (math-bracket-open "<lfloor>" "<rceil>" #t))
  ("math:left . |" (math-bracket-open "<rfloor>" "<lfloor>" #t))
  ("math:left | `" (math-bracket-open "<lceil>" "<rceil>" #t))
  ("math:left | `" (math-bracket-open "<lceil>" "<rfloor>" #t))
  ("math:left ` | var" (math-bracket-open "<rceil>" "<lceil>" #t))
  ("math:left | accent:grave" (math-bracket-open "<lceil>" "<rceil>" #t))
  ("math:left | accent:grave var" (math-bracket-open "<lceil>" "<rfloor>" #t))
  ("math:left accent:grave |" (math-bracket-open "<rceil>" "<lceil>" #t))
  ("math:left ." (math-bracket-open "<nobracket>" "<nobracket>" #t))

  ("math:middle (" (math-separator "(" #t))
  ("math:middle )" (math-separator ")" #t))
  ("math:middle [" (math-separator "[" #t))
  ("math:middle ]" (math-separator "]" #t))
  ("math:middle {" (math-separator "{" #t))
  ("math:middle }" (math-separator "}" #t))
  ("math:middle <" (math-separator "<langle>" #t))
  ("math:middle >" (math-separator "<rangle>" #t))
  ("math:middle |" (math-separator "|" #t))
  ("math:middle | |" (math-separator "<||>" #t))
  ("math:middle /" (math-separator "/" #t))
  ("math:middle \\" (math-separator "\\" #t))
  ("math:left | ." (math-separator "<lfloor>" #t))
  ("math:left . |" (math-separator "<rfloor>" #t))
  ("math:left | `" (math-separator "<lceil>" #t))
  ("math:left ` |" (math-separator "<rceil>" #t))
  ("math:left | accent:grave" (math-separator "<lceil>" #t))
  ("math:left accent:grave |" (math-separator "<rceil>" #t))
  ("math:middle ." (math-separator "<nobracket>" #t))

  ("math:right (" (math-bracket-close "(" ")" #t))
  ("math:right )" (math-bracket-close ")" "(" #t))
  ("math:right [" (math-bracket-close "[" "]" #t))
  ("math:right ]" (math-bracket-close "]" "[" #t))
  ("math:right {" (math-bracket-close "{" "}" #t))
  ("math:right }" (math-bracket-close "}" "{" #t))
  ("math:right <" (math-bracket-close "<langle>" "<rangle>" #t))
  ("math:right >" (math-bracket-close "<rangle>" "<langle>" #t))
  ("math:right |" (math-bracket-close "|" "|" #t))
  ("math:right | |" (math-bracket-close "<||>" "<||>" #t))
  ("math:right /" (math-bracket-close "/" "\\" #t))
  ("math:right \\" (math-bracket-close "\\" "/" #t))
  ("math:right | ." (math-bracket-close "<lfloor>" "<rfloor>" #t))
  ("math:right . |" (math-bracket-close "<rfloor>" "<lfloor>" #t))
  ("math:right | `" (math-bracket-close "<lceil>" "<rceil>" #t))
  ("math:right ` |" (math-bracket-close "<rceil>" "<lceil>" #t))
  ("math:right | accent:grave" (math-bracket-close "<lceil>" "<rceil>" #t))
  ("math:right accent:grave |" (math-bracket-close "<rceil>" "<lceil>" #t))
  ("math:right ." (math-bracket-close "<nobracket>" "<nobracket>" #t))

  ("(" (math-bracket-open "(" ")" 'default))
  ("( var" (math-bracket-open "<nobracket>" "<nobracket>" 'default))
  (")" (math-bracket-close ")" "(" 'default))
  ("[" (math-bracket-open "[" "]" 'default))
  ("[ var" (math-bracket-open "[" "[" 'default))
  ("[ var var" (math-bracket-open "]" "]" 'default))
  ("[ var var var" (math-bracket-open "]" "[" 'default))
  ("]" (math-bracket-close "]" "[" 'default))
  ("[ [" (twice (math-bracket-open "[" "]" 'default)))
  ("] ]" (twice (math-bracket-close "]" "[" 'default)))
  ("[ [ var" (math-bracket-open "<llbracket>" "<rrbracket>" 'default))
  ("] ] var" (math-bracket-close "<rrbracket>" "<llbracket>" 'default))
  ("{" (math-bracket-open "{" "}" 'default))
  ("{ var" (math-bracket-open "<langle>" "<rangle>" 'default))
  ("{ var var" (math-bracket-open "<llangle>" "<rrangle>" #f))
  ("{ {" (twice (math-bracket-open "{" "}" 'default)))
  ("{ { var" (math-bracket-open "<llangle>" "<rrangle>" #f))
  ("}" (math-bracket-close "}" "{" 'default))
  ("} var" (math-bracket-close "<rangle>" "<langle>" 'default))
  ("} var var" (math-bracket-close "<rrangle>" "<llangle>" #f))
  ("} }" (twice (math-bracket-close "}" "{" 'default)))
  ("} } var" (twice (math-bracket-close "<rrangle>" "<llangle>" #f)))
  ("|" (math-bracket-open "|" "|" 'default))
  ("| |" (math-bracket-open "<||>" "<||>" 'default))
  ("| | |" (math-bracket-open "<interleave>" "<interleave>" #f))
  ("| ." (math-bracket-open "<lfloor>" "<rfloor>" 'default))
  ("| . var" (math-bracket-open "<lfloor>" "<rceil>" 'default))
  (". |" (math-bracket-close "<rfloor>" "<lfloor>" 'default))
  ("| `" (math-bracket-open "<lceil>" "<rceil>" 'default))
  ("| ` var" (math-bracket-open "<lceil>" "<rfloor>" 'default))
  ("` |" (math-bracket-close "<rceil>" "<lceil>" 'default))
  ("| accent:grave" (math-bracket-open "<lceil>" "<rceil>" 'default))
  ("| accent:grave var" (math-bracket-open "<lceil>" "<rfloor>" 'default))
  ("accent:grave |" (math-bracket-close "<rceil>" "<lceil>" 'default))
  ("| -" (math-bracket-open "|" "|" 'default) (insert "-"))
  ("| =" (math-bracket-open "|" "|" 'default) (insert "="))
  ("| | -" (math-bracket-open "<||>" "<||>" 'default) (insert "-"))
  ("| | =" (math-bracket-open "<||>" "<||>" 'default) (insert "="))
  ("| | | -" (math-bracket-open "<interleave>" "<interleave>" 'default)
             (insert "-"))
  ("| | | =" (math-bracket-open "<interleave>" "<interleave>" 'default)
             (insert "="))
  ("- |" (insert "-") (math-bracket-open "|" "|" 'default))
  ("= |" (insert "=") (math-bracket-open "|" "|" 'default))
  ("- | |" (insert "-") (math-bracket-open "<||>" "<||>" 'default))
  ("= | |" (insert "=") (math-bracket-open "<||>" "<||>" 'default))
  ("- | | |" (insert "-")
             (math-bracket-open "<interleave>" "<interleave>" 'default))
  ("= | | |" (insert "=")
             (math-bracket-open "<interleave>" "<interleave>" 'default))
  ("| - |" (math-bracket-open "|" "|" 'default) (insert "-")
           (math-bracket-open "|" "|" 'default))

  ("<" "<less>")
  (">" "<gtr>")
  ("< /" "<nless>")
  ("> /" "<ngtr>")
  ("< . ." "<less><cdots><less>")
  ("> . ." "<gtr><cdots><gtr>")
  ("< =" "<leqslant>")
  ("> =" "<geqslant>")
  ("< = /" "<nleqslant>")
  ("> = /" "<ngeqslant>")
  ("< = . ." "<leqslant><cdots><leqslant>")
  ("> = . ." "<geqslant><cdots><geqslant>")
  ("< = var" "<leq>")
  ("> = var" "<geq>")
  ("< = var /" "<nleq>")
  ("> = var /" "<ngeq>")
  ("< = var . ." "<leq><cdots><leq>")
  ("> = var . ." "<geq><cdots><geq>")
  ("< <" "<ll>")
  ("< < <" "<lll>")
  ("> >" "<gg>")
  ("> > >" "<ggg>")
  ("< < . ." "<ll><cdots><ll>")
  ("< < < . ." "<lll><cdots><lll>")
  ("> > . ." "<gg><cdots><gg>")
  ("> > > . ." "<ggg><cdots><ggg>")
  ("< < =" "<lleq>")
  ("< < < =" "<llleq>")
  ("> > =" "<ggeq>")
  ("> > > =" "<gggeq>")
  ("< < = . ." "<lleq><cdots><lleq>")
  ("< < < = . ." "<llleq><cdots><llleq>")
  ("> > = . ." "<ggeq><cdots><ggeq>")
  ("> > > = . ." "<gggeq><cdots><gggeq>")
  ("< < /" "<nll>")
  ("< < < /" "<nlll>")
  ("> > /" "<ngg>")
  ("> > > /" "<nggg>")
  ("< < = /" "<nlleq>")
  ("< < < = /" "<nllleq>")
  ("> > = /" "<nggeq>")
  ("> > > = /" "<ngggeq>")
  ("< ." "<lessdot>")
  ("< . =" "<leqslantdot>")
  ("< . = var" "<leqdot>")
  ("< = ." "<leqslantdot>")
  ("< = . var" "<leqdot>")
  ("< = var ." "<leqdot>")
  (". >" "<gtrdot>")
  (". > =" "<dotgeqslant>")
  (". > = var" "<dotgeq>")

  ("< >" "<lessgtr>")
  ("< > var" "<diamondsuit>")
  ("< > var var" "<heartsuit>")
  ("< > var var var" "<spadesuit>")
  ("< > var var var var" "<clubsuit>")
  ("< > var var var var var" "<legeangle>")
  ("> <" "<gtrless>")
  ("> < var" "<join>")
  ("> < var var" "<geleangle>")
  ("< ~" "<lesssim>")
  ("< ~ ~" "<lessapprox>")
  ("> ~" "<gtrsim>")
  ("> ~ ~" "<gtrapprox>")
  ("> var ~" "<gtrsim>")
  ("> var ~ ~" "<gtrapprox>")
  ("< = var var" "<leqq>")
  ("> = var var" "<geqq>")
  ("< = var >" "<lesseqgtr>")
  ("> = var <" "<gtreqless>")
  ("< = var var >" "<lesseqqgtr>")
  ("> = var var <" "<gtreqqless>")
  ("< > /" "<nlessgtr>")
  ("> < /" "<ngtrless>")
  ("< ~ /" "<nlesssim>")
  ("< ~ / var" "<lnsim>")
  ("< ~ ~ /" "<nlessapprox>")
  ("< ~ ~ / var" "<lnapprox>")
  ("> ~ /" "<ngtrsim>")
  ("> ~ / var" "<gnsim>")
  ("> ~ ~ /" "<ngtrapprox>")
  ("> ~ ~ / var" "<gnapprox>")
  ("< = var var /" "<nleqq>")
  ("> = var var /" "<ngeqq>")
  ("< = var > /" "<nlesseqgtr>")
  ("> = var < /" "<ngtreqless>")
  ("< = var var > /" "<nlesseqqgtr>")
  ("> = var var < /" "<ngtreqqless>")
  ("< = var / var" "<lneq>")
  ("< = var var / var" "<lneqq>")
  ("< = var var / var var" "<lvertneqq>")
  ("> = var / var" "<gneq>")
  ("> = var var / var" "<gneqq>")
  ("> = var var / var var" "<gvertneqq>")

  ("< var" "<in>")
  ("> var" "<ni>")
  ("< var /" "<nin>")
  ("> var /" "<nni>")

  ("< var var" "<subset>")
  ("> var var" "<supset>")
  ("< var var . ." "<subset><cdots><subset>")
  ("> var var . ." "<supset><cdots><supset>")
  ("< var var /" "<nsubset>")
  ("> var var /" "<nsupset>")
  ("< var var =" "<subseteq>")
  ("> var var =" "<supseteq>")
  ("< var var = . ." "<subseteq><cdots><subseteq>")
  ("> var var = . ." "<supseteq><cdots><supseteq>")
  ("< var var = /" "<nsubseteq>")
  ("> var var = /" "<nsupseteq>")
  ("< var var = var" "<subseteqq>")
  ("> var var = var" "<supseteqq>")
  ("< var var = var . ." "<subseteqq><cdots><subseteqq>")
  ("> var var = var . ." "<supseteqq><cdots><supseteqq>")
  ("< var var = /" "<nsubseteq>")
  ("> var var = /" "<nsupseteq>")
  ("< var var = var /" "<nsubseteqq>")
  ("> var var = var /" "<nsupseteqq>")
  ("< var var = / var" "<subsetneq>")
  ("> var var = / var" "<supsetneq>")
  ("< var var = / var . ." "<subsetneq><cdots><subsetneq>")
  ("> var var = / var . ." "<supsetneq><cdots><supsetneq>")
  ("< var var = / var var" "<varsubsetneq>")
  ("> var var = / var var" "<varsupsetneq>")
  ("< var var = / var var . ." "<varsubsetneq><cdots><varsubsetneq>")
  ("> var var = / var var . ." "<varsupsetneq><cdots><varsupsetneq>")
  ("< var var = var / var" "<subsetneqq>")
  ("> var var = var / var" "<supsetneqq>")
  ("< var var = var / var . ." "<subsetneqq><cdots><subsetneqq>")
  ("> var var = var / var . ." "<supsetneqq><cdots><supsetneqq>")
  ("< var var = var / var var" "<varsubsetneqq>")
  ("> var var = var / var var" "<varsupsetneqq>")
  ("< var var = var / var var . ." "<varsubsetneqq><cdots><varsubsetneqq>")
  ("> var var = var / var var . ." "<varsupsetneqq><cdots><varsupsetneqq>")
  ("< var var +" "<subsetplus>")
  ("> var var +" "<supsetplus>")
  ("< var var + . ." "<subsetplus><cdots><subsetplus>")
  ("> var var + . ." "<supsetplus><cdots><supsetplus>")
  ("< var var + =" "<subsetpluseq>")
  ("> var var + =" "<supsetpluseq>")
  ("< var var = +" "<subsetpluseq>")
  ("> var var = +" "<supsetpluseq>")
  ("< var var + = . ." "<subsetpluseq><cdots><subsetpluseq>")
  ("> var var + = . ." "<supsetpluseq><cdots><supsetpluseq>")
  ("< var var = + . ." "<subsetpluseq><cdots><subsetpluseq>")
  ("> var var = + . ." "<supsetpluseq><cdots><supsetpluseq>")
  ("< var var ~" "<subsetsim>")
  ("> var var ~" "<supsetsim>")
  ("< var var ~ . ." "<subsetsim><cdots><subsetsim>")
  ("> var var ~ . ." "<supsetsim><cdots><supsetsim>")

  ("< var var var" "<prec>")
  ("> var var var" "<succ>")
  ("< var var var . ." "<prec><cdots><prec>")
  ("> var var var . ." "<succ><cdots><succ>")
  ("< var var var /" "<nprec>")
  ("> var var var /" "<nsucc>")
  ("< var var var =" "<preccurlyeq>")
  ("> var var var =" "<succcurlyeq>")
  ("< var var var = . ." "<preccurlyeq><cdots><preccurlyeq>")
  ("> var var var = . ." "<succcurlyeq><cdots><succcurlyeq>")
  ("< var var var = /" "<npreccurlyeq>")
  ("> var var var = /" "<nsucccurlyeq>")
  ("< var var var = var" "<preceq>")
  ("> var var var = var" "<succeq>")
  ("< var var var = var . ." "<preceq><cdots><preceq>")
  ("> var var var = var . ." "<succeq><cdots><succeq>")
  ("< var var var = var /" "<npreceq>")
  ("> var var var = var /" "<nsucceq>")
  ("< var var var = var / var" "<precneq>")
  ("> var var var = var / var" "<succneq>")
  ("< var var var = var var" "<preceqq>")
  ("> var var var = var var" "<succeqq>")
  ("< var var var = var var . ." "<preceqq><cdots><preceqq>")
  ("> var var var = var var . ." "<succeqq><cdots><succeqq>")
  ("< var var var = var var /" "<npreceqq>")
  ("> var var var = var var /" "<nsucceqq>")
  ("< var var var = var var / var" "<precneqq>")
  ("> var var var = var var / var" "<succneqq>")
  ("< var var var = var var / var var" "<precvertneqq>")
  ("> var var var = var var / var var" "<succvertneqq>")
  ("< var var var ~" "<precsim>")
  ("> var var var ~" "<succsim>")
  ("< var var var ~ ~" "<precapprox>")
  ("> var var var ~ ~" "<succapprox>")
  ("< var var var ~ . ." "<precsim><cdots><precsim>")
  ("> var var var ~ . ." "<succsim><cdots><succsim>")
  ("< var var var ~ ~ . ." "<precapprox><cdots><precapprox>")
  ("> var var var ~ ~ . ." "<succapprox><cdots><succapprox>")
  ("< var var var ~ /" "<nprecsim>")
  ("> var var var ~ /" "<nsuccsim>")
  ("< var var var ~ / var" "<precnsim>")
  ("> var var var ~ / var" "<succnsim>")
  ("< var var var ~ ~ /" "<nprecapprox>")
  ("> var var var ~ ~ /" "<nsuccapprox>")
  ("< var var var ~ ~ / var" "<precnapprox>")
  ("> var var var ~ ~ / var" "<succnapprox>")
  ("< var var var ." "<precdot>")
  ("< var var var . =" "<preccurlyeqdot>")
  ("< var var var . = var" "<preceqdot>")
  ("< var var var = ." "<preccurlyeqdot>")
  ("< var var var = var ." "<preceqdot>")
  ("< var var var = . var" "<preceqdot>")
  ("< . var" "<precdot>")
  ("< . var =" "<preccurlyeqdot>")
  ("< . var = var" "<preceqdot>")
  ("< . = var var" "<preccurlyeqdot>")
  ("< . = var var var" "<preceqdot>")
  (". > var" "<dotsucc>")
  (". > var =" "<dotsucccurlyeq>")
  (". > var = var" "<dotsucceq>")
  (". > = var var" "<dotsucccurlyeq>")
  (". > = var var var" "<dotsucceq>")

  ("< < var" "<precprec>")
  ("< < < var" "<precprecprec>")
  ("> > var" "<succsucc>")
  ("> > > var" "<succsuccsucc>")
  ("< < var . ." "<precprec><cdots><precprec>")
  ("> > var . ." "<succsucc><cdots><succsucc>")
  ("< < < var . ." "<precprecprec><cdots><precprecprec>")
  ("> > > var . ." "<succsuccsucc><cdots><succsuccsucc>")
  ("< < var =" "<precpreceq>")
  ("< < < var =" "<precprecpreceq>")
  ("> > var =" "<succsucceq>")
  ("> > > var =" "<succsuccsucceq>")
  ("< < var = . ." "<precpreceq><cdots><precpreceq>")
  ("> > var = . ." "<succsucceq><cdots><succsucceq>")
  ("< < < var = . ." "<precprecpreceq><cdots><precprecpreceq>")
  ("> > > var = . ." "<succsuccsucceq><cdots><succsuccsucceq>")
  ("< < var /" "<nprecprec>")
  ("< < < var /" "<nprecprecprec>")
  ("> > var /" "<nsuccsucc>")
  ("> > > var /" "<nsuccsuccsucc>")
  ("< < var = /" "<nprecpreceq>")
  ("< < < var = /" "<nprecprecpreceq>")
  ("> > var = /" "<nsuccsucceq>")
  ("> > > var = /" "<nsuccsuccsucceq>")

  ("< var var var var" "<sqsubset>")
  ("> var var var var" "<sqsupset>")
  ("< var var var var . ." "<sqsubset><cdots><sqsubset>")
  ("> var var var var . ." "<sqsupset><cdots><sqsupset>")
  ("< var var var var /" "<nsqsubset>")
  ("> var var var var /" "<nsqsupset>")
  ("< var var var var =" "<sqsubseteq>")
  ("> var var var var =" "<sqsupseteq>")
  ("< var var var var = . ." "<sqsubseteq><cdots><sqsubseteq>")
  ("> var var var var = . ." "<sqsupseteq><cdots><sqsupseteq>")
  ("< var var var var = var" "<sqsubseteqq>")
  ("> var var var var = var" "<sqsupseteqq>")
  ("< var var var var = var . ." "<sqsubseteqq><cdots><sqsubseteqq>")
  ("> var var var var = var . ." "<sqsupseteqq><cdots><sqsupseteqq>")
  ("< var var var var = /" "<nsqsubseteq>")
  ("> var var var var = /" "<nsqsupseteq>")
  ("< var var var var = / var" "<sqsubsetneq>")
  ("> var var var var = / var" "<sqsupsetneq>")
  ("< var var var var = / var var" "<varsqsubsetneq>")
  ("> var var var var = / var var" "<varsqsupsetneq>")
  ("< var var var var = var /" "<nsqsubseteqq>")
  ("> var var var var = var /" "<nsqsupseteqq>")
  ("< var var var var = var / var" "<sqsubsetneqq>")
  ("> var var var var = var / var" "<sqsupsetneqq>")
  ("< var var var var = var / var var" "<varsqsubsetneqq>")
  ("> var var var var = var / var var" "<varsqsupsetneqq>")

  ("< < var var" "<Subset>")
  ("> > var var" "<Supset>")
  ("< < var var . ." "<Subset><cdots><Subset>")
  ("> > var var . ." "<Supset><cdots><Supset>")

  ("< var var var var var" "<leangle>")
  ("> var var var var var" "<geangle>")
  ("< var var var var var =" "<leqangle>")
  ("> var var var var var =" "<geqangle>")
  
  ("< var var var var var var" (math-bracket-open "<langle>" "<rangle>" 'default))
  ("> var var var var var var" (math-bracket-close "<rangle>" "<langle>" 'default))
  ("< < var var var" (math-bracket-open "<llangle>" "<rrangle>" 'default))
  ("> > var var var" (math-bracket-close "<rrangle>" "<llangle>" 'default))

  ("- < var" "<lebar>")
  ("> - var" "<gebar>")
  
  ("- >" "<rightarrow>")
  ("- > var" "<downarrow>")
  ("- > var var" "<uparrow>")
  ("- > var var var" "<searrow>")
  ("- > var var var var" "<nearrow>")
  ("- > . ." "<rightarrow><cdots><rightarrow>")
  ("< -" "<leftarrow>")
  ("< - var" "<uparrow>")
  ("< - var var" "<downarrow>")
  ("< - var var var" "<nwarrow>")
  ("< - var var var var" "<swarrow>")
  ("< - . ." "<leftarrow><cdots><leftarrow>")
  ("< - >" "<leftrightarrow>")
  ("< - > var" "<updownarrow>")
  ("< - > . ." "<leftrightarrow><cdots><leftrightarrow>")
  ("- -" "<longminus>")
  ("- - var" "<longdownminus>")
  ("- - >" "<longrightarrow>")
  ("- - > var" "<longdownarrow>")
  ("- - > var var" "<longuparrow>")
  ("- - > . ." "<longrightarrow><cdots><longrightarrow>")
  ("< - -" "<longleftarrow>")
  ("< - - var" "<longuparrow>")
  ("< - - var var" "<longdownarrow>")
  ("< - - . ." "<longleftarrow><cdots><longleftarrow>")
  ("< - - >" "<longleftrightarrow>")
  ("< - - > var" "<longupdownarrow>")
  ("< - - > . ." "<longleftrightarrow><cdots><longleftrightarrow>")
  ("= >" "<Rightarrow>")
  ("= > var" "<Downarrow>")
  ("= > var var" "<Uparrow>")
  ("= > . ." "<Rightarrow><cdots><Rightarrow>")
  ("< = var var var" "<Leftarrow>")
  ("< = var var var . ." "<Leftarrow><cdots><Leftarrow>")
  ("< = >" "<Leftrightarrow>")
  ("< = > var" "<Updownarrow>")
  ("< = > . ." "<Leftrightarrow><cdots><Leftrightarrow>")
  ("= =" "<longequal>")
  ("= = var" "<longdownequal>")
  ("= = >" "<Longrightarrow>")
  ("= = > var" "<Longdownarrow>")
  ("= = > var var" "<Longuparrow>")
  ("= = > . ." "<Longrightarrow><cdots><Longrightarrow>")
  ("< = =" "<Longleftarrow>")
  ("< = = var" "<Longuparrow>")
  ("< = = var var" "<Longdownarrow>")
  ("< = = . ." "<Longleftarrow><cdots><Longleftarrow>")
  ("< = = >" "<Longleftrightarrow>")
  ("< = = > var" "<Longupdownarrow>")
  ("< = = > . ." "<Longleftrightarrow><cdots><Longleftrightarrow>")
  ("= var var >" "<Rrightarrow>")
  ("= > var var var" "<Rrightarrow>")
  ("< = var var var var" "<Lleftarrow>")
  ("< = var var var var >" "<LRleftrightarrow>")
  ("< = > var var" "<LRleftrightarrow>")
  ("= = var var" "<longequiv>")
  ("= = var var >" "<Llongrightarrow>")
  ("= = > var var var" "<Llongrightarrow>")
  ("< = = var var var" "<Llongleftarrow>")
  ("< = = var var var >" "<LRleftrightarrow>")
  ("< = = > var var" "<Llongleftrightarrow>")
  
  ("- / var" "<rightharpoondown>")
  ("- / var var" "<rightharpoonup>")
  ("- / var var var" "<downharpoonleft>")
  ("- / var var var var" "<downharpoonright>")
  ("- / var var var var var" "<upharpoonright>")
  ("- / var var var var var var" "<upharpoonleft>")
  ("/ - var" "<leftharpoonup>")
  ("/ - var var" "<leftharpoondown>")
  ("/ - var var var" "<upharpoonright>")
  ("/ - var var var var" "<upharpoonleft>")
  ("/ - var var var var var" "<downharpoonleft>")
  ("/ - var var var var var var" "<downharpoonright>")
  ("- - / var" "<longrightharpoondown>")
  ("- - / var var" "<longrightharpoonup>")
  ("/ - - var" "<longleftharpoonup>")
  ("/ - - var var" "<longleftharpoondown>")
  ("/ - var -" "<longleftharpoonup>")
  ("/ - var - var" "<longleftharpoondown>")
  ("/ - var var -" "<longleftharpoondown>")
  ("| var - >" "<mapsto>")
  ("| var - > var" "<hookrightarrow>")
  ("| var - > var var" "<mapsdown>")
  ("| var - > var var var" "<hookdownarrow>")
  ("| var - > var var var var" "<mapsup>")
  ("| var - > var var var var var" "<hookuparrow>")
  ("| var - - >" "<longmapsto>")
  ("| var - - > var" "<longhookrightarrow>")
  ("| var - - > var var" "<longmapsdown>")
  ("| var - - > var var var" "<longhookdownarrow>")
  ("| var - - > var var var var" "<longmapsup>")
  ("| var - - > var var var var var" "<longhookuparrow>")
  ("| - >" "<mapsto>")
  ("| - > var" "<hookrightarrow>")
  ("| - > var var" "<mapsdown>")
  ("| - > var var var" "<hookdownarrow>")
  ("| - > var var var var" "<mapsup>")
  ("| - > var var var var var" "<hookuparrow>")
  ("| - - >" "<longmapsto>")
  ("| - - > var" "<longhookrightarrow>")
  ("| - - > var var" "<longmapsdown>")
  ("| - - > var var var" "<longhookdownarrow>")
  ("| - - > var var var var" "<longmapsup>")
  ("| - - > var var var var var" "<longhookuparrow>")
  ("< - |" "<mapsfrom>")
  ("< - | var" "<hookleftarrow>")
  ("< - | var var" "<mapsup>")
  ("< - | var var var" "<hookuparrow>")
  ("< - | var var var var" "<mapsdown>")
  ("< - | var var var var var" "<hookdownarrow>")
  ("< - - |" "<longmapsfrom>")
  ("< - - | var" "<longhookleftarrow>")
  ("< - - | var var" "<longmapsup>")
  ("< - - | var var var" "<longhookuparrow>")
  ("< - - | var var var var" "<longmapsdown>")
  ("< - - | var var var var var" "<longhookdownarrow>")
  ("~ >" "<rightsquigarrow>")
  ("~ > var" "<downsquigarrow>")
  ("~ > var var" "<upsquigarrow>")
  ("~ > . ." "<rightsquigarrow><cdots><rightsquigarrow>")
  ("< ~ var" "<leftsquigarrow>")
  ("< ~ var var" "<upsquigarrow>")
  ("< ~ var var var" "<downsquigarrow>")
  ("< ~ . ." "<leftsquigarrow><cdots><leftsquigarrow>")
  ("< ~ >" "<leftrightsquigarrow>")
  ("< ~ > var" "<updownsquigarrow>")
  ("< ~ > . ." "<leftrightsquigarrow><cdots><leftrightsquigarrow>")
  ("< - <" "<leftarrowtail>")
  ("> - >" "<rightarrowtail>")
  ("- > - >" "<rightrightarrows>")
  ("- > - > var" "<downdownarrows>")
  ("- > - > var var" "<upuparrows>")
  ("- > - > - >" "<threerightarrows>")
  ("- > - > - > - >" "<fourrightarrows>")
  ("< - < -" "<leftleftarrows>")
  ("< - < - var" "<upuparrows>")
  ("< - < - var var" "<downdownarrows>")
  ("< - < - < -" "<threeleftarrows>")
  ("< - < - < - < -" "<fourleftarrows>")
  ("- > < -" "<rightleftarrows>")
  ("- > < - var" "<rightleftharpoons>")
  ("- - > - >" "<longrightrightarrows>")
  ("- - > - - >" "<longrightrightarrows>")
  ("- - > < -" "<longrightleftarrows>")
  ("- - > < - var" "<longrightleftharpoons>")
  ("- - > < - -" "<longrightleftarrows>")
  ("- - > < - - var" "<longrightleftharpoons>")
  ("- - > - > - >" "<longthreerightarrows>")
  ("- - > - - > - - >" "<longthreerightarrows>")
  ("- - > - > - > - >" "<longfourrightarrows>")
  ("- - > - - > - - > - - >" "<longfourrightarrows>")
  ("< - - > var var" "<leftrightarrows>")
  ("< - - > var var var" "<leftrightharpoons>")
  ("< - - < -" "<longleftleftarrows>")
  ("< - - < - -" "<longleftleftarrows>")
  ("< - - < - < -" "<longthreeleftarrows>")
  ("< - - < - - < - -" "<longthreeleftarrows>")
  ("< - - < - < - < -" "<longfourleftarrows>")
  ("< - - < - - < - - < - -" "<longfourleftarrows>")
  ("< - - - >" "<longleftrightarrows>")
  ("< - - - > var" "<longleftrightharpoons>")
  ("< - - - - >" "<longleftrightarrows>")
  ("< - - - - > var" "<longleftrightharpoons>")
  ("- > >" "<twoheadrightarrow>")
  ("< < -" "<twoheadleftarrow>")
  ("- - > >" "<longtwoheadrightarrow>")
  ("< < - -" "<longtwoheadleftarrow>")
  ("- > /" "<nrightarrow>")
  ("< - /" "<nleftarrow>")
  ("< - > /" "<nleftrightarrow>")
  ("= > /" "<nRightarrow>")
  ("< = var var var /" "<nLeftarrow>")
  ("< = > /" "<nLeftrightarrow>")
  ("< - > -" "<leftrightarroweq>")
  ("- | >" "<rightarrowtriangle>")
  ("< | -" "<leftarrowtriangle>")
  ("< | - | >" "<leftrightarrowtriangle>")
  ("| - | >" "<longmapstotriangle>")
  ("| var - | >" "<longmapstotriangle>")
  ("- - | >" "<longrightarrowtriangle>")
  ("< | - -" "<longleftarrowtriangle>")
  ("< | - - | >" "<longleftrightarrowtriangle>")
  ("| - - | >" "<longmapstotriangle>")
  ("| var - - | >" "<longmapstotriangle>")
  ("< - < var" "<leftprec>")
  ("> var - >" "<succright>")
  ("< - < var =" "<leftpreceq>")
  ("> var = - >" "<succeqright>")
  ("< - @" "<looparrowleft>")
  ("@ - >" "<looparrowright>")

  ("- > !" "<rightarrowlim>")
  ("< - !" "<leftarrowlim>")
  ("< - > !" "<leftrightarrowlim>")
  ("| - > !" "<mapstolim>")
  ("| var - > !" "<mapstolim>")
  ("- - > !" "<longrightarrowlim>")
  ("< - - !" "<longleftarrowlim>")
  ("< - - > !" "<longleftrightarrowlim>")
  ("| - - > !" "<longmapstolim>")
  ("| var - - > !" "<longmapstolim>")
  ("~ > !" "<rightsquigarrowlim>")
  ("< ~ !" "<leftsquigarrowlim>")
  ("< ~ > !" "<leftrightsquigarrowlim>")
  ("= !" "<equallim>")
  ("= = !" "<longequallim>")
  ("= = var var !" "<longequivlim>")
  ("= > !" "<Rightarrowlim>")
  ("< = !" "<Leftarrowlim>")
  ("< = > !" "<Leftrightarrowlim>")
  ("= = > !" "<Longrightarrowlim>")
  ("< = = !" "<Longleftarrowlim>")
  ("< = = > !" "<Longleftrightarrowlim>")

  ("- ^" (make-long-arrow "<minus>"))
  ("- > ^" (make-long-arrow "<rightarrow>"))
  ("- @ ^" (make-long-arrow "<multimap>"))
  ("< - ^" (make-long-arrow "<leftarrow>"))
  ("< - > ^" (make-long-arrow "<leftrightarrow>"))
  ("| - > ^" (make-long-arrow "<mapsto>"))
  ("| var - > ^" (make-long-arrow "<mapsto>"))
  ("| - > var ^" (make-long-arrow "<hookrightarrow>"))
  ("| var - > var ^" (make-long-arrow "<hookrightarrow>"))
  ("< - | ^" (make-long-arrow "<mapsfrom>"))
  ("< - | var ^" (make-long-arrow "<hookleftarrow>"))
  ("- > > ^" (make-long-arrow "<twoheadrightarrow>"))
  ("< < - ^" (make-long-arrow "<twoheadleftarrow>"))
  ("- / var ^" (make-long-arrow "<rightharpoondown>"))
  ("- / var var ^" (make-long-arrow "<rightharpoonup>"))
  ("/ - var ^" (make-long-arrow "<leftharpoonup>"))
  ("/ - var var ^" (make-long-arrow "<leftharpoondown>"))
  ("= ^" (make-long-arrow "<equal>"))
  ("= > ^" (make-long-arrow "<Rightarrow>"))
  ("< = ^" (make-long-arrow "<Leftarrow>"))
  ("< = > ^" (make-long-arrow "<Leftrightarrow>"))
  ("= var var ^" (make-long-arrow "<equiv>"))
  ("= var var > ^" (make-long-arrow "<Rrightarrow>"))
  ("= > var var var ^" (make-long-arrow "<Rrightarrow>"))
  ("< = var var var var ^" (make-long-arrow "<Lleftarrow>"))
  ("< = var var var var > ^" (make-long-arrow "<LRleftrightarrow>"))
  ("< = > var var ^" (make-long-arrow "<LRleftrightarrow>"))
  ("@ - ^" (make-long-arrow "<mapmulti>"))
  ("- > - > ^" (make-long-arrow "<rightrightarrows>"))
  ("< - < - ^" (make-long-arrow "<leftleftarrows>"))
  ("- > < - ^" (make-long-arrow "<rightleftarrows>"))
  ("< - - > var var ^" (make-long-arrow "<leftrightarrows>"))
  ("- > - > - > ^" (make-long-arrow "<threerightarrows>"))
  ("< - < - < - ^" (make-long-arrow "<threeleftarrows>"))
  ("- > - > - > - > ^" (make-long-arrow "<fourrightarrows>"))
  ("< - < - < - < - ^" (make-long-arrow "<fourleftarrows>"))

  ("- - ^" (make-long-arrow "<minus>"))
  ("- - > ^" (make-long-arrow "<rightarrow>"))
  ("- - @ ^" (make-long-arrow "<multimap>"))
  ("< - - ^" (make-long-arrow "<leftarrow>"))
  ("< - - > ^" (make-long-arrow "<leftrightarrow>"))
  ("< - - > var var var ^" (make-long-arrow "<leftrightharpoons>"))
  ("< - - - > var ^" (make-long-arrow "<leftrightharpoons>"))
  ("< - - - - > var ^" (make-long-arrow "<leftrightharpoons>"))
  ("- > < - var ^" (make-long-arrow "<rightleftharpoons>"))
  ("- - > < - var ^" (make-long-arrow "<rightleftharpoons>"))
  ("- - > < - - var ^" (make-long-arrow "<rightleftharpoons>"))
  ("| - - > ^" (make-long-arrow "<mapsto>"))
  ("| var - - > ^" (make-long-arrow "<mapsto>"))
  ("| - - > var ^" (make-long-arrow "<hookrightarrow>"))
  ("| var - - > var ^" (make-long-arrow "<hookrightarrow>"))
  ("< - - | ^" (make-long-arrow "<mapsfrom>"))
  ("< - - | var ^" (make-long-arrow "<hookleftarrow>"))
  ("- - > > ^" (make-long-arrow "<twoheadrightarrow>"))
  ("< < - - ^" (make-long-arrow "<twoheadleftarrow>"))
  ("- - / var ^" (make-long-arrow "<rightharpoondown>"))
  ("- - / var var ^" (make-long-arrow "<rightharpoonup>"))
  ("/ - - var ^" (make-long-arrow "<leftharpoonup>"))
  ("/ - var - ^" (make-long-arrow "<leftharpoonup>"))
  ("/ - - var var ^" (make-long-arrow "<leftharpoondown>"))
  ("/ - var - var ^" (make-long-arrow "<leftharpoondown>"))
  ("/ - var var - ^" (make-long-arrow "<leftharpoondown>"))
  ("= = ^" (make-long-arrow "<equal>"))
  ("= = > ^" (make-long-arrow "<Rightarrow>"))
  ("< = = ^" (make-long-arrow "<Leftarrow>"))
  ("< = = > ^" (make-long-arrow "<Leftrightarrow>"))
  ("= = var var ^" (make-long-arrow "<equiv>"))
  ("= = var var > ^" (make-long-arrow "<Rrightarrow>"))
  ("= = > var var var ^" (make-long-arrow "<Rrightarrow>"))
  ("< = = var var var ^" (make-long-arrow "<Lleftarrow>"))
  ("< = = var var var > ^" (make-long-arrow "<LRleftrightarrow>"))
  ("< = = > var var ^" (make-long-arrow "<LRleftrightarrow>"))
  ("@ - - ^" (make-long-arrow "<mapmulti>"))
  ("- - > - > ^" (make-long-arrow "<rightrightarrows>"))
  ("- - > - - > ^" (make-long-arrow "<rightrightarrows>"))
  ("< - - < - ^" (make-long-arrow "<leftleftarrows>"))
  ("< - - < - - ^" (make-long-arrow "<leftleftarrows>"))

  ("- _" (make-long-arrow* "<minus>"))
  ("- > _" (make-long-arrow* "<rightarrow>"))
  ("- @ _" (make-long-arrow* "<multimap>"))
  ("< - _" (make-long-arrow* "<leftarrow>"))
  ("< - > _" (make-long-arrow* "<leftrightarrow>"))
  ("| - > _" (make-long-arrow* "<mapsto>"))
  ("| var - > _" (make-long-arrow* "<mapsto>"))
  ("| - > var _" (make-long-arrow* "<hookrightarrow>"))
  ("| var - > var _" (make-long-arrow* "<hookrightarrow>"))
  ("< - | _" (make-long-arrow* "<mapsfrom>"))
  ("< - | var _" (make-long-arrow* "<hookleftarrow>"))
  ("- > > _" (make-long-arrow* "<twoheadrightarrow>"))
  ("< < - _" (make-long-arrow* "<twoheadleftarrow>"))
  ("- / var _" (make-long-arrow* "<rightharpoondown>"))
  ("- / var var _" (make-long-arrow* "<rightharpoonup>"))
  ("/ - var _" (make-long-arrow* "<leftharpoonup>"))
  ("/ - var var _" (make-long-arrow* "<leftharpoondown>"))
  ("= _" (make-long-arrow* "<equal>"))
  ("= > _" (make-long-arrow* "<Rightarrow>"))
  ("< = _" (make-long-arrow* "<Leftarrow>"))
  ("< = > _" (make-long-arrow* "<Leftrightarrow>"))
  ("= var var _" (make-long-arrow* "<equiv>"))
  ("= var var > _" (make-long-arrow* "<Rrightarrow>"))
  ("= > var var var _" (make-long-arrow* "<Rrightarrow>"))
  ("< = var var var var _" (make-long-arrow* "<Lleftarrow>"))
  ("< = var var var var > _" (make-long-arrow* "<LRleftrightarrow>"))
  ("< = > var var _" (make-long-arrow* "<LRleftrightarrow>"))
  ("@ - _" (make-long-arrow* "<mapmulti>"))
  ("- > - > _" (make-long-arrow* "<rightrightarrows>"))
  ("< - < - _" (make-long-arrow* "<leftleftarrows>"))
  ("- > < - _" (make-long-arrow* "<rightleftarrows>"))
  ("< - - > var var _" (make-long-arrow* "<leftrightarrows>"))
  ("- > - > - > _" (make-long-arrow* "<threerightarrows>"))
  ("< - < - < - _" (make-long-arrow* "<threeleftarrows>"))
  ("- > - > - > - > _" (make-long-arrow* "<fourrightarrows>"))
  ("< - < - < - < - _" (make-long-arrow* "<fourleftarrows>"))

  ("- - _" (make-long-arrow* "<minus>"))
  ("- - > _" (make-long-arrow* "<rightarrow>"))
  ("- - @ _" (make-long-arrow* "<multimap>"))
  ("< - - _" (make-long-arrow* "<leftarrow>"))
  ("< - - > _" (make-long-arrow* "<leftrightarrow>"))
  ("< - - > var var var _" (make-long-arrow* "<leftrightharpoons>"))
  ("< - - - > var _" (make-long-arrow* "<leftrightharpoons>"))
  ("< - - - - > var _" (make-long-arrow* "<leftrightharpoons>"))
  ("- > < - var _" (make-long-arrow* "<rightleftharpoons>"))
  ("- - > < - var _" (make-long-arrow* "<rightleftharpoons>"))
  ("- - > < - - var _" (make-long-arrow* "<rightleftharpoons>"))
  ("| - - > _" (make-long-arrow* "<mapsto>"))
  ("| var - - > _" (make-long-arrow* "<mapsto>"))
  ("| - - > var _" (make-long-arrow* "<hookrightarrow>"))
  ("| var - - > var _" (make-long-arrow* "<hookrightarrow>"))
  ("< - - | _" (make-long-arrow* "<mapsfrom>"))
  ("< - - | var _" (make-long-arrow* "<hookleftarrow>"))
  ("- - > > _" (make-long-arrow* "<twoheadrightarrow>"))
  ("< < - - _" (make-long-arrow* "<twoheadleftarrow>"))
  ("- - / var _" (make-long-arrow* "<rightharpoondown>"))
  ("- - / var var _" (make-long-arrow* "<rightharpoonup>"))
  ("/ - - var _" (make-long-arrow* "<leftharpoonup>"))
  ("/ - var - _" (make-long-arrow* "<leftharpoonup>"))
  ("/ - - var var _" (make-long-arrow* "<leftharpoondown>"))
  ("/ - var - var _" (make-long-arrow* "<leftharpoondown>"))
  ("/ - var var - _" (make-long-arrow* "<leftharpoondown>"))
  ("= = _" (make-long-arrow* "<equal>"))
  ("= = > _" (make-long-arrow* "<Rightarrow>"))
  ("< = = _" (make-long-arrow* "<Leftarrow>"))
  ("< = = > _" (make-long-arrow* "<Leftrightarrow>"))
  ("= = var var _" (make-long-arrow* "<equiv>"))
  ("= = var var > _" (make-long-arrow* "<Rrightarrow>"))
  ("= = > var var var _" (make-long-arrow* "<Rrightarrow>"))
  ("< = = var var var _" (make-long-arrow* "<Lleftarrow>"))
  ("< = = var var var > _" (make-long-arrow* "<LRleftrightarrow>"))
  ("< = = > var var _" (make-long-arrow* "<LRleftrightarrow>"))
  ("@ - - _" (make-long-arrow* "<mapmulti>"))
  ("- - > - > _" (make-long-arrow* "<rightrightarrows>"))
  ("- - > - - > _" (make-long-arrow* "<rightrightarrows>"))
  ("< - - < - _" (make-long-arrow* "<leftleftarrows>"))
  ("< - - < - - _" (make-long-arrow* "<leftleftarrows>"))

  ("@" "<circ>")
  ("@ /" "<varnothing>")
  ("@ +" "<oplus>")
  ("@ + . ." "<oplus><cdots><oplus>")
  ("@ -" "<ominus>")
  ("@ - var" "<mapmulti>")
  ("@ - var -" "<longmapmulti>")
  ("@ - -" "<longmapmulti>")
  ("@ ." "<odot>")
  ("@ . ." "<circ><cdots><circ>")
  ("@ :" "<oover>")
  ("@ x" "<otimes>")
  ("@ x . ." "<otimes><cdots><otimes>")
  ("@ *" "<otimes>")
  ("@ * . ." "<otimes><cdots><otimes>")
  ("@ * var" "<oast>")
  ("@ x var . ." "<oast><cdots><oast>")
  ("@ R" "<circledR>")
  ("@ S" "<circledS>")
  ("@ / var" "<oslash>")
  ("@ \\" "<obslash>")
  ("@ <" "<olessthan>")
  ("@ < var" "<circlearrowleft>")
  ("@ >" "<ogreaterthan>")
  ("@ > var" "<circlearrowright>")
  ("@ &" "<owedge>")
  ("@ |" "<obar>")
  ("@ | var" "<ovee>")
  ("@ v" "<ovee>")
  ("@ @" "<infty>")
  ("@ @ var" "<varocircle>")
  ("@ @ var var" "<propto>")
  ("- @ @" "-<infty>")
  ("@ var" "<box>")
  ("@ var +" "<boxplus>")
  ("@ var -" "<boxminus>")
  ("@ var x" "<boxtimes>")
  ("@ var *" "<boxtimes>")
  ("@ var * var" "<boxast>")
  ("@ var ." "<boxdot>")
  ("@ var /" "<boxslash>")
  ("@ var \\" "<boxbslash>")
  ("@ var @" "<boxcircle>")
  ("@ var @ var" "<boxbox>")
  ("@ var |" "<boxbar>")
  ("@ var var" "<bullet>")
  ("@ var var var" "<blacksquare>")
  ("@ var var var var" "<vartriangle>")
  ("@ var var var var var" "<blacktriangle>")

  ("= var" "<asymp>")
  ("= var . ." "<asymp><cdots><asymp>")
  ("= var var" "<equiv>")
  ("= var var . ." "<equiv><cdots><equiv>")
  ("= var var var" "<asympasymp>")
  ("= var var var . ." "<asympasymp><cdots><asympasymp>")
  ("= var var var var" "<simsim>")
  ("= var var var var . ." "<simsim><cdots><simsim>")
  ("= var var var var var" "<downequal>")
  ("= . ." "=<cdots>=")
  ("= :" "<backassign>")
  ("~" "<sim>")
  ("~ var" "<backsim>")
  ("~ . ." "<sim><cdots><sim>")
  ("~ ~" "<approx>")
  ("~ ~ . ." "<approx><cdots><approx>")
  ("~ ~ var" "<Bumpeq>")
  ("~ ~ var . ." "<Bumpeq><cdots><Bumpeq>")
  ("~ ~ -" "<approxeq>")
  ("~ ~ - . ." "<approxeq><cdots><approxeq>")
  ("~ ~ - /" "<napproxeq>")
  ("~ ~ =" "<approxeq>")
  ("~ ~ = . ." "<approxeq><cdots><approxeq>")
  ("~ ~ = /" "<napproxeq>")
  ("~ ~ ~" "<triplesim>")
  ("~ ~ ~ . ." "<triplesim><cdots><triplesim>")
  ("~ ~ ~ /" "<ntriplesim>")
  ("~ -" "<simeq>")
  ("~ - . ." "<simeq><cdots><simeq>")
  ("~ - var" "<backsimeq>")
  ("~ - var . ." "<backsimeq><cdots><backsimeq>")
  ("~ - var var" "<bumpeq>")
  ("~ - var var . ." "<bumpeq><cdots><bumpeq>")
  ("~ =" "<cong>")
  ("~ = . ." "<cong><cdots><cong>")
  ("= /" "<neq>")
  ("= var /" "<nasymp>")
  ("= var var /" "<nequiv>")
  ("= var var var /" "<nasympasymp>")
  ("= var var var var /" "<nsimsim>")
  ("~ /" "<nsim>")
  ("~ ~ /" "<napprox>")
  ("~ - /" "<nsimeq>")
  ("~ = /" "<ncong>"))

(kbd-map
  (:mode in-math-or-hybrid?)
  ("/ \\" "<wedge>")
  ("/ \\ var " "<cap>")
  ("/ \\ var var" "<sqcap>")
  ("/ \\ var var var" "<product>")
  ("/ \\ var var var var" "<curlywedge>")
  ("/ \\ var var var var var" "<curlywedgeuparrow>")
  ("/ \\ var var var var var var" "<curlywedgedownarrow>")
  ("/ \\ var var var var var var var" (begin (insert "/") (make-hybrid)))
  ("- / \\" "<barwedge>")
  ("\\ /" "<vee>")
  ("\\ / var" "<cup>")
  ("\\ / var +" "<uplus>")
  ("\\ / var var" "<sqcup>")
  ("\\ / var var var" "<amalg>")
  ("\\ / var var var var" "<curlyvee>")
  ("\\ / var var var var var" "<curlyveedownarrow>")
  ("\\ / var var var var var var" "<curlyveeuparrow>")
  ("\\ / var var var var var var var" (begin (make-hybrid) (insert "/")))
  ("\\ / -" "<veebar>"))

(kbd-map
  (:mode in-math?)
  ("# var" "<sharp>")
  ("# var var" "<natural>")
  ("# var var var" "<flat>")
  ("&" "<wedge>")
  ("& . ." "<wedge><cdots><wedge>")
  ("& var" "<cap>")
  ("& var . ." "<cap><cdots><cap>")
  ("& var var" "<sqcap>")
  ("& var var . ." "<sqcap><cdots><sqcap>")
  ("& var var var" "<product>")
  ("& var var var . ." "<product><cdots><product>")
  ("& var var var var" "<curlywedge>")
  ("& var var var var var . ." "<curlywedge><cdots><curlywedge>")
  ("& var var var var var" "<curlywedgeuparrow>")
  ("& var var var var var var" "<curlywedgedownarrow>")
  ("& var var var var var var var" "&")
  ("- &" "<barwedge>")
  ("- & . ." "<barwedge><cdots><barwedge>")
  ("%" "<vee>")
  ("% . ." "<vee><cdots><vee>")
  ("% var" "<cup>")
  ("% var . ." "<cup><cdots><cup>")
  ("% var +" "<uplus>")
  ("% var + . ." "<uplus><cdots><uplus>")
  ("% var + +" "<uplus><cdots><uplus>")
  ("% var var" "<sqcup>")
  ("% var var . ." "<sqcup><cdots><sqcup>")
  ("% var var var" "<amalg>")
  ("% var var var . ." "<amalg><cdots><amalg>")
  ("% var var var var" "<curlyvee>")
  ("% var var var var . ." "<curlyvee><cdots><curlyvee>")
  ("% var var var var var" "<curlyveedownarrow>")
  ("% var var var var var var" "<curlyveeuparrow>")
  ("% var var var var var var var" "<permil>")
  ("% var var var var var var var var" "%")
  ("% -" "<veebar>")
  ("% - . ." "<veebar><cdots><veebar>")

  ("| /" "<nmid>")
  ("| / var" "<ndivides>")
  ("| var" "|")
  ("| var /" "<nmid>")
  ("| var / var" "<ndivides>")
  ("| var var" (math-separator "|" 'default))
  ("| var var/" "<nmid>")
  ("| var var var" "<shortmid>")
  ("| var var var /" "<nshortmid>")
  ("| var var var var" "<barsuchthat>")
  ("| var var var var var" "<divides>")
  ("| var var var var var /" "<ndivides>")
  ("| | var" "<||>")
  ("| | var /" "<nparallel>")
  ("| | var var" (math-separator "<||>" 'default))
  ("| | var var /" "<nparallel>")
  ("| | var var var" "<shortparallel>")
  ("| | var var var /" "<nshortparallel>")
  ("| | var var var var" "<varparallel>")
  ("| | var var var var /" "<nvarparallel>")
  ("| | | var" "<interleave>")

  ("| - var" "<vdash>")
  ("| - var -" "<longvdash>")
  ("| - -" "<longvdash>")
  ("| var -" "<vdash>")
  ("| var - -" "<longvdash>")
  ("| | - var" "<Vdash>")
  ("| | - var -" "<longVdash>")
  ("| | - -" "<longVdash>")
  ("| | var -" "<Vdash>")
  ("| | var - -" "<longVdash>")
  ("| | | - var" "<Vvdash>")
  ("| | | - var -" "<longVvdash>")
  ("| | | - -" "<longVvdash>")
  ("| | | var -" "<Vvdash>")
  ("| | | var - -" "<longVvdash>")
  ("- | var" "<dashv>")
  ("- | var |" "<dashV>")
  ("- | var | |" "<dashVv>")
  ("- | | var" "<dashV>")
  ("- | | | var" "<dashVv>")
  ("- - |" "<longdashv>")
  ("- - | |" "<longdashV>")
  ("- - | | |" "<longdashVv>")
  ("| = var" "<vDash>")
  ("| = var =" "<longvDash>")
  ("| = =" "<longvDash>")
  ("| var =" "<vDash>")
  ("| var = =" "<longvDash>")
  ("| | = var" "<VDash>")
  ("| | = var =" "<longVDash>")
  ("| | = =" "<longVDash>")
  ("| | var =" "<VDash>")
  ("| | var = =" "<longVDash>")
  ("| | | = var" "<VvDash>")
  ("| | | = var =" "<longVvDash>")
  ("| | | = =" "<longVvDash>")
  ("| | | var =" "<VvDash>")
  ("| | | var = =" "<longVvDash>")
  ("= | var" "<Dashv>")
  ("= | var |" "<DashV>")
  ("= | var | |" "<DashVv>")
  ("= | | var" "<DashV>")
  ("= | | | var" "<DashVv>")
  ("= = |" "<longDashv>")
  ("= = | |" "<longDashV>")
  ("= = | | |" "<longDashVv>")

  ("| - var /" "<nvdash>")
  ("| - /" "<nvdash>")
  ("| var - /" "<nvdash>")
  ("| | - var /" "<nVdash>")
  ("| | - /" "<nVdash>")
  ("| | var - /" "<nVdash>")
  ("| | | - var /" "<nVvdash>")
  ("| | | - /" "<nVvdash>")
  ("| | | var - /" "<nVvdash>")
  ("- | var /" "<ndashv>")
  ("- | /" "<ndashv>")
  ("- | var | /" "<ndashV>")
  ("- | | var /" "<ndashV>")
  ("- | | /" "<ndashV>")
  ("- | | | var /" "<ndashVv>")
  ("- | | | /" "<ndashVv>")
  ("| = var /" "<nvDash>")
  ("| = /" "<nvDash>")
  ("| var = /" "<nvDash>")
  ("| | = var /" "<nVDash>")
  ("| | = /" "<nVDash>")
  ("| | var = /" "<nVDash>")
  ("| | | = var /" "<nVvDash>")
  ("| | | = /" "<nVvDash>")
  ("| | | var = /" "<nVvDash>")
  ("= | var /" "<nDashv>")
  ("= | /" "<nDashv>")
  ("= | var | /" "<nDashV>")
  ("= | | var /" "<nDashV>")
  ("= | | /" "<nDashV>")
  ("= | | | var /" "<nDashVv>")
  ("= | | | /" "<nDashVv>")

  ("< | var" "<vartriangleleft>")
  ("< | var /" "<ntriangleleft>")
  ("< | var =" "<trianglelefteqslant>")
  ("< | var = /" "<ntrianglelefteqslant>")
  ("< | var = var" "<trianglelefteq>")
  ("< | var = var /" "<ntrianglelefteq>")
  ("< | var var" "<blacktriangleleft>")
  ("< | var var /" "<nblacktriangleleft>")
  ("< | var var =" "<blacktrianglelefteqslant>")
  ("< | var var = /" "<nblacktrianglelefteqslant>")
  ("< | var var = var" "<blacktrianglelefteq>")
  ("< | var var = var /" "<nblacktrianglelefteq>")
  ("| > var" "<vartriangleright>")
  ("| > var /" "<ntriangleright>")
  ("| > var =" "<trianglerighteqslant>")
  ("| > var = /" "<ntrianglerighteqslant>")
  ("| > var = var" "<trianglerighteq>")
  ("| > var = var /" "<ntrianglerighteq>")
  ("| > var var" "<blacktriangleright>")
  ("| > var var /" "<nblacktriangleright>")
  ("| > var var =" "<blacktrianglerighteqslant>")
  ("| > var var = /" "<nblacktrianglerighteqslant>")
  ("| > var var = var" "<blacktrianglerighteq>")
  ("| > var var = var /" "<nblacktrianglerighteq>")
  ("| var >" "<vartriangleright>")
  ("| var > /" "<ntriangleright>")
  ("| var > =" "<trianglerighteqslant>")
  ("| var > = /" "<ntrianglerighteqslant>")
  ("| var > = var" "<trianglerighteq>")
  ("| var > = var /" "<ntrianglerighteq>")
  ("| var > var" "<blacktriangleright>")
  ("| var > var /" "<nblacktriangleright>")
  ("| var > var =" "<blacktrianglerighteqslant>")
  ("| var > var = /" "<nblacktrianglerighteqslant>")
  ("| var > var = var" "<blacktrianglerighteq>")
  ("| var > var = var /" "<nblacktrianglerighteq>")

  ("+ var" "<kreuz>")
  ("+ var var" "<dag>")
  ("+ var var var" "<ddag>")
  ("+ var var var var" "<noplus>")
  ("+ . ." "+<cdots>+")
  ("+ +" "+<cdots>+")
  ("+ -" "<pm>")
  ("- +" "<mp>")
  ("+ - . ." "<pm><cdots><pm>")
  ("- + . ." "<mp><cdots><mp>")
  ("+ + var" "<pplus>")
  ("@ =" "<circeq>")
  ("@ = var" "<triangleq>")
  ("= @" "<eqcirc>")
  ("- . ." "-<cdots>-")
  ("- @" "<multimap>")
  ("- - @" "<longmultimap>")
  (". =" "<doteq>")
  (". +" "<dotplus>")
  (". -" "<dotminus>")
  (". *" "<dottimes>")
  (". * var" "<dotast>")
  (". ." "<ldots>")
  (". . var" "<cdots>")
  (". . var !" "<cdotslim>")
  (". . var var" "<hdots>")
  (". . var var var" "<vdots>")
  (". . var var var var" "<ddots>")
  (". . var var var var var" "<udots>")
  (":" ":")
  (": var" "<of>")
  (": var var" "<over>")
  (": var var . ." "<over><ldots><over>")
  (": var var var" "<suchthat>")
  (": :" "<colons>")
  (": >" "<transtype>")
  (": =" "<assign>")
  ("+ =" "<plusassign>")
  ("- =" "<minusassign>")
  ("/ var" "<over>")
  ("/ var var" "<div>")
  ("*" "*")
  ("* . ." "*<cdots>*")
  ("* *" "*<cdots>*")
  ("* var" "<times>")
  ("* var . ." "<times><cdots><times>")
  ("* var var" "<ast>")
  ("* var var . ." "<ast><cdots><ast>")
  ("* var var var" "<cdot>")
  ("* var var var . ." "<cdot><cdots><cdot>")
  ("* var var var var" "<exterior>")
  ("* var var var var . ." "<exterior><cdots><exterior>")
  ("* var var var var var" "<star>")
  ("* &" "<exterior>")
  ("| var *" "<ltimes>")
  ("| var * var" "<ttimes>")
  ("| var * var var" "<btimes>")
  ("| var * |" "<join>")
  ("* var |" "<rtimes>")
  ("* var | var" "<btimes>")
  ("* var | var var" "<ttimes>")
  ("! var" "<neg>")
  
  ("math:misc &" "&")
  ("math:misc %" "%")
  ("math:misc % var" "<permil>")
  ("math:misc \\" "\\")
  ("math:misc \\ var" "<setminus>")
  ("math:misc \\ var var" "<smallsetminus>")
  ("math:misc |" "|")
  ("math:misc | /" "<nmid>")
  ("math:misc | var" "<shortmid>")
  ("math:misc | var /" "<nshortmid>")
  ("math:misc | var var" "<divides>")
  ("math:misc | var var /" "<ndivides>")
  ("math:misc | |" "<||>")
  ("math:misc | | /" "<nparallel>")
  ("math:misc | | var" "<shortparallel>")
  ("math:misc | | var /" "<nshortparallel>")
  ("math:misc | | var var" "<varparallel>")
  ("math:misc | | var var /" "<nvarparallel>")

  ("math:greek a" "<alpha>")
  ("math:greek b" "<beta>")
  ("math:greek g" "<gamma>")
  ("math:greek g var" "<matheuler>")
  ("math:greek d" "<delta>")
  ("math:greek e" "<varepsilon>")
  ("math:greek e var" "<epsilon>")
  ("math:greek e var var" "<backepsilon>")
  ("math:greek z" "<zeta>")
  ("math:greek h" "<eta>")
  ("math:greek j" "<theta>")
  ("math:greek j var" "<vartheta>")
  ("math:greek i" "<iota>")
  ("math:greek k" "<kappa>")
  ("math:greek k var" "<varkappa>")
  ("math:greek l" "<lambda>")
  ("math:greek l var" "<mathlambda>")
  ("math:greek m" "<mu>")
  ("math:greek n" "<nu>")
  ("math:greek x" "<xi>")
  ("math:greek o" "<omicron>")
  ("math:greek p" "<pi>")
  ("math:greek p var" "<mathpi>")
  ("math:greek p var var" "<varpi>")
  ("math:greek r" "<rho>")
  ("math:greek r var" "<varrho>")
  ("math:greek s" "<sigma>")
  ("math:greek s var" "<varsigma>")
  ("math:greek c" "<varsigma>")
  ("math:greek c var" "<sigma>")
  ("math:greek t" "<tau>")
  ("math:greek u" "<upsilon>")
  ("math:greek y" "<psi>")
  ("math:greek q" "<chi>")
  ("math:greek w" "<omega>")
  ("math:greek w var" "<mho>")
  ("math:greek v" "<phi>")
  ("math:greek v var" "<varphi>")
  ("math:greek f" "<varphi>")
  ("math:greek f var" "<phi>")
  ("math:greek A" "<Alpha>")
  ("math:greek B" "<Beta>")
  ("math:greek G" "<Gamma>")
  ("math:greek G var" "<mathGamma>")
  ("math:greek D" "<Delta>")
  ("math:greek D var" "<mathLaplace>")
  ("math:greek E" "<Epsilon>")
  ("math:greek E var" "<Backepsilon>")
  ("math:greek Z" "<Zeta>")
  ("math:greek H" "<Eta>")
  ("math:greek J" "<Theta>")
  ("math:greek I" "<Iota>")
  ("math:greek K" "<Kappa>")
  ("math:greek L" "<Lambda>")
  ("math:greek M" "<Mu>")
  ("math:greek N" "<Nu>")
  ("math:greek X" "<Xi>")
  ("math:greek O" "<Omicron>")
  ("math:greek P" "<Pi>")
  ("math:greek R" "<Rho>")
  ("math:greek S" "<Sigma>")
  ("math:greek S var" "<Backsigma>")
  ("math:greek C" "<Sigma>")
  ("math:greek T" "<Tau>")
  ("math:greek U" "<Upsilon>")
  ("math:greek Y" "<Psi>")
  ("math:greek Q" "<Chi>")
  ("math:greek W" "<Omega>")
  ("math:greek W var" "<Mho>")
  ("math:greek V" "<Phi>")
  ("math:greek F" "<Phi>"))

(kbd-map
  (:mode in-math-not-hybrid?)
  ("a var" "<alpha>")
  ("b var" "<beta>")
  ("b var var" "<flat>")
  ("c var" "<varsigma>")
  ("c var var" "<sigma>")
  ("d var" "<delta>")
  ("d var var" "<mathd>")
  ("d var var var" "<partial>")
  ("e var" "<varepsilon>")
  ("e var var" "<mathe>")
  ("e var var var" "<epsilon>")
  ("e var var var var" "<backepsilon>")
  ("g var" "<gamma>")
  ("g var var" "<matheuler>")
  ("h var" "<eta>")
  ("h var var" "<hbar>")
  ("i var" "<iota>")
  ("i var var" "<mathi>")
  ("i var var var" "<imath>")
  ("j var" "<theta>")
  ("j var var" "<jmath>")
  ("j var var var" "<vartheta>")
  ("k var" "<kappa>")
  ("k var var" "<varkappa>")
  ("l var" "<lambda>")
  ("l var var" "<mathlambda>")
  ("l var var var" "<ell>")
  ("m var" "<mu>")
  ("n var" "<nu>")
  ("o var" "<omicron>")
  ("p var" "<pi>")
  ("p var var" "<mathpi>")
  ("p var var var" "<varpi>")
  ("q var" "<chi>")
  ("r var" "<rho>")
  ("r var var" "<varrho>")
  ("s var" "<sigma>")
  ("s var var" "<varsigma>")
  ("t var" "<tau>")
  ("u var" "<upsilon>")
  ("v var" "<phi>")
  ("v var var" "<varphi>")
  ("f var" "<varphi>")
  ("f var var" "<phi>")
  ("w var" "<omega>")
  ("w var var" "<mho>")
  ("x var" "<xi>")
  ("y var" "<psi>")
  ("z var" "<zeta>")

  ("A var" "<Alpha>")
  ("A var var" "<forall>")
  ("A var var var" "<aleph>")
  ("B var" "<Beta>")
  ("B var var" "<bot>")
  ("B var var var" "<beth>")
  ("C var" "<Sigma>")
  ("C var var" "<mathcatalan>")
  ("C var var var" "<complement>")
  ("D var" "<Delta>")
  ("D var var" "<mathD>")
  ("D var var var" "<daleth>")
  ("D var var var var" "<mathLaplace>")
  ("E var" "<Epsilon>")
  ("E var var" "<exists>")
  ("E var var var" "<Exists>")
  ("E var var var var" "<Backepsilon>")
  ("G var" "<Gamma>")
  ("G var var" "<gimel>")
  ("G var var var" "<mathGamma>")
  ("G var var var var" "<digamma>")
  ("H var" "<Eta>")
  ("I var" "<Iota>")
  ("I var var" "<Im>")
  ("J var" "<Theta>")
  ("K var" "<Kappa>")
  ("L var" "<Lambda>")
  ("M var" "<Mu>")
  ("N var" "<Nu>")
  ("O var" "<Omicron>")
  ("P var" "<Pi>")
  ("P var var" "<wp>")
  ("Q var" "<Chi>")
  ("R var" "<Rho>")
  ("R var var" "<Re>")
  ("S var" "<Sigma>")
  ("S var var" "<Backsigma>")
  ("T var" "<Tau>")
  ("T var var" "<top>")
  ("T var var var" "<bot>")
  ("T var var var var" "<leftthreetimes>")
  ("T var var var var var" "<rightthreetimes>")
  ("T var var var var var var" "<lefttimesthree>")
  ("T var var var var var var var" "<righttimesthree>")
  ("U var" "<Upsilon>")
  ("V var" "<Phi>")
  ("V var var" "<nabla>")
  ("F var" "<Phi>")
  ("W var" "<Omega>")
  ("W var var" "<Mho>")
  ("X var" "<Xi>")
  ("Y var" "<Psi>")
  ("Y var var" "<Ydown>")
  ("Y var var var" "<Yup>")
  ("Y var var var var" "<Yleft>")
  ("Y var var var var var" "<Yright>")
  ("Z var" "<Zeta>"))

(kbd-map
  (:mode in-math?)
  ("math:bold 0" "<b-0>")
  ("math:bold 1" "<b-1>")
  ("math:bold 2" "<b-2>")
  ("math:bold 3" "<b-3>")
  ("math:bold 4" "<b-4>")
  ("math:bold 5" "<b-5>")
  ("math:bold 6" "<b-6>")
  ("math:bold 7" "<b-7>")
  ("math:bold 8" "<b-8>")
  ("math:bold 9" "<b-9>")
  ("math:bold a" "<b-a>")
  ("math:bold b" "<b-b>")
  ("math:bold c" "<b-c>")
  ("math:bold d" "<b-d>")
  ("math:bold e" "<b-e>")
  ("math:bold f" "<b-f>")
  ("math:bold g" "<b-g>")
  ("math:bold h" "<b-h>")
  ("math:bold i" "<b-i>")
  ("math:bold j" "<b-j>")
  ("math:bold k" "<b-k>")
  ("math:bold l" "<b-l>")
  ("math:bold m" "<b-m>")
  ("math:bold n" "<b-n>")
  ("math:bold o" "<b-o>")
  ("math:bold p" "<b-p>")
  ("math:bold q" "<b-q>")
  ("math:bold r" "<b-r>")
  ("math:bold s" "<b-s>")
  ("math:bold t" "<b-t>")
  ("math:bold u" "<b-u>")
  ("math:bold v" "<b-v>")
  ("math:bold w" "<b-w>")
  ("math:bold x" "<b-x>")
  ("math:bold y" "<b-y>")
  ("math:bold z" "<b-z>")
  ("math:bold A" "<b-A>")
  ("math:bold B" "<b-B>")
  ("math:bold C" "<b-C>")
  ("math:bold D" "<b-D>")
  ("math:bold E" "<b-E>")
  ("math:bold F" "<b-F>")
  ("math:bold G" "<b-G>")
  ("math:bold H" "<b-H>")
  ("math:bold I" "<b-I>")
  ("math:bold J" "<b-J>")
  ("math:bold K" "<b-K>")
  ("math:bold L" "<b-L>")
  ("math:bold M" "<b-M>")
  ("math:bold N" "<b-N>")
  ("math:bold O" "<b-O>")
  ("math:bold P" "<b-P>")
  ("math:bold Q" "<b-Q>")
  ("math:bold R" "<b-R>")
  ("math:bold S" "<b-S>")
  ("math:bold T" "<b-T>")
  ("math:bold U" "<b-U>")
  ("math:bold V" "<b-V>")
  ("math:bold W" "<b-W>")
  ("math:bold X" "<b-X>")
  ("math:bold Y" "<b-Y>")
  ("math:bold Z" "<b-Z>")
  ("math:bold i var" "<b-imath>")
  ("math:bold j var" "<b-jmath>")
  ("math:bold l var" "<b-ell>")
  ("math:bold ~" "<thicksim>")
  ("math:bold ~ ~" "<thickapprox>")

  ("math:bold:greek a" "<b-alpha>")
  ("math:bold:greek b" "<b-beta>")
  ("math:bold:greek g" "<b-gamma>")
  ("math:bold:greek d" "<b-delta>")
  ("math:bold:greek e" "<b-varepsilon>")
  ("math:bold:greek e var" "<b-epsilon>")
  ("math:bold:greek e var var" "<b-backepsilon>")
  ("math:bold:greek z" "<b-zeta>")
  ("math:bold:greek h" "<b-eta>")
  ("math:bold:greek j" "<b-theta>")
  ("math:bold:greek j var" "<b-vartheta>")
  ("math:bold:greek i" "<b-iota>")
  ("math:bold:greek k" "<b-kappa>")
  ("math:bold:greek k var" "<b-varkappa>")
  ("math:bold:greek l" "<b-lambda>")
  ("math:bold:greek m" "<b-mu>")
  ("math:bold:greek n" "<b-nu>")
  ("math:bold:greek x" "<b-xi>")
  ("math:bold:greek o" "<b-omicron>")
  ("math:bold:greek p" "<b-pi>")
  ("math:bold:greek p var" "<b-varpi>")
  ("math:bold:greek r" "<b-rho>")
  ("math:bold:greek r var" "<b-varrho>")
  ("math:bold:greek s" "<b-sigma>")
  ("math:bold:greek s var" "<b-varsigma>")
  ("math:bold:greek c" "<b-varsigma>")
  ("math:bold:greek c var" "<b-sigma>")
  ("math:bold:greek t" "<b-tau>")
  ("math:bold:greek u" "<b-upsilon>")
  ("math:bold:greek y" "<b-psi>")
  ("math:bold:greek q" "<b-chi>")
  ("math:bold:greek w" "<b-omega>")
  ("math:bold:greek w var" "<b-mho>")
  ("math:bold:greek v" "<b-phi>")
  ("math:bold:greek v var" "<b-varphi>")
  ("math:bold:greek f" "<b-varphi>")
  ("math:bold:greek f var" "<b-phi>")
  ("math:bold:greek A" "<b-Alpha>")
  ("math:bold:greek B" "<b-Beta>")
  ("math:bold:greek G" "<b-Gamma>")
  ("math:bold:greek D" "<b-Delta>")
  ("math:bold:greek E" "<b-Epsilon>")
  ("math:bold:greek E var" "<b-Backepsilon>")
  ("math:bold:greek Z" "<b-Zeta>")
  ("math:bold:greek H" "<b-Eta>")
  ("math:bold:greek J" "<b-Theta>")
  ("math:bold:greek I" "<b-Iota>")
  ("math:bold:greek K" "<b-Kappa>")
  ("math:bold:greek L" "<b-Lambda>")
  ("math:bold:greek M" "<b-Mu>")
  ("math:bold:greek N" "<b-Nu>")
  ("math:bold:greek X" "<b-Xi>")
  ("math:bold:greek O" "<b-Omicron>")
  ("math:bold:greek P" "<b-Pi>")
  ("math:bold:greek R" "<b-Rho>")
  ("math:bold:greek S" "<b-Sigma>")
  ("math:bold:greek S var" "<b-Backsigma>")
  ("math:bold:greek C" "<b-Sigma>")
  ("math:bold:greek T" "<b-Tau>")
  ("math:bold:greek U" "<b-Upsilon>")
  ("math:bold:greek Y" "<b-Psi>")
  ("math:bold:greek Q" "<b-Chi>")
  ("math:bold:greek W" "<b-Omega>")
  ("math:bold:greek W var" "<b-Mho>")
  ("math:bold:greek V" "<b-Phi>")
  ("math:bold:greek F" "<b-Phi>")

  ("math:bold a var" "<b-alpha>")
  ("math:bold b var" "<b-beta>")
  ("math:bold c var" "<b-varsigma>")
  ("math:bold c var var" "<b-sigma>")
  ("math:bold d var" "<b-delta>")
  ("math:bold e var" "<b-varepsilon>")
  ("math:bold e var var" "<b-epsilon>")
  ("math:bold e var var var" "<b-backepsilon>")
  ("math:bold g var" "<b-gamma>")
  ("math:bold h var" "<b-eta>")
  ("math:bold i var" "<b-iota>")
  ("math:bold i var var" "<b-imath>")
  ("math:bold j var" "<b-theta>")
  ("math:bold j var var" "<b-jmath>")
  ("math:bold j var var var" "<b-vartheta>")
  ("math:bold k var" "<b-kappa>")
  ("math:bold k var var" "<b-varkappa>")
  ("math:bold l var" "<b-lambda>")
  ("math:bold l var var" "<b-ell>")
  ("math:bold m var" "<b-mu>")
  ("math:bold n var" "<b-nu>")
  ("math:bold o var" "<b-omicron>")
  ("math:bold p var" "<b-pi>")
  ("math:bold p var var" "<b-varpi>")
  ("math:bold q var" "<b-chi>")
  ("math:bold r var" "<b-rho>")
  ("math:bold r var var" "<b-varrho>")
  ("math:bold s var" "<b-sigma>")
  ("math:bold s var var" "<b-varsigma>")
  ("math:bold t var" "<b-tau>")
  ("math:bold u var" "<b-upsilon>")
  ("math:bold v var" "<b-phi>")
  ("math:bold v var var" "<b-varphi>")
  ("math:bold f var" "<b-varphi>")
  ("math:bold f var var" "<b-phi>")
  ("math:bold w var" "<b-omega>")
  ("math:bold w var var" "<b-mho>")
  ("math:bold x var" "<b-xi>")
  ("math:bold y var" "<b-psi>")
  ("math:bold z var" "<b-zeta>")
  ("math:bold A var" "<b-Alpha>")
  ("math:bold B var" "<b-Beta>")
  ("math:bold C var" "<b-Sigma>")
  ("math:bold D var" "<b-Delta>")
  ("math:bold E var" "<b-Epsilon>")
  ("math:bold E var var" "<b-Backepsilon>")
  ("math:bold G var" "<b-Gamma>")
  ("math:bold H var" "<b-Eta>")
  ("math:bold I var" "<b-Iota>")
  ("math:bold J var" "<b-Theta>")
  ("math:bold K var" "<b-Kappa>")
  ("math:bold L var" "<b-Lambda>")
  ("math:bold M var" "<b-Mu>")
  ("math:bold N var" "<b-Nu>")
  ("math:bold O var" "<b-Omicron>")
  ("math:bold P var" "<b-Pi>")
  ("math:bold Q var" "<b-Chi>")
  ("math:bold R var" "<b-Rho>")
  ("math:bold S var" "<b-Sigma>")
  ("math:bold S var var" "<b-Backsigma>")
  ("math:bold T var" "<b-Tau>")
  ("math:bold U var" "<b-Upsilon>")
  ("math:bold V var" "<b-Phi>")
  ("math:bold F var" "<b-Phi>")
  ("math:bold W var" "<b-Omega>")
  ("math:bold W var var" "<b-Mho>")
  ("math:bold X var" "<b-Xi>")
  ("math:bold Y var" "<b-Psi>")
  ("math:bold Z var" "<b-Zeta>")

  ("math:up a" "<up-a>")
  ("math:up b" "<up-b>")
  ("math:up c" "<up-c>")
  ("math:up d" "<up-d>")
  ("math:up e" "<up-e>")
  ("math:up f" "<up-f>")
  ("math:up g" "<up-g>")
  ("math:up h" "<up-h>")
  ("math:up i" "<up-i>")
  ("math:up j" "<up-j>")
  ("math:up k" "<up-k>")
  ("math:up l" "<up-l>")
  ("math:up m" "<up-m>")
  ("math:up n" "<up-n>")
  ("math:up o" "<up-o>")
  ("math:up p" "<up-p>")
  ("math:up q" "<up-q>")
  ("math:up r" "<up-r>")
  ("math:up s" "<up-s>")
  ("math:up t" "<up-t>")
  ("math:up u" "<up-u>")
  ("math:up v" "<up-v>")
  ("math:up w" "<up-w>")
  ("math:up x" "<up-x>")
  ("math:up y" "<up-y>")
  ("math:up z" "<up-z>")
  ("math:up A" "<up-A>")
  ("math:up B" "<up-B>")
  ("math:up C" "<up-C>")
  ("math:up D" "<up-D>")
  ("math:up E" "<up-E>")
  ("math:up F" "<up-F>")
  ("math:up G" "<up-G>")
  ("math:up H" "<up-H>")
  ("math:up I" "<up-I>")
  ("math:up J" "<up-J>")
  ("math:up K" "<up-K>")
  ("math:up L" "<up-L>")
  ("math:up M" "<up-M>")
  ("math:up N" "<up-N>")
  ("math:up O" "<up-O>")
  ("math:up P" "<up-P>")
  ("math:up Q" "<up-Q>")
  ("math:up R" "<up-R>")
  ("math:up S" "<up-S>")
  ("math:up T" "<up-T>")
  ("math:up U" "<up-U>")
  ("math:up V" "<up-V>")
  ("math:up W" "<up-W>")
  ("math:up X" "<up-X>")
  ("math:up Y" "<up-Y>")
  ("math:up Z" "<up-Z>")

  ("math:up a var" "<up-alpha>")
  ("math:up b var" "<up-beta>")
  ("math:up c var" "<up-varsigma>")
  ("math:up c var var" "<up-sigma>")
  ("math:up d var" "<up-delta>")
  ("math:up e var" "<up-varepsilon>")
  ("math:up e var var" "<up-epsilon>")
  ("math:up g var" "<up-gamma>")
  ("math:up h var" "<up-eta>")
  ("math:up i var" "<up-iota>")
  ("math:up i var var" "<up-imath>")
  ("math:up j var" "<up-theta>")
  ("math:up j var var" "<up-jmath>")
  ("math:up j var var var" "<up-vartheta>")
  ("math:up k var" "<up-kappa>")
  ("math:up k var var" "<up-varkappa>")
  ("math:up l var" "<up-lambda>")
  ("math:up l var var" "<up-ell>")
  ("math:up m var" "<up-mu>")
  ("math:up n var" "<up-nu>")
  ("math:up o var" "<up-omicron>")
  ("math:up p var" "<up-pi>")
  ("math:up p var var" "<up-varpi>")
  ("math:up q var" "<up-chi>")
  ("math:up r var" "<up-rho>")
  ("math:up r var var" "<up-varrho>")
  ("math:up s var" "<up-sigma>")
  ("math:up s var var" "<up-varsigma>")
  ("math:up t var" "<up-tau>")
  ("math:up u var" "<up-upsilon>")
  ("math:up v var" "<up-phi>")
  ("math:up v var var" "<up-varphi>")
  ("math:up f var" "<up-varphi>")
  ("math:up f var var" "<up-phi>")
  ("math:up w var" "<up-omega>")
  ("math:up x var" "<up-xi>")
  ("math:up y var" "<up-psi>")
  ("math:up z var" "<up-zeta>")
  ;;("math:up A var" "<up-Alpha>")
  ;;("math:up B var" "<up-Beta>")
  ;;("math:up C var" "<up-Sigma>")
  ;;("math:up D var" "<up-Delta>")
  ;;("math:up E var" "<up-Epsilon>")
  ;;("math:up G var" "<up-Gamma>")
  ;;("math:up H var" "<up-Eta>")
  ;;("math:up I var" "<up-Iota>")
  ;;("math:up J var" "<up-Theta>")
  ;;("math:up K var" "<up-Kappa>")
  ;;("math:up L var" "<up-Lambda>")
  ;;("math:up M var" "<up-Mu>")
  ;;("math:up N var" "<up-Nu>")
  ;;("math:up O var" "<up-Omicron>")
  ;;("math:up P var" "<up-Pi>")
  ;;("math:up Q var" "<up-Chi>")
  ;;("math:up R var" "<up-Rho>")
  ;;("math:up S var" "<up-Sigma>")
  ;;("math:up T var" "<up-Tau>")
  ;;("math:up U var" "<up-Upsilon>")
  ;;("math:up V var" "<up-Phi>")
  ;;("math:up F var" "<up-Phi>")
  ;;("math:up W var" "<up-Omega>")
  ;;("math:up W var var" "<up-Mho>")
  ;;("math:up X var" "<up-Xi>")
  ;;("math:up Y var" "<up-Psi>")
  ;;("math:up Z var" "<up-Zeta>")

  ("math:bold:up a" "<b-up-a>")
  ("math:bold:up b" "<b-up-b>")
  ("math:bold:up c" "<b-up-c>")
  ("math:bold:up d" "<b-up-d>")
  ("math:bold:up e" "<b-up-e>")
  ("math:bold:up f" "<b-up-f>")
  ("math:bold:up g" "<b-up-g>")
  ("math:bold:up h" "<b-up-h>")
  ("math:bold:up i" "<b-up-i>")
  ("math:bold:up j" "<b-up-j>")
  ("math:bold:up k" "<b-up-k>")
  ("math:bold:up l" "<b-up-l>")
  ("math:bold:up m" "<b-up-m>")
  ("math:bold:up n" "<b-up-n>")
  ("math:bold:up o" "<b-up-o>")
  ("math:bold:up p" "<b-up-p>")
  ("math:bold:up q" "<b-up-q>")
  ("math:bold:up r" "<b-up-r>")
  ("math:bold:up s" "<b-up-s>")
  ("math:bold:up t" "<b-up-t>")
  ("math:bold:up u" "<b-up-u>")
  ("math:bold:up v" "<b-up-v>")
  ("math:bold:up w" "<b-up-w>")
  ("math:bold:up x" "<b-up-x>")
  ("math:bold:up y" "<b-up-y>")
  ("math:bold:up z" "<b-up-z>")
  ("math:bold:up A" "<b-up-A>")
  ("math:bold:up B" "<b-up-B>")
  ("math:bold:up C" "<b-up-C>")
  ("math:bold:up D" "<b-up-D>")
  ("math:bold:up E" "<b-up-E>")
  ("math:bold:up F" "<b-up-F>")
  ("math:bold:up G" "<b-up-G>")
  ("math:bold:up H" "<b-up-H>")
  ("math:bold:up I" "<b-up-I>")
  ("math:bold:up J" "<b-up-J>")
  ("math:bold:up K" "<b-up-K>")
  ("math:bold:up L" "<b-up-L>")
  ("math:bold:up M" "<b-up-M>")
  ("math:bold:up N" "<b-up-N>")
  ("math:bold:up O" "<b-up-O>")
  ("math:bold:up P" "<b-up-P>")
  ("math:bold:up Q" "<b-up-Q>")
  ("math:bold:up R" "<b-up-R>")
  ("math:bold:up S" "<b-up-S>")
  ("math:bold:up T" "<b-up-T>")
  ("math:bold:up U" "<b-up-U>")
  ("math:bold:up V" "<b-up-V>")
  ("math:bold:up W" "<b-up-W>")
  ("math:bold:up X" "<b-up-X>")
  ("math:bold:up Y" "<b-up-Y>")
  ("math:bold:up Z" "<b-up-Z>")

  ("math:bold:up a var" "<b-up-alpha>")
  ("math:bold:up b var" "<b-up-beta>")
  ("math:bold:up c var" "<b-up-varsigma>")
  ("math:bold:up c var var" "<b-up-sigma>")
  ("math:bold:up d var" "<b-up-delta>")
  ("math:bold:up e var" "<b-up-varepsilon>")
  ("math:bold:up e var var" "<b-up-epsilon>")
  ("math:bold:up g var" "<b-up-gamma>")
  ("math:bold:up h var" "<b-up-eta>")
  ("math:bold:up i var" "<b-up-iota>")
  ("math:bold:up i var var" "<b-up-imath>")
  ("math:bold:up j var" "<b-up-theta>")
  ("math:bold:up j var var" "<b-up-jmath>")
  ("math:bold:up j var var var" "<b-up-vartheta>")
  ("math:bold:up k var" "<b-up-kappa>")
  ("math:bold:up k var var" "<b-up-varkappa>")
  ("math:bold:up l var" "<b-up-lambda>")
  ("math:bold:up l var var" "<b-up-ell>")
  ("math:bold:up m var" "<b-up-mu>")
  ("math:bold:up n var" "<b-up-nu>")
  ("math:bold:up o var" "<b-up-omicron>")
  ("math:bold:up p var" "<b-up-pi>")
  ("math:bold:up p var var" "<b-up-varpi>")
  ("math:bold:up q var" "<b-up-chi>")
  ("math:bold:up r var" "<b-up-rho>")
  ("math:bold:up r var var" "<b-up-varrho>")
  ("math:bold:up s var" "<b-up-sigma>")
  ("math:bold:up s var var" "<b-up-varsigma>")
  ("math:bold:up t var" "<b-up-tau>")
  ("math:bold:up u var" "<b-up-upsilon>")
  ("math:bold:up v var" "<b-up-phi>")
  ("math:bold:up v var var" "<b-up-varphi>")
  ("math:bold:up f var" "<b-up-varphi>")
  ("math:bold:up f var var" "<b-up-phi>")
  ("math:bold:up w var" "<b-up-omega>")
  ("math:bold:up x var" "<b-up-xi>")
  ("math:bold:up y var" "<b-up-psi>")
  ("math:bold:up z var" "<b-up-zeta>")
  ;;("math:bold:up A var" "<b-up-Alpha>")
  ;;("math:bold:up B var" "<b-up-Beta>")
  ;;("math:bold:up C var" "<b-up-Sigma>")
  ;;("math:bold:up D var" "<b-up-Delta>")
  ;;("math:bold:up E var" "<b-up-Epsilon>")
  ;;("math:bold:up G var" "<b-up-Gamma>")
  ;;("math:bold:up H var" "<b-up-Eta>")
  ;;("math:bold:up I var" "<b-up-Iota>")
  ;;("math:bold:up J var" "<b-up-Theta>")
  ;;("math:bold:up K var" "<b-up-Kappa>")
  ;;("math:bold:up L var" "<b-up-Lambda>")
  ;;("math:bold:up M var" "<b-up-Mu>")
  ;;("math:bold:up N var" "<b-up-Nu>")
  ;;("math:bold:up O var" "<b-up-Omicron>")
  ;;("math:bold:up P var" "<b-up-Pi>")
  ;;("math:bold:up Q var" "<b-up-Chi>")
  ;;("math:bold:up R var" "<b-up-Rho>")
  ;;("math:bold:up S var" "<b-up-Sigma>")
  ;;("math:bold:up T var" "<b-up-Tau>")
  ;;("math:bold:up U var" "<b-up-Upsilon>")
  ;;("math:bold:up V var" "<b-up-Phi>")
  ;;("math:bold:up F var" "<b-up-Phi>")
  ;;("math:bold:up W var" "<b-up-Omega>")
  ;;("math:bold:up W var var" "<b-up-Mho>")
  ;;("math:bold:up X var" "<b-up-Xi>")
  ;;("math:bold:up Y var" "<b-up-Psi>")
  ;;("math:bold:up Z var" "<b-up-Zeta>")

  ("math:cal a" "<cal-a>")
  ("math:cal b" "<cal-b>")
  ("math:cal c" "<cal-c>")
  ("math:cal d" "<cal-d>")
  ("math:cal e" "<cal-e>")
  ("math:cal f" "<cal-f>")
  ("math:cal g" "<cal-g>")
  ("math:cal h" "<cal-h>")
  ("math:cal i" "<cal-i>")
  ("math:cal j" "<cal-j>")
  ("math:cal k" "<cal-k>")
  ("math:cal l" "<cal-l>")
  ("math:cal m" "<cal-m>")
  ("math:cal n" "<cal-n>")
  ("math:cal o" "<cal-o>")
  ("math:cal p" "<cal-p>")
  ("math:cal q" "<cal-q>")
  ("math:cal r" "<cal-r>")
  ("math:cal s" "<cal-s>")
  ("math:cal t" "<cal-t>")
  ("math:cal u" "<cal-u>")
  ("math:cal v" "<cal-v>")
  ("math:cal w" "<cal-w>")
  ("math:cal x" "<cal-x>")
  ("math:cal y" "<cal-y>")
  ("math:cal z" "<cal-z>")
  ("math:cal A" "<cal-A>")
  ("math:cal B" "<cal-B>")
  ("math:cal C" "<cal-C>")
  ("math:cal D" "<cal-D>")
  ("math:cal E" "<cal-E>")
  ("math:cal F" "<cal-F>")
  ("math:cal G" "<cal-G>")
  ("math:cal H" "<cal-H>")
  ("math:cal I" "<cal-I>")
  ("math:cal J" "<cal-J>")
  ("math:cal K" "<cal-K>")
  ("math:cal L" "<cal-L>")
  ("math:cal M" "<cal-M>")
  ("math:cal N" "<cal-N>")
  ("math:cal O" "<cal-O>")
  ("math:cal P" "<cal-P>")
  ("math:cal Q" "<cal-Q>")
  ("math:cal R" "<cal-R>")
  ("math:cal S" "<cal-S>")
  ("math:cal T" "<cal-T>")
  ("math:cal U" "<cal-U>")
  ("math:cal V" "<cal-V>")
  ("math:cal W" "<cal-W>")
  ("math:cal X" "<cal-X>")
  ("math:cal Y" "<cal-Y>")
  ("math:cal Z" "<cal-Z>")

  ("math:bold:cal a" "<b-cal-a>")
  ("math:bold:cal b" "<b-cal-b>")
  ("math:bold:cal c" "<b-cal-c>")
  ("math:bold:cal d" "<b-cal-d>")
  ("math:bold:cal e" "<b-cal-e>")
  ("math:bold:cal f" "<b-cal-f>")
  ("math:bold:cal g" "<b-cal-g>")
  ("math:bold:cal h" "<b-cal-h>")
  ("math:bold:cal i" "<b-cal-i>")
  ("math:bold:cal j" "<b-cal-j>")
  ("math:bold:cal k" "<b-cal-k>")
  ("math:bold:cal l" "<b-cal-l>")
  ("math:bold:cal m" "<b-cal-m>")
  ("math:bold:cal n" "<b-cal-n>")
  ("math:bold:cal o" "<b-cal-o>")
  ("math:bold:cal p" "<b-cal-p>")
  ("math:bold:cal q" "<b-cal-q>")
  ("math:bold:cal r" "<b-cal-r>")
  ("math:bold:cal s" "<b-cal-s>")
  ("math:bold:cal t" "<b-cal-t>")
  ("math:bold:cal u" "<b-cal-u>")
  ("math:bold:cal v" "<b-cal-v>")
  ("math:bold:cal w" "<b-cal-w>")
  ("math:bold:cal x" "<b-cal-x>")
  ("math:bold:cal y" "<b-cal-y>")
  ("math:bold:cal z" "<b-cal-z>")
  ("math:bold:cal A" "<b-cal-A>")
  ("math:bold:cal B" "<b-cal-B>")
  ("math:bold:cal C" "<b-cal-C>")
  ("math:bold:cal D" "<b-cal-D>")
  ("math:bold:cal E" "<b-cal-E>")
  ("math:bold:cal F" "<b-cal-F>")
  ("math:bold:cal G" "<b-cal-G>")
  ("math:bold:cal H" "<b-cal-H>")
  ("math:bold:cal I" "<b-cal-I>")
  ("math:bold:cal J" "<b-cal-J>")
  ("math:bold:cal K" "<b-cal-K>")
  ("math:bold:cal L" "<b-cal-L>")
  ("math:bold:cal M" "<b-cal-M>")
  ("math:bold:cal N" "<b-cal-N>")
  ("math:bold:cal O" "<b-cal-O>")
  ("math:bold:cal P" "<b-cal-P>")
  ("math:bold:cal Q" "<b-cal-Q>")
  ("math:bold:cal R" "<b-cal-R>")
  ("math:bold:cal S" "<b-cal-S>")
  ("math:bold:cal T" "<b-cal-T>")
  ("math:bold:cal U" "<b-cal-U>")
  ("math:bold:cal V" "<b-cal-V>")
  ("math:bold:cal W" "<b-cal-W>")
  ("math:bold:cal X" "<b-cal-X>")
  ("math:bold:cal Y" "<b-cal-Y>")
  ("math:bold:cal Z" "<b-cal-Z>")

  ("math:frak a" "<frak-a>")
  ("math:frak b" "<frak-b>")
  ("math:frak c" "<frak-c>")
  ("math:frak d" "<frak-d>")
  ("math:frak e" "<frak-e>")
  ("math:frak f" "<frak-f>")
  ("math:frak g" "<frak-g>")
  ("math:frak h" "<frak-h>")
  ("math:frak i" "<frak-i>")
  ("math:frak i var" "<frak-imath>")
  ("math:frak j" "<frak-j>")
  ("math:frak j var" "<frak-jmath>")
  ("math:frak k" "<frak-k>")
  ("math:frak l" "<frak-l>")
  ("math:frak m" "<frak-m>")
  ("math:frak n" "<frak-n>")
  ("math:frak o" "<frak-o>")
  ("math:frak p" "<frak-p>")
  ("math:frak q" "<frak-q>")
  ("math:frak r" "<frak-r>")
  ("math:frak s" "<frak-s>")
  ("math:frak t" "<frak-t>")
  ("math:frak u" "<frak-u>")
  ("math:frak v" "<frak-v>")
  ("math:frak w" "<frak-w>")
  ("math:frak x" "<frak-x>")
  ("math:frak y" "<frak-y>")
  ("math:frak z" "<frak-z>")
  ("math:frak A" "<frak-A>")
  ("math:frak B" "<frak-B>")
  ("math:frak C" "<frak-C>")
  ("math:frak D" "<frak-D>")
  ("math:frak E" "<frak-E>")
  ("math:frak F" "<frak-F>")
  ("math:frak G" "<frak-G>")
  ("math:frak H" "<frak-H>")
  ("math:frak I" "<frak-I>")
  ("math:frak J" "<frak-J>")
  ("math:frak K" "<frak-K>")
  ("math:frak L" "<frak-L>")
  ("math:frak M" "<frak-M>")
  ("math:frak N" "<frak-N>")
  ("math:frak O" "<frak-O>")
  ("math:frak P" "<frak-P>")
  ("math:frak Q" "<frak-Q>")
  ("math:frak R" "<frak-R>")
  ("math:frak S" "<frak-S>")
  ("math:frak T" "<frak-T>")
  ("math:frak U" "<frak-U>")
  ("math:frak V" "<frak-V>")
  ("math:frak W" "<frak-W>")
  ("math:frak X" "<frak-X>")
  ("math:frak Y" "<frak-Y>")
  ("math:frak Z" "<frak-Z>")

  ("math:bbb 0" "<bbb-0>")
  ("math:bbb 1" "<bbb-1>")
  ("math:bbb 2" "<bbb-2>")
  ("math:bbb 3" "<bbb-3>")
  ("math:bbb 4" "<bbb-4>")
  ("math:bbb 5" "<bbb-5>")
  ("math:bbb 6" "<bbb-6>")
  ("math:bbb 7" "<bbb-7>")
  ("math:bbb 8" "<bbb-8>")
  ("math:bbb 9" "<bbb-9>")
  ("math:bbb a" "<bbb-a>")
  ("math:bbb b" "<bbb-b>")
  ("math:bbb c" "<bbb-c>")
  ("math:bbb d" "<bbb-d>")
  ("math:bbb e" "<bbb-e>")
  ("math:bbb f" "<bbb-f>")
  ("math:bbb g" "<bbb-g>")
  ("math:bbb h" "<bbb-h>")
  ("math:bbb i" "<bbb-i>")
  ("math:bbb j" "<bbb-j>")
  ("math:bbb k" "<bbb-k>")
  ("math:bbb l" "<bbb-l>")
  ("math:bbb m" "<bbb-m>")
  ("math:bbb n" "<bbb-n>")
  ("math:bbb o" "<bbb-o>")
  ("math:bbb p" "<bbb-p>")
  ("math:bbb q" "<bbb-q>")
  ("math:bbb r" "<bbb-r>")
  ("math:bbb s" "<bbb-s>")
  ("math:bbb t" "<bbb-t>")
  ("math:bbb u" "<bbb-u>")
  ("math:bbb v" "<bbb-v>")
  ("math:bbb w" "<bbb-w>")
  ("math:bbb x" "<bbb-x>")
  ("math:bbb y" "<bbb-y>")
  ("math:bbb z" "<bbb-z>")
  ("math:bbb A" "<bbb-A>")
  ("math:bbb B" "<bbb-B>")
  ("math:bbb C" "<bbb-C>")
  ("math:bbb D" "<bbb-D>")
  ("math:bbb E" "<bbb-E>")
  ("math:bbb F" "<bbb-F>")
  ("math:bbb G" "<bbb-G>")
  ("math:bbb H" "<bbb-H>")
  ("math:bbb I" "<bbb-I>")
  ("math:bbb J" "<bbb-J>")
  ("math:bbb K" "<bbb-K>")
  ("math:bbb L" "<bbb-L>")
  ("math:bbb M" "<bbb-M>")
  ("math:bbb N" "<bbb-N>")
  ("math:bbb O" "<bbb-O>")
  ("math:bbb P" "<bbb-P>")
  ("math:bbb Q" "<bbb-Q>")
  ("math:bbb R" "<bbb-R>")
  ("math:bbb S" "<bbb-S>")
  ("math:bbb T" "<bbb-T>")
  ("math:bbb U" "<bbb-U>")
  ("math:bbb V" "<bbb-V>")
  ("math:bbb W" "<bbb-W>")
  ("math:bbb X" "<bbb-X>")
  ("math:bbb Y" "<bbb-Y>")
  ("math:bbb Z" "<bbb-Z>"))

(kbd-map
  (:mode in-math-not-hybrid?)
  ("A A" "<bbb-A>")
  ("B B" "<bbb-B>")
  ("C C" "<bbb-C>")
  ("D D" "<bbb-D>")
  ("E E" "<bbb-E>")
  ("F F" "<bbb-F>")
  ("G G" "<bbb-G>")
  ("H H" "<bbb-H>")
  ("I I" "<bbb-I>")
  ("J J" "<bbb-J>")
  ("K K" "<bbb-K>")
  ("L L" "<bbb-L>")
  ("M M" "<bbb-M>")
  ("N N" "<bbb-N>")
  ("O O" "<bbb-O>")
  ("P P" "<bbb-P>")
  ("Q Q" "<bbb-Q>")
  ("R R" "<bbb-R>")
  ("S S" "<bbb-S>")
  ("T T" "<bbb-T>")
  ("U U" "<bbb-U>")
  ("V V" "<bbb-V>")
  ("W W" "<bbb-W>")
  ("X X" "<bbb-X>")
  ("Y Y" "<bbb-Y>")
  ("Z Z" "<bbb-Z>")

  ;;("d d" "<mathd>")
  ;;("d d var" "<partial>")
  ;;("e e" "<mathe>")
  ;;("g g" "<matheuler>")
  ;;("i i" "<mathi>")
  ;;("l l" "<mathlambda>")
  ;;("p p" "<mathpi>")
  ("R E" "<Re>")
  ("I M" "<Im>"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Hacks to work around the problem that MacOS reserves Alt-based shortcuts
;; for its own personal use
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(when (os-macos?)
  (kbd-map
    (:mode in-math?)
    ("table N T" (make 'tabular*))
    ("table N c" (make 'choice))
    ("table N m" (make 'matrix))
    ("table N M" (make 'bmatrix))
    ("table N d" (make 'det))
    ("table N s" (make 'stack))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Textual operators
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(kbd-map
  (:mode in-math-english?)
  ;;("a n d" (make 'infix-and))
  ;;("a n d space" (make 'infix-and))
  ("space a" " a")
  ("space a var" (begin (kbd-space) (insert "<alpha>")))
  ("space a n" " an")
  ("space a n d" (make 'infix-and))
  ("space a n d space" (make 'infix-and))
  ;;("a n d var" "and")
  ;;("o r" (make 'infix-or))
  ;;("o r space" (make 'infix-or))
  ("space o" " o")
  ("space o var" (begin (kbd-space) (insert "<omicron>")))
  ("space o r" (make 'infix-or))
  ("space o r space" (make 'infix-or))
  ;;("o r var" "or")
  ;;("o r d" "ord")
  ;;("i f f" (make 'infix-iff))
  ;;("i f f space" (make 'infix-iff))
  ("space i" " i")
  ("space i var" (begin (kbd-space) (insert "<iota>")))
  ("space i var var" (begin (kbd-space) (insert "<mathi>")))
  ("space i var var var" (begin (kbd-space) (insert "<imath>")))
  ("space i f" " if")
  ("space i f f" (make 'infix-iff))
  ("space i f f space" (make 'infix-iff))
  ;;("i f f var" "iff")
  ("f o r space a l l" (make 'prefix-for-all))
  ("f o r space a l l space" (make 'prefix-for-all)))

(kbd-map
  (:mode in-math-dutch?)
  ;;("e n" (make 'infix-and))
  ;;("e n space" (make 'infix-and))
  ("space e" " e")
  ("space e var" (begin (kbd-space) (insert "<varepsilon>")))
  ("space e var var" (begin (kbd-space) (insert "<mathe>")))
  ("space e var var var" (begin (kbd-space) (insert "<epsilon>")))
  ("space e var var var var" (begin (kbd-space) (insert "<backepsilon>")))
  ("space e n" (make 'infix-and))
  ("space e n space" (make 'infix-and))
  ;;("e n var" "en")
  ;;("o f" (make 'infix-or))
  ;;("o f space" (make 'infix-or))
  ("space o" " o")
  ("space o var" (begin (kbd-space) (insert "<omicron>")))
  ("space o f" (make 'infix-or))
  ("space o f space" (make 'infix-or))
  ;;("o f var" "of")
  ;;("d e s d a" (make 'infix-iff))
  ;;("d e s d a space" (make 'infix-iff))
  ("space d" " d")
  ("space d var" (begin (kbd-space) (insert "<delta>")))
  ("space d var var" (begin (kbd-space) (insert "<mathd>")))
  ("space d var var var" (begin (kbd-space) (insert "<partial>")))
  ("space d e" " de")
  ("space d e s" " des")
  ("space d e s d" " desd")
  ("space d e s d a" (make 'infix-iff))
  ("space d e s d a space" (make 'infix-iff))
  ;;("d e s d a var" "desda")
  ("v o o r space a l l e" (make 'prefix-for-all))
  ("v o o r space a l l e space" (make 'prefix-for-all)))

(kbd-map
  (:mode in-math-french?)
  ;;("e t" (make 'infix-and))
  ;;("e t space" (make 'infix-and))
  ("space e" " e")
  ("space e var" (begin (kbd-space) (insert "<varepsilon>")))
  ("space e var var" (begin (kbd-space) (insert "<mathe>")))
  ("space e var var var" (begin (kbd-space) (insert "<epsilon>")))
  ("space e var var var var" (begin (kbd-space) (insert "<backepsilon>")))
  ("space e t" (make 'infix-and))
  ("space e t space" (make 'infix-and))
  ;;("e t var" "et")
  ;;("o u" (make 'infix-or))
  ;;("o u space" (make 'infix-or))
  ("space o" " o")
  ("space o var" (begin (kbd-space) (insert "<omicron>")))
  ("space o u" (make 'infix-or))
  ("space o u space" (make 'infix-or))
  ;;("o u var" "ou")
  ;;("s s i" (make 'infix-iff))
  ;;("s s i space" (make 'infix-iff))
  ("space s" " s")
  ("space s var" (begin (kbd-space) (insert "<sigma>")))
  ("space s var var" (begin (kbd-space) (insert "<varsigma>")))
  ("space s s" " ss")
  ("space s s i" (make 'infix-iff))
  ("space s s i space" (make 'infix-iff))
  ;;("s s i var" "ssi")
  ("p o u r space t o u t" (make 'prefix-for-all))
  ("p o u r space t o u t space" (make 'prefix-for-all)))

(kbd-map
  (:mode in-math-german?)
  ;;("u n d" (make 'infix-and))
  ;;("u n d space" (make 'infix-and))
  ("space u" " u")
  ("space u var" (begin (kbd-space) (insert "<upsilon>")))
  ("space u n" " un")
  ("space u n d" (make 'infix-and))
  ("space u n d space" (make 'infix-and))
  ;;("u n d var" "und")
  ;;("o d e r" (make 'infix-or))
  ;;("o d e r space" (make 'infix-or))
  ("space o" " o")
  ("space o var" (begin (kbd-space) (insert "<omicron>")))
  ("space o d" " od")
  ("space o d e" " ode")
  ("space o d e r" (make 'infix-or))
  ("space o d e r space" (make 'infix-or))
  ;;("o d e r var" "oder")
  ;;("g d w" (make 'infix-iff))
  ;;("g d w space" (make 'infix-iff))
  ("space g" " g")
  ("space g var" (begin (kbd-space) (insert "<gamma>")))
  ("space g var var" (begin (kbd-space) (insert "<matheuler>")))
  ("space g d" " gd")
  ("space g d w" (make 'infix-iff))
  ("space g d w space" (make 'infix-iff))
  ;;("g d w var" "gdw")
  ("f u r space a l l e" (make 'prefix-for-all))
  ("f u r space a l l e space" (make 'prefix-for-all))
  ("f u e r space a l l e" (make 'prefix-for-all))
  ("f u e r space a l l e space" (make 'prefix-for-all)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Special toggles
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(kbd-map
  (:require (inside? 'equation*))
  ("C-&" (equation->eqnarray (tree-innermost 'equation*))))

(kbd-map
  (:require (inside? 'equation))
  ("C-&" (equation->eqnarray (tree-innermost 'equation))))

(kbd-map
  (:require (inside? 'eqnarray*))
  ("C-&" (eqnarray->equation (tree-innermost 'eqnarray*))))
