An open API service indexing awesome lists of open source software.

https://github.com/astoff/unicode-math-input.el

Insert Unicode math symbols in Emacs
https://github.com/astoff/unicode-math-input.el

Last synced: 7 months ago
JSON representation

Insert Unicode math symbols in Emacs

Awesome Lists containing this project

README

          

#+title: unicode-math-input.el

#+html:

MELPA

This Emacs package provides two methods to insert mathematical symbols:

- A proper input method for efficient typing. Activate with =C-u C-\
unicode-math RET=. Then TeX commands (e.g., =\alpha=) are replaced
automatically as you type with the corresponding Unicode character.

- An interactive command, =unicode-math-input=, which reads the TeX
name of a symbol with completion and inserts the corresponding
Unicode character.

- A completion-at-point backend. This behaves differently in that it
allows you to complete the /name/ of a symbol rather than insert the
symbol itself. To use it, add
#+begin_src emacs-lisp
(add-hook 'completion-at-point-functions 'unicode-math-input)
#+end_src
to your init file or a mode hook, as desired.

In either case, [[http://mirrors.ctan.org/macros/unicodetex/latex/unicode-math/unimath-symbols.pdf][all symbols]] provided by the unicode-math LaTeX package
are available, with the same names.

The =unicode-math= input method is similar to Emacs's built-in =TeX=,
but it differs in a couple of ways. First, it has a much larger
collection of characters, including various alphabets (Fraktur,
calligraphic, etc.) and combining accents (note you have to type, say,
=\pi\hat= to get π̂). Second, it does not include any sequence not
starting with a backslash, so it interferes less with normal typing.

The input method is customizable; see =M-x customize-group RET
unicode-math-input RET= for details (but note that, by the nature of
input methods, any options must be set /before/ loading the package).

Of particular note is the possibility to define some additional
symbols by setting the variable =unicode-math-input-extra-symbols=.
Here is an example:

#+begin_src emacs-lisp
(setq unicode-math-input-extra-symbols
'(("frowny" . #x01F641) ; hex syntax...
("smiley" . ?🙂))) ; or character syntax
#+end_src