I've installed the company package in order to get an auto-completion functionality. It works well in my ESS environment, but no in latex. In fact, no completions are showed in latex buffers when I activate M-x company-mode
. What could be the problem?
Here it is my .emacs
config for latex
(setq TeX-parse-self t)
(setq-default TeX-master nil)
;;
;;ispell config
;;
(setq ispell-program-name "hunspell")
(setq ispell-local-dictionary "es_ES") ;; Change dictionaries here!
(setq ispell-local-dictionary-alist
'(("es_ES" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil utf-8)))
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
(add-hook 'LaTeX-mode-hook 'TeX-source-correlate-mode)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)
(setq TeX-PDF-mode t)
(setq TeX-output-view-style
(quote
(("^pdf$" "." "evince -f %o")
("^html?$" "." "iceweasel %o"))))
UPDATE:
Removing auto complete configuration for other environments from the init file and adding the following line solves the problem.
;;
;; COMPANY
;;
(use-package company
:ensure t
:config
(setq company-idle-delay 0)
(setq company-minimum-prefix-length 2)
(global-company-mode t)
)
LaTeX
installed?. You will can use eithercompany-auctex
orcompany-math
for the completions to work. See Here company-auctex or here company-math. – minibuffer Sep 16 '19 at 16:52C-c C-m
(orC-c RET
) for macros andC-c C-e
for environments? With(setq TeX-parse-self t)
in your init file, you get completion support for packages you use as well (packages supported by AUCTeX). – Arash Esbati Sep 18 '19 at 6:38