auctex
[Top][All Lists]
Advanced

[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: Mon, 27 May 2013 15:31:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 27.05.2013 15:07, Tassilo Horn wrote:
Jannis <address@hidden> writes:

There is indeed no autocompletion for "\linespread", but I don't know
any "\includefigure" macro.  Did you mean "\includegraphics"?
Indeed I did. Is there any way to include such (or all) available
macros into this autocompletion?
This should happen automatically.  If you have \usepackage{graphicx} in
your document, AUCTeX will load auctex/style/graphicx.el, and that adds
the macros and environments provided by the graphicx package (including
\includegraphics) to the completion machinery.  For this to work, you
need the customizations Mosè mentioned previously.
My settings are exactly as Mosé suggested and there is still no completion for
\includegraphics and others but only for some standard Latex commands.

Any ideas?
I've just written this minimal sample file bar.tex and saved it.

--8<---------------cut here---------------start------------->8---
\documentclass{article}
\usepackage{graphicx}

\begin{document}

\end{document}
--8<---------------cut here---------------end--------------->8---

When saving, AUCTeX created a file auto/bar.el with these contents.

--8<---------------cut here---------------start------------->8---
(TeX-add-style-hook
  "bar"
  (lambda ()
    (TeX-run-style-hooks
     "latex2e"
     "article"
     "art10"
     "graphicx")))
--8<---------------cut here---------------end--------------->8---

The (TeX-run-style-hooks ... "graphicx") will add the macros provided by
the graphicx package to the completions.  When I hit C-c RET now, I can
complete \includegraphics.

What AUCTeX version are you using?  Is the corresponding style file
graphicx.el installed somewhere (maybe as compiled graphicx.elc)?  It
should be somewhere below /usr/share/emacs/site-lisp/auctex/.

Bye,
Tassilo

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?

Thanks a lot
Jannis





















_______________________________________________
auctex mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/auctex




reply via email to

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