]> code.delx.au - gnu-emacs-elpa/blob - packages/company-math/readme.md
Merge commit '0cda39255827f283e7578cd469ae42daad9556a2' from js2-mode
[gnu-emacs-elpa] / packages / company-math / readme.md
1 This add-on defines three *[company-mode](http://company-mode.github.io/)* backends:
2
3 * `company-math-symbols-latex` - math latex tags (_by default, active only on latex math faces_)
4
5 ![symbols](https://raw.github.com/vspinu/company-math/master/img/latex-symbols.png)
6
7 * `company-math-symbols-unicode` - unicode symbols (_by default, active everywhere except math faces_)
8
9 ![math](https://raw.github.com/vspinu/company-math/master/img/unicode-symbols.png)
10
11 * `company-latex-commands` - latex commands
12
13 ## Usage ##
14
15 Start math completion by typing the prefix <kbd>`\`</kbd> key. To select the
16 completion type <kbd>RET</kbd>. Depending on the context and your configuration
17 unicode symbol or latex tag will be inserted.
18
19 ## Activation ##
20
21 Install from [MELPA](http://melpa.milkbox.net/) repository.
22
23 You can either register each backend globally:
24
25
26 ```lisp
27
28 ;; global activation of the unicode symbol completion
29 (add-to-list 'company-backends 'company-math-symbols-unicode)
30
31
32 ```
33
34 or locally per emacs mode:
35
36
37 ```lisp
38
39 ;; local configuration for TeX modes
40 (defun my-latex-mode-setup ()
41 (setq-local company-backends
42 (append '((company-math-symbols-latex company-latex-commands))
43 company-backends)))
44
45 (add-hook 'tex-mode-hook 'my-latex-mode-setup)
46
47 ```
48
49 If you are using `AUCTeX` you might need to use `TeX-mode-hook` instead:
50
51 ```
52 (add-hook TeX-mode-hook 'my-latex-mode-setup)
53 ```
54
55 ## Customization ##
56
57 Set `company-tooltip-align-annotations` to t in order to allin symbols to the
58 right as in the above previews.
59
60 By default unicode symbols backend (`company-math-symbols-unicode`) is not
61 active in latex math environments and latex math symbols
62 (`company-math-symbols-latex`) is not available outside of math latex
63 environmnts. You can use the following variables to adjust this behavior to your
64 liking: `company-math-disallow-unicode-symbols-in-faces`,
65 `company-math-allow-unicode-symbols-in-faces`,
66 `company-math-disallow-latex-symbols-in-faces`,
67 `company-math-allow-latex-symbols-in-faces`.
68