auctex: Sectioning

 
 2.3 Inserting chapters, sections, etc.
 ======================================
 
 Insertion of sectioning macros, that is '\chapter', '\section',
 '\subsection', etc.  and accompanying '\label''s may be eased by using
 'C-c C-s'.  This command is highly customizable, the following describes
 the default behavior.
 
    When invoking you will be asked for a section macro to insert.  An
 appropriate default is automatically selected by AUCTeX, that is either:
 at the top of the document; the top level sectioning for that document
 style, and any other place: The same as the last occurring sectioning
 command.
 
    Next, you will be asked for the actual name of that section, and last
 you will be asked for a label to be associated with that section.  The
 label will be prefixed by the value specified in 'LaTeX-section-hook'.
 
  -- Command: LaTeX-section ARG
      ('C-c C-s') Insert a sectioning command.
 
      Determine the type of section to be inserted, by the argument ARG.
 
         * If ARG is nil or missing, use the current level.
         * If ARG is a list (selected by C-u), go downward one level.
         * If ARG is negative, go up that many levels.
         * If ARG is positive or zero, use absolute level:
              + 0 : part
              + 1 : chapter
              + 2 : section
              + 3 : subsection
              + 4 : subsubsection
              + 5 : paragraph
              + 6 : subparagraph
 
      The following variables can be set to customize the function.
 
      'LaTeX-section-hook'
           Hooks to be run when inserting a section.
      'LaTeX-section-label'
           Prefix to all section references.
 
    The precise behavior of 'LaTeX-section' is defined by the contents of
 'LaTeX-section-hook'.
 
  -- User Option: LaTeX-section-hook
      List of hooks to run when a new section is inserted.
 
      The following variables are set before the hooks are run
 
      LEVEL
           Numeric section level, default set by prefix arg to
           'LaTeX-section'.
      NAME
           Name of the sectioning command, derived from LEVEL.
      TITLE
           The title of the section, default to an empty string.
      TOC
           Entry for the table of contents list, default nil.
      DONE-MARK
           Position of point afterwards, default nil meaning after the
           inserted text.
 
      A number of hooks are already defined.  Most likely, you will be
      able to get the desired functionality by choosing from these hooks.
 
      'LaTeX-section-heading'
           Query the user about the name of the sectioning command.
           Modifies LEVEL and NAME.
      'LaTeX-section-title'
           Query the user about the title of the section.  Modifies
           TITLE.
      'LaTeX-section-toc'
           Query the user for the toc entry.  Modifies TOC.
      'LaTeX-section-section'
           Insert LaTeX section command according to NAME, TITLE, and
           TOC.  If TOC is nil, no toc entry is inserted.  If TOC or
           TITLE are empty strings, DONE-MARK will be placed at the point
           they should be inserted.
      'LaTeX-section-label'
           Insert a label after the section command.  Controlled by the
           variable 'LaTeX-section-label'.
 
      To get a full featured 'LaTeX-section' command, insert
 
           (setq LaTeX-section-hook
                 '(LaTeX-section-heading
           	LaTeX-section-title
           	LaTeX-section-toc
           	LaTeX-section-section
           	LaTeX-section-label))
 
      in your '.emacs' file.
 
    The behavior of 'LaTeX-section-label' is determined by the variable
 'LaTeX-section-label'.
 
  -- User Option: LaTeX-section-label
      Default prefix when asking for a label.
 
      If it is a string, it is used unchanged for all kinds of sections.
      If it is nil, no label is inserted.  If it is a list, the list is
      searched for a member whose car is equal to the name of the
      sectioning command being inserted.  The cdr is then used as the
      prefix.  If the name is not found, or if the cdr is nil, no label
      is inserted.
 
      By default, chapters have a prefix of 'cha:' while sections and
      subsections have a prefix of 'sec:'.  Labels are not automatically
      inserted for other types of sections.