auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] Changes to auctex/doc/auctex.texi,v


From: Ralf Angeli
Subject: [AUCTeX-diffs] Changes to auctex/doc/auctex.texi,v
Date: Sat, 04 Apr 2009 20:09:44 +0000

CVSROOT:        /cvsroot/auctex
Module name:    auctex
Changes by:     Ralf Angeli <angeli>    09/04/04 20:09:44

Index: auctex.texi
===================================================================
RCS file: /cvsroot/auctex/auctex/doc/auctex.texi,v
retrieving revision 1.294
retrieving revision 1.295
diff -u -b -r1.294 -r1.295
--- auctex.texi 22 Feb 2009 14:48:38 -0000      1.294
+++ auctex.texi 4 Apr 2009 20:09:44 -0000       1.295
@@ -3615,6 +3615,8 @@
 @code{ignore} is a function that does not do anything, so when you
 insert a @samp{tref} you will be prompted for a label and no more.
 
+You can use the following types of specifiers for arguments:
+
 @table @code
 @item string
 Use the string as a prompt to prompt for the argument.
@@ -3768,20 +3770,21 @@
 @end lisp
 
 @findex LaTeX-env-item
-The only hook that is generally useful is @code{LaTeX-env-item}, which is
-used for environments that contain items.  It is completely up to the
-environment hook to insert the environment, but the function
address@hidden may be of some help.  The hook will be
-called with the name of the environment as its first argument, and extra
-arguments can be provided by adding them to a list after the hook.
+It is completely up to the environment hook to insert the environment,
+but the function @code{LaTeX-insert-environment} may be of some help.
+The hook will be called with the name of the environment as its first
+argument, and extra arguments can be provided by adding them to a list
+after the hook.
 
 For simple environments with arguments, for example defined with
 @samp{\newenvironment}, you can make @AUCTeX{} prompt for the arguments
 by giving the prompt strings in the call to
address@hidden  (An optional argument can be indicated
-by putting the prompt string into a vector.)  For example, if you have
-defined a @code{loop} environment with the three arguments @var{from},
address@hidden, and @var{step}, you can add support for them in a style file.
address@hidden  The fact that an argument is optional
+can be indicated by wrapping the prompt string in a vector.
+
+For example, if you have defined a @code{loop} environment with the
+three arguments @var{from}, @var{to}, and @var{step}, you can add
+support for them in a style file.
 
 @example
 %% loop.sty
@@ -3799,7 +3802,7 @@
     '("loop" "From" "To" "Step"))))
 @end lisp
 
-If an environment is defined multiple times, @AUCTeX{} will chose the
+If an environment is defined multiple times, @AUCTeX{} will choose the
 one with the longest definition.  Thus, if you have an enumerate style
 file, and want it to replace the standard @LaTeX{} enumerate hook above,
 you could define an @file{enumerate.el} file as follows, and place it in
@@ -3827,6 +3830,62 @@
 Insert environment of type @var{env}, with optional argument @var{extra}.
 @end defun
 
+Following is a list of available hooks for
address@hidden:
+
address@hidden @code
address@hidden LaTeX-env-item
+Insert the given environment and the first item.
+
address@hidden LaTeX-env-figure
+Insert the given figure-like environment with a caption and a label.
+
address@hidden LaTeX-env-array
+Insert the given array-like environment with position and column
+specifications.
+
address@hidden LaTeX-env-label
+Insert the given environment with a label.
+
address@hidden LaTeX-env-list
+Insert the given list-like environment, a specifier for the label and
+the first item.
+
address@hidden LaTeX-env-minipage
+Insert the given minipage-like environment with position and width
+specifications.
+
address@hidden LaTeX-env-tabular*
+Insert the given tabular*-like environment with width, position and
+column specifications.
+
address@hidden LaTeX-env-picture
+Insert the given environment with width and height specifications.
+
address@hidden LaTeX-env-bib
+Insert the given environment with a label for a bibitem.
+
address@hidden LaTeX-env-contents
+Insert the given environment with a filename as its argument.
+
address@hidden LaTeX-env-args
+Insert the given environment with arguments.  You can use this as a hook
+in case you want to specify multiple complex arguments just like in
+elements of @code{TeX-add-symbols}.  This is most useful if the
+specification of arguments to be prompted for with strings and strings
+wrapped in a vector as described above is too limited.
+
+Here is an example from @file{listings.el} which calls a function with
+one argument in order to prompt for a key=value list to be inserted as
+an optional argument of the @samp{lstlisting} environment:
+
address@hidden
+(LaTeX-add-environments
+ `("lstlisting" LaTeX-env-args
+   [TeX-arg-key-val ,LaTeX-listings-key-val-options]))
address@hidden lisp
address@hidden ftable
+
 @node Adding Other
 @subsection Adding Other Information
 @cindex Adding bibliographies




reply via email to

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