auctex
[Top][All Lists]

## [AUCTeX] Fancy section hook

 From: Claude Lacoursière Subject: [AUCTeX] Fancy section hook Date: Wed, 12 Apr 2006 16:27:43 +0200 User-agent: Mutt/1.5.9i

Hi.

I have limited elisp programming experience and I am looking
for advice in programming a section-hook command that would
perform the following operations when creating a section
named "Foo Bar" with label foobar, say:

1) add the following three lines to a file, defined
somewhere in the local variables the file:
\sectionSource{foobar}
\sectionBody{foobar-bd}
\sectionOutline{foobar-ol}

2) at the current point in the buffer, create the following environments:

\begin{foobar}
\section{Foo Bar}
\label{sec:foobar}
\begin{foobar-ol}

\end{foobar-ol}
\begin{foobar-bd}

\end{foobar-bd}
\end{foobar}

3) place 'point' at the beginning of the blank line
immediately following the \begin{foobar-ol}  command.

The point of this is to use the "comment" so that either the
section outline or the section body is typeset by defining
the \sectionBody and \sectionOutline macros as aliases to
the \includecomment or \excludecomment macros of the
"comment" package.  The \sectionSource macro would then be
defined either as \includecomment as well or something
else.

A simpler version of this system would replace the command
which inserts to AUCTeX section command so that the \label
command would _not_ go on a separate line so the text
produced in the buffer would be:

\section{Foo Bar} \label{sec:foobar}
%
%
%

and point would be placed on the second character of the
second comment line.   This allows processing with the
'metainfo' package.

Any hints on how to do this from the elisp experts would be
greatly appreciated.

Best,
/Claude.

--
Claude Lacoursière,