Function: LaTeX-section

LaTeX-section is an interactive and byte-compiled function defined in latex.el.

Signature

(LaTeX-section ARG)

Documentation

Insert a template for a LaTeX section.

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 (universal-argument)), 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:

LaTeX-section-hook Hooks to run when inserting a section.
LaTeX-section-label(var)/LaTeX-section-label(fun) Prefix to all section labels.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/latex.el
(defun LaTeX-section (arg)
  "Insert a template for a LaTeX section.
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 \\[universal-argument]), 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:

`LaTeX-section-hook'    Hooks to run when inserting a section.
`LaTeX-section-label'   Prefix to all section labels."

  (declare (modes LaTeX-mode))
  (interactive "*P")
  (let* ((val (prefix-numeric-value arg))
         (LaTeX-level (cond ((null arg)
                             (LaTeX-current-section))
                            ((listp arg)
                             (LaTeX-down-section))
                            ((< val 0)
                             (LaTeX-up-section (- val)))
                            (t val)))
         (LaTeX-name (LaTeX-section-name LaTeX-level))
         (LaTeX-toc nil)
         (LaTeX-title (if (TeX-active-mark)
                          (buffer-substring (region-beginning)
                                            (region-end))
                        ""))
         (LaTeX-done-mark (make-marker)))
    (run-hooks 'LaTeX-section-hook)
    (LaTeX-newline)
    (if (marker-position LaTeX-done-mark)
        (goto-char (marker-position LaTeX-done-mark)))
    (set-marker LaTeX-done-mark nil)))