[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The most commonly used commands/macros of AUCTeX are those which simply insert templates for often used TeX and/or LaTeX/ConTeXt constructs, like font changes, handling of environments, etc. These features are very simple, and easy to learn, and help you avoid stupid mistakes like mismatched braces, or `\begin{}'-`\end{}' pairs.
4.1 Insertion of Quotes, Dollars, and Braces | Inserting double quotes | |
4.2 Inserting Font Specifiers | ||
4.3 Inserting chapters, sections, etc. | ||
4.4 Inserting Environment Templates |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In TeX, literal double quotes `"like this"' are seldom used, instead two single quotes are used `"like this"'. To help you insert these efficiently, AUCTeX allows you to continue to press " to insert two single quotes. To get a literal double quote, press " twice.
Inserts the value of TeX-open-quote
(normally `"') or
TeX-close-quote
(normally `"') depending on the context.
With prefix argument, always inserts `"' characters.
TeX-open-quote
and TeX-close-quote
will be inserted
after typing " once again.
If you include the style files `german' or `ngerman'
TeX-open-quote
and TeX-close-quote
will be set to the
values of LaTeX-german-open-quote
and
LaTeX-german-close-quote
respectively.
TeX-quote-after-quote
will be set to the value of
LaTeX-german-quote-after-quote
. If you write texts which
facilitate the style files mentioned before, you should customize
those special variables instead of the standard variables.
Similarly you should customize LaTeX-csquotes-open-quote
,
LaTeX-csquotes-close-quote
and
LaTeX-csquotes-quote-after-quote
if you use the `csquotes'
package. The quotation characters will only be used if both
variables---LaTeX-csquotes-open-quote
and
LaTeX-csquotes-close-quote
---are non-empty strings. But then the
`csquotes'-related values will take precedence over the
`(n)german'-related ones.
In AUCTeX, dollar signs should match like they do in TeX. This has been partially implemented, we assume dollar signs always match within a paragraph. The first `$' you insert in a paragraph will do nothing special. The second `$' will match the first. This will be indicated by moving the cursor temporarily over the first dollar sign. If you enter a dollar sign that matches a double dollar sign `$$' AUCTeX will automatically insert two dollar signs. If you enter a second dollar sign that matches a single dollar sign, the single dollar sign will automatically be converted to a double dollar sign.
Show matching dollar sign if this dollar sign end the TeX math mode. Ensure double dollar signs match up correctly by inserting extra dollar signs when needed.
With optional arg, insert that many dollar signs.
To avoid unbalanced braces, it is useful to insert them pairwise. You can do this by typing C-c {.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Perhaps the most used keyboard commands of AUCTeX are the short-cuts available for easy insertion of font changing macros.
If you give an argument (that is, type C-u) to the font command,
the innermost font will be replaced, i.e. the font in the TeX group
around point will be changed. The following table shows the available
commands, with -!-
indicating the position where the text
will be inserted.
If replace is not nil, replace current font. what
determines the font to use, as specified by TeX-font-list
.
Each entry is a list with three elements. The first element is the key to activate the font. The second element is the string to insert before point, and the third element is the string to insert after point. An optional fourth element means always replace if not nil.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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
.
Determine the type of section to be inserted, by the argument arg.
The following variables can be set to customize the function.
LaTeX-section-hook
LaTeX-section-label
The precise behavior of LaTeX-section
is defined by the contents
of LaTeX-section-hook
.
The following variables are set before the hooks are run
LaTeX-section
.
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
LaTeX-section-title
LaTeX-section-toc
LaTeX-section-section
LaTeX-section-label
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
.
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.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A large apparatus is available that supports insertions of environments, that is `\begin{}' -- `\end{}' pairs.
AUCTeX is aware of most of the actual environments available in a specific document. This is achieved by examining your `\documentclass' command, and consulting a precompiled list of environments available in a large number of styles.
You insert an environment with C-c C-e, and select an environment type. Depending on the environment, AUCTeX may ask more questions about the optional parts of the selected environment type. With C-u C-c C-e you will change the current environment.
If the optional argument arg is not-nil (i.e. you have given a prefix argument), the current environment is modified and no new environment is inserted.
As a default selection, AUCTeX will suggest the environment last
inserted or, as the first choice the value of the variable
LaTeX-default-environment
.
If the document is empty, or the cursor is placed at the top of the document, AUCTeX will default to insert a `document' environment.
Most of these are described further in the following sections, and you may easily specify more. See section 4.4.5 Customizing environments.
4.4.1 Equations | ||
4.4.2 Floats | ||
4.4.3 Itemize-like | ||
4.4.4 Tabular-like | ||
4.4.5 Customizing environments |
You can close the current environment with C-c ], but we suggest that you use C-c C-e to insert complete environments instead.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When inserting equation-like environments, the `\label' will have a default prefix, which is controlled by the following variables:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Figures and tables (i.e., floats) may also be inserted using AUCTeX. After choosing either `figure' or `table' in the environment list described above, you will be prompted for a number of additional things.
LaTeX-float
.
LaTeX-figure-label
and
LaTeX-table-label
.
Moreover, you will be asked if you want the contents of the float environment to be horizontally centered. Upon a positive answer a `\centering' macro will be inserted at the beginning of the float environment.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In an itemize-like environment, nodes (i.e., `\item's) may be inserted using C-c LFD.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When inserting Tabular-like environments, that is, `tabular' `array' etc., you will be prompted for a template for that environment. Related variables:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
See section 12.3 Adding Support for Environments, for how to customize the list of known environments.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by XEmacs shared group account on December, 19 2009
using texi2html 1.65.