[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] autocomplete only for Latex commands/keywords?

From: Jannis
Subject: Re: [AUCTeX] autocomplete only for Latex commands/keywords?
Date: Tue, 28 May 2013 10:06:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 27.05.2013 20:48, Mosè Giordano wrote:
Hi Jannis,

2013/5/27 Jannis <address@hidden>:
There is a graphicx.el file under /usr/share/emacs/site-lisp/auctex/style.
This TeX-add-style-hook thing, however, is missing in my .emacs. Do I need
it? Do I need all packages I frequently use there? Or is there a way to tell
Auctex to load the style settings for all packages defined in the preamble
of the current *.tex file?
Did you try to reproduce the steps suggested by Tassilo?  Do you have
the auto/bar.el file after saving bar.tex?


OK, I created Tassilos file, ran C-c C-c several times and the auto/bar.el file was created with the content Tassilo mentioned. When I now go back to bar.tex and hit C-c C-m and start typing

include <TAB>

another buffer opens with this content:

Click <mouse-2> on a completion to select it.
In this buffer, type RET to select the completion near point.

Possible completions are:

So there is no completion for \includegraphics.

Is there in your cases?


As a reference:

GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.6)
no idea how to find out the Auctex version. The latex specific lines of my .emacs are:

(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq TeX-save-query nil)
(setq TeX-PDF-mode t)
(setq-default TeX-master nil)

(setq TeX-view-program-list '(("Okular" "okular --unique %u")))

(add-hook 'LaTeX-mode-hook '(lambda ()
                  (add-to-list 'TeX-expand-list
                       '("%u" Okular-make-url))))

(defun Okular-make-url () (concat
               (expand-file-name (funcall file (TeX-output-extension) t)
                         (file-name-directory (TeX-master-file)))
               (expand-file-name (TeX-master-directory))

(setq TeX-view-program-selection '((output-pdf "Okular")))
'(TeX-output-view-style '(("^pdf$" "." "okular %s.pdf")))

(load "preview-latex.el" nil t t)

(setq ispell-program-name "aspell") ; could be ispell as well, depending on your preferences (setq ispell-dictionary "english") ; this can obviously be set to any language your spell-checking program supports

(require 'tex-site)
(autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t)
(autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil)
(autoload 'reftex-citation "reftex-cite" "Make citation" nil)
(autoload 'reftex-index-phrase-mode "reftex-index" "Phrase Mode" t)
(add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
(add-hook 'plain-tex-mode-hook 'turn-on-reftex) ; with Emacs latex mode

;; (add-hook 'reftex-load-hook 'imenu-add-menubar-index)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)

(setq LaTeX-eqnarray-label "eq"
      LaTeX-equation-label "eq"
      LaTeX-figure-label "fig"
      LaTeX-table-label "tab"
      LaTeX-myChapter-label "chap"
      TeX-auto-save t
      TeX-newline-function 'reindent-then-newline-and-indent
      TeX-parse-self t
      '("style/" "auto/"

(add-hook 'LaTeX-mode-hook 'turn-on-auto-fill)
(add-hook 'latex-mode-hook 'turn-on-auto-fill)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(setq-default fill-column 80)

(dolist (hook '(LaTeX-mode-hook))
  (add-hook hook (lambda () (flyspell-mode 1))))
(dolist (hook '(latex-mode-hook))
  (add-hook hook (lambda () (flyspell-mode 1))))

(setq TeX-parse-self t) ; Enable parse on load.
(setq TeX-auto-save t) ; Enable parse on save.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]