Function: LaTeX-environment

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

Signature

(LaTeX-environment ARG)

Documentation

Make LaTeX environment (\begin{...}-\end{...} pair).

With prefix ARG, modify current environment.

It may be customized with the following variables:

LaTeX-default-environment Your favorite environment.
LaTeX-default-style Your favorite document class.
LaTeX-default-options Your favorite document class options.
LaTeX-float Where you want figures and tables to float.
LaTeX-table-label Your prefix to labels in tables.
LaTeX-figure-label Your prefix to labels in figures.
LaTeX-default-format Format for array and tabular.
LaTeX-default-width Width for minipage and tabular*.
LaTeX-default-position Position for array and tabular.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/latex.el
(defun LaTeX-environment (arg)
  "Make LaTeX environment (\\begin{...}-\\end{...} pair).
With prefix ARG, modify current environment.

It may be customized with the following variables:

`LaTeX-default-environment'       Your favorite environment.
`LaTeX-default-style'             Your favorite document class.
`LaTeX-default-options'           Your favorite document class options.
`LaTeX-float'                     Where you want figures and tables to float.
`LaTeX-table-label'               Your prefix to labels in tables.
`LaTeX-figure-label'              Your prefix to labels in figures.
`LaTeX-default-format'            Format for array and tabular.
`LaTeX-default-width'             Width for minipage and tabular*.
`LaTeX-default-position'          Position for array and tabular."

  (declare (modes LaTeX-mode))
  (interactive "*P")
  (let* ((default (cond
                   ((TeX-near-bobp) "document")
                   ((and LaTeX-default-document-environment
                         (string-equal (LaTeX-current-environment) "document"))
                    LaTeX-default-document-environment)
                   (t LaTeX-default-environment)))
         (environment (completing-read (format-prompt "Environment type" default)
                                       (LaTeX-environment-list-filtered) nil nil
                                       nil 'LaTeX-environment-history default)))
    ;; Use `environment' as default for the next time only if it is different
    ;; from the current default.
    (unless (equal environment default)
      (setq LaTeX-default-environment environment))

    (let ((entry (assoc environment (LaTeX-environment-list))))
      (if (null entry)
          (LaTeX-add-environments (list environment)))

      (if arg
          (LaTeX-modify-environment environment)
        (LaTeX-environment-menu environment)))))