Skip to main content
added 568 characters in body
Source Link
Drew
  • 79.1k
  • 10
  • 123
  • 257

There are also other Unicode characters, whose names do not start with math but which are sometimes used in mathematics - for example, character PARTIAL DIFFERENTIAL. You can easily create commands that insert any of those characters too. (And note that the characters whose names start with math might well require using a special font - many fonts do not support them.)

One advantage of having commands named after chars they insert, instead of, say, just binding keys to singleton strings of the characters, is that you can use M-x to enter characters that you use less often, by name using completion. Instead of completing against the entire set of Unicode character names, you complete against the names of character-inserting commands you have defined.

There are also other Unicode characters, whose names do not start with math but which are sometimes used in mathematics. You can easily create commands that insert any of those characters too.

There are also other Unicode characters, whose names do not start with math but which are used in mathematics - for example, character PARTIAL DIFFERENTIAL. You can easily create commands that insert any of those characters too. (And note that the characters whose names start with math might well require using a special font - many fonts do not support them.)

One advantage of having commands named after chars they insert, instead of, say, just binding keys to singleton strings of the characters, is that you can use M-x to enter characters that you use less often, by name using completion. Instead of completing against the entire set of Unicode character names, you complete against the names of character-inserting commands you have defined.

Source Link
Drew
  • 79.1k
  • 10
  • 123
  • 257

