[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LaTeX templates (or just templates in general)
From: |
Jean Magnan de Bornier |
Subject: |
Re: LaTeX templates (or just templates in general) |
Date: |
Sat, 16 May 2009 14:52:32 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) |
Orri <orritomasson@gmail.com> wrote :
| I am rather new to emacs.
>
| I have used the editor TextMate on mac and it has a very nice feature I like
| and was wondering how I can acheive a similar thing in emacs.
>
| When I am in latex mode in textmate and write temp[tabkey], I can choose
| from a list of code segments to insert to the current file (or buffer). I
| often use this to insert frequently used code segments (3-10 lines) to
| achieve tasks I frequently do. These segments are stored in a folder named
| ~/Library/Applications Support/LaTeX/Templates
>
| I know I can use [C-x i], But it takes so much time to write the correct
| path every single time.
| So I am looking for something like [C-x i] except it by default starts in
| specified directory (rather than the current directory).
>
| I know I can of course, in every latex project directory specify a symbolic
| link (with a short name) to this directory, but I find it to be too much of
| dirty hack.
>
| Does anyone have any suggestions about how to acieve this?
Hi,
I have several elisp functions defined in my .emacs file to help me the
way you think: here is one to add a frame to a beamer document:
.....................
(defun addframe ()
"Ouvre une frame dans beamer"
(interactive)
(insert "\\begin{frame}
\\frametitle{}
\\end{frame}")
(backward-char 13)
(indent-for-tab-command)
)
(global-set-key (kbd "C-c f") 'addframe)
....................
You can write many of those to your needs...
--
Jean