auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Using templates and inserting \usepackage


From: David Kastrup
Subject: Re: [AUCTeX] Using templates and inserting \usepackage
Date: Tue, 19 Apr 2005 01:57:27 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Jens Kubieziel <address@hidden> writes:

> I used vim with latex-suite for editing LaTeX-files. However
> recently I switched to GNU emacs and AUCTeX. Right now I'm missing
> two features which I couldn't find in AUCTeX-Docu:
>
> 1. Templates
>    I would like to use a LaTeX-template like
>    \documentclass{scrartcl}
>    \usepackage{...}
>    \begin{document}
>    \end{document}
>    This file sits somewhere and each time I create an empty .tex-file
>    this template gets automatically included. How can I achieve
>    this?

(info "(autotype)") should give you several suggestions.  It is true
that AUCTeX should probably provide something "native" here.

You could probably also try something like
(add-hook 'LaTeX-document-style-hook
     #'(lambda () (forward-line -1) (insert "\\usepackage{...}")
                  (forward-line 1)))
or so.

> 2. Inserting usepackage
>    Furthermore I'd like to point the cursor at the header of a
>    LaTeX-document and press some magic keys (F5 in vim latex-suite).
>    This should give me a list of possible packages for \usepackage{}.
>    LaTeX-suite had a hardcoded list and a possibilty to enter some other
>    packages. Is there a way to do this within Emacs/AUCTeX?

C-c RET usepa RET

and then you get TAB completion.  Yes, it would be nice if
"preamble-only" commands would be intelligent enough to insert
themselves into the preamble without one having to move the cursor
there explicitly.

We discussed this at some earlier time, but like many other tasks,
this needs volunteers digging in.  I am currently in the course of
breaking the installation procedures, and Ralf is fixing stuff all
across the board, and both of us actually have very little time.
There are a few other contributors in more confined areas which also
add to the overall quality of AUCTeX, but there are few people that
actually actively work on new features.

> PS.: The pointer to this mailinglist within AUCTeX info should be
> changed.

I think it has already been changed, but of course it needs a new
release until the change is publicized.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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