Closed SimonBoulier closed 7 years ago
company-math
provides comprehensive completion for math symbols. It relies on math-symbol-lists and provides unicode symbol insertion. Even its basic (LaTeX only) math symbol list is more comprehensive than that of AucTeX.
Besides math symbols company-math provides a backend for latex commands (company-latex-commands
) but that's not the main feature. I am not familiar with company-auctex
but I would guess it has a better support for latex commands and environments because it relies on dynamic auctex completions. So my suggestion would be to use company-math-symbols-latex
or company-math-symbols-unicode
for mathematical symbols completion and company-auctex
for everything else.
You should be able to use both company-math
and company-backends
together in a group backend. See how company-auctex
does it and company-math
instalation instructions.
@alexeyr might have something to add to this.
So for example you might try the following grouped backend:
'(company-math-symbols-latex company-auctex-macros company-auctex-environments)
Thank you very much. I realized that I didn't succeed in installing correctly company-math.
Here is an extract of my .emacs:
(require 'company) (add-hook 'after-init-hook 'global-company-mode) (setq company-idle-delay 0.3) (add-to-list 'company-backends 'company-math-symbols-unicode) (defun my-latex-mode-setup () (setq-local company-backends (append '((company-math-symbols-latex company-latex-commands)) company-backends))) (add-hook 'LaTex-mode-hook 'my-latex-mode-setup)
After that only company-math-symbols-unicode
appears in the list company-backends
, but not the grouped (company-math-symbols-latex company-latex-commands)
. LaTex-mode-hook
seems ok as some other modes are activated by it.
Any idea what is wrong?
You misspelled your hook. It should be LaTeX-mode-hook
.
Ouch! Sorry for being so distracted.
Correcting the hook doesn't load company-math-symbols-unicode
.
It works if I group the three in the hook. Is it the standard way to go?
If so, we could clarify activation instructions...
Thanks again in any case.
Hi. How does company-math compares with company-auctex? Can we use both at the same time? Thank you!