Question

I use a lot the autocomplete feature for commands and environments of AucTeX, via the TeX-insert-macro and LaTeX-environment functions. But is there a way to add to the built-in list more commands and macros (\enquote{}, \noindent, etc.)?

Was it helpful?

Solution

The standard way to add support for macros and environment is writing a style file, it's documented here: https://www.gnu.org/software/auctex/manual/auctex.html#Style-Files The relevant functions are TeX-add-symbols and LaTeX-add-environments.

To add new macros and environments without creating style files see this answer: https://stackoverflow.com/a/17249399/2442087 For example, to add the foo macro and the bar environment add this to your init file:

(add-hook 'LaTeX-mode-hook
      (lambda ()
        (TeX-add-symbols "foo")
        (LaTeX-add-environments "bar")))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top