You say: There is relatively small subset of unicode characters (I'm guessing 10-20) I am inserting all the time.

In that case, as @Tobias indicated, you can just bind, for each of them, a simple key sequence to either (a) a command that inserts that character or (b) a single-character string with that character (this acts like a keyboard macro, to insert the character).

Library ucs-cmds.el can help you define such commands. The resulting commands have the same names as the characters. You can use macro ucsc-make-commands to define a whole set of commands that insert a character of a certain kind.

For example, you can put this in your init file to define commands that insert all of the Unicode math symbols:

(require 'ucs-cmds)           ; Load the library
(ucsc-make-commands "^math")  ; Use the macro to create commands

That gives you commands whose names are the same as the math characters. Bind any of these that you use a lot to easy-to-use-keys. For example:

(global-set-key (kbd "C-c S") 'mathematical-bold-capital-sigma)

(Or bind a key to such a command only in Tex mode, using define-key with its keymap.)

With just that simple (ucsc-make-commands "^math") you have available all of the character-inserting commands that are listed below.

There are also other Unicode characters, whose names do not start with math but which are sometimes used in mathematics. You can easily create commands that insert any of those characters too.

You can of course use a tighter regular expression than ^math, if you want to define only characters matching such a pattern. For example, this defines commands for all of the partial-differential characters:

(ucsc-make-commands "^math.*partial differential")

That gives you these commands:

mathematical-bold-italic-partial-differential
mathematical-bold-partial-differential
mathematical-italic-partial-differential
mathematical-sans-serif-bold-italic-partial-differential
mathematical-sans-serif-bold-partial-differential

Note that the Unicode character names separate words with space characters, and the names are uppercase. The corresponding insertion commands use hyphens instead of spaces and lowercase instead of uppercase.


These are the commands that insert characters whose names start with math. They are what you get by evaluating (ucsc-make-commands "^math").

mathematical-bold-capital-a
mathematical-bold-capital-alpha
mathematical-bold-capital-b
mathematical-bold-capital-beta
mathematical-bold-capital-c
mathematical-bold-capital-chi
mathematical-bold-capital-d
mathematical-bold-capital-delta

...

mathematical-bold-digit-eight
mathematical-bold-digit-five
mathematical-bold-digit-four

...

mathematical-bold-epsilon-symbol
mathematical-bold-fraktur-capital-a
mathematical-bold-fraktur-capital-b

...

mathematical-bold-fraktur-small-a
mathematical-bold-fraktur-small-b

...

mathematical-bold-italic-capital-a
mathematical-bold-italic-capital-alpha
mathematical-bold-italic-capital-b
mathematical-bold-italic-capital-beta

...

mathematical-bold-italic-nabla
mathematical-bold-italic-partial-differential
mathematical-bold-italic-phi-symbol
mathematical-bold-italic-pi-symbol
mathematical-bold-italic-rho-symbol
mathematical-bold-italic-small-a
mathematical-bold-italic-small-alpha
mathematical-bold-italic-small-b
mathematical-bold-italic-small-beta

...

mathematical-bold-nabla
mathematical-bold-partial-differential
mathematical-bold-phi-symbol
mathematical-bold-pi-symbol
mathematical-bold-rho-symbol
mathematical-bold-script-capital-a
mathematical-bold-script-capital-b

...

mathematical-bold-script-small-a
mathematical-bold-script-small-b

...

mathematical-bold-small-a
mathematical-bold-small-alpha
mathematical-bold-small-b
mathematical-bold-small-beta

...

mathematical-double-struck-capital-a
mathematical-double-struck-capital-b

...

mathematical-double-struck-digit-eight
mathematical-double-struck-digit-five
mathematical-double-struck-digit-four
mathematical-double-struck-digit-nine
mathematical-double-struck-digit-one
mathematical-double-struck-digit-seven
mathematical-double-struck-digit-six
mathematical-double-struck-digit-three
mathematical-double-struck-digit-two
mathematical-double-struck-digit-zero
mathematical-double-struck-small-a
mathematical-double-struck-small-b

...

mathematical-falling-diagonal
mathematical-fraktur-capital-a
mathematical-fraktur-capital-b

...

mathematical-fraktur-small-a
mathematical-fraktur-small-b

...

mathematical-italic-capital-a
mathematical-italic-capital-alpha
mathematical-italic-capital-b
mathematical-italic-capital-beta

...

mathematical-italic-nabla
mathematical-italic-partial-differential
mathematical-italic-phi-symbol
mathematical-italic-pi-symbol
mathematical-italic-rho-symbol
mathematical-italic-small-a
mathematical-italic-small-alpha

...

mathematical-italic-small-dotless-i
mathematical-italic-small-dotless-j
mathematical-italic-small-e
mathematical-italic-small-epsilon

...

mathematical-italic-small-final-sigma

...

mathematical-left-angle-bracket
mathematical-left-double-angle-bracket
mathematical-left-flattened-parenthesis
mathematical-left-white-square-bracket
mathematical-left-white-tortoise-shell-bracket
mathematical-monospace-capital-a
mathematical-monospace-capital-b

...

mathematical-monospace-digit-eight
mathematical-monospace-digit-five
mathematical-monospace-digit-four

...

mathematical-monospace-small-a
mathematical-monospace-small-b

...

mathematical-right-angle-bracket
mathematical-right-double-angle-bracket
mathematical-right-flattened-parenthesis
mathematical-right-white-square-bracket
mathematical-right-white-tortoise-shell-bracket
mathematical-rising-diagonal
mathematical-sans-serif-bold-capital-a
mathematical-sans-serif-bold-capital-alpha
mathematical-sans-serif-bold-capital-b
mathematical-sans-serif-bold-capital-beta

...

mathematical-sans-serif-bold-digit-eight
mathematical-sans-serif-bold-digit-five
mathematical-sans-serif-bold-digit-four

...

mathematical-sans-serif-bold-italic-capital-a
mathematical-sans-serif-bold-italic-capital-alpha
mathematical-sans-serif-bold-italic-capital-b
mathematical-sans-serif-bold-italic-capital-beta

...

mathematical-sans-serif-bold-italic-nabla
mathematical-sans-serif-bold-italic-partial-differential

...

mathematical-sans-serif-bold-italic-small-a
mathematical-sans-serif-bold-italic-small-alpha
mathematical-sans-serif-bold-italic-small-b
mathematical-sans-serif-bold-italic-small-beta

...

mathematical-sans-serif-bold-italic-small-final-sigma

...

mathematical-sans-serif-bold-nabla
mathematical-sans-serif-bold-partial-differential

...

mathematical-sans-serif-bold-small-a
mathematical-sans-serif-bold-small-alpha
mathematical-sans-serif-bold-small-b
mathematical-sans-serif-bold-small-beta

...

mathematical-sans-serif-bold-small-final-sigma

...

mathematical-sans-serif-capital-a
mathematical-sans-serif-capital-b

...

mathematical-sans-serif-digit-eight
mathematical-sans-serif-digit-five
mathematical-sans-serif-digit-four

...

mathematical-sans-serif-italic-capital-a
mathematical-sans-serif-italic-capital-b

...

mathematical-sans-serif-italic-small-a
mathematical-sans-serif-italic-small-b

...

mathematical-sans-serif-small-a
mathematical-sans-serif-small-b

...

mathematical-script-capital-a

...

mathematical-script-small-a
mathematical-script-small-b

...