AucTeX : Différence entre versions

De LaTeX
Aller à : navigation, rechercher
(From http://tex.stackexchange.com/questions/20843/useful-shortcuts-or-key-bindings-or-predefined-commands-for-emacsauctex)
 
(Aucune différence)

Version actuelle en date du 20 septembre 2011 à 17:31

Here are some commands for Emacs and AucTeX. AucTeX being a subset of Emacs.

  • C-c C-h shows all bindings that start C-c
  • C-h b shows all bindings currently available.

Now for some details.

Macros

  • C-c C-m insert macro (warning: pressing TAB at this point will take a while because auctex will load a list of all the macros it knows about. If the macro you pick is \usepackage and then TAB auctex will load a list of all the packages it knows about for you to choose from.)
  • C-c C-f C-e Add an \emph{} and place cursor between the braces. Or if you have some text marked, wrap it in \emph replace C-e by C-b, C-c C-i, C-t for \textbf \textsc \textit or \texttt respectively. C-c C-f ? will give you a list of all the possibilities. This command knows about mathmode and will behave accordingly inside dollars or in equation environment.

Sections/Environments

  • C-c C-s create section with optional label
  • C-c C-e create environment (\start and \end tags) choose from an autocomplete list or type your own. (If you have LaTeX mode on in an empty file, this will default to the document environment, and prompt you for a documentclass.
  • C-u C-c C-e change the type of the current (innermost) environment
  • C-c . mark current environment
  • C-c * mark current section/subsection
  • C-c ] close current environment
  • C-M-a find matching begin environment, C-M-e find matching end

Compilation

  • C-c C-c do most appropriate compilation activity (LaTeX, BibTeX, View...) It's pretty smart, and you can override the default to pick what action you cant to do.
  • C-c C-r do most appropriate compilation activity (LaTeX, BibTeX, View...) to the region that has been pinned by C-c C-t C-r. Of course one wants to use C-c . or C-c * to ease the select a region.

C-c C-v view document (without compiling)

RefTeX

RefTeX, while not strictly part of AucTeX is an essential part of your emacs/TeX working life.

  • C-c ( add label. Auto-suggests names based on current section.
  • C-c ) add \ref you can select from the list of currently defined labels. If you customise a certain variable (whose name escapes me) you can add hyperref, varioref and cleverref reference commands to the list of types of reference available.
  • C-c [ add citation. RefTeX understands bibliography commands and will search your .bib for references that match the pattern you supply to this command. Can be customised to have harvard, chicago and other kinds of reference commands available. (No BibLaTeX citation style support yet as far as I know.)
  • C-c = jump to section: opens list of sections/subsections etc you can jump to.

Miscellaneous

LaTeX-math-abbrev-prefix is a useful thing which is ` by default.

This gives you access to a bunch of mathmode symbols in two keystrokes. For example, you can get \subset by typing ` {

By customising LaTeX-math-list you can get whatever you like out of this prefix command. A bunch of the most useful are on the refcard.

  • C-c ; comment/uncomment region

External links

<references/>