[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Citations in LaTeX are done with the \cite
macro or variations of
it. The argument of the macro is a citation key which identifies an
article or book in either a BibTeX database file or in an explicit
thebibliography
environment in the document. RefTeX's
support for citations helps to select the correct key quickly.
4.1 Creating Citations | How to create them. | |
4.2 Citation Styles | Natbib, Harvard, Chicago and Co. | |
4.3 Citation Info | View the corresponding database entry. | |
4.4 Chapterbib and Bibunits | Multiple bibliographies in a Document. | |
4.5 Citations outside LaTeX | How to make citations in Emails etc. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In order to create a citation, press C-c [. RefTeX then prompts for a regular expression which will be used to search through the database and present the list of matches to choose from in a selection process similar to that for selecting labels (see section 3.2 Referencing Labels).
The regular expression uses an extended syntax: `&&' defines a
logic and
for regular expressions. For example
`Einstein&&Bose' will match all articles which mention
Bose-Einstein condensation, or which are co-authored by Bose and
Einstein. When entering the regular expression, you can complete on
known citation keys. RefTeX also offers a default when prompting for a
regular expression. This default is the word before the cursor or the
word before the current `\cite' command. Sometimes this may be a
good search key.
RefTeX prefers to use BibTeX database files specified with a
\bibliography
macro to collect its information. Just like
BibTeX, it will search for the specified files in the current directory
and along the path given in the environment variable BIBINPUTS
.
If you do not use BibTeX, but the document contains an explicit
thebibliography
environment, RefTeX will collect its
information from there. Note that in this case the information
presented in the selection buffer will just be a copy of relevant
\bibitem
entries, not the structured listing available with
BibTeX database files.
In the selection buffer, the following keys provide special commands. A summary of this information is always available from the selection process by pressing ?.
reftex-highlight-selection
, 8.11 Miscellaneous.
\cite
macro referring to them.
\cite
macro for each of it.
reftex-citation
.
In order to define additional commands for this selection process, the
keymap reftex-select-bib-map
may be used.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The standard LaTeX macro \cite
works well with numeric or simple
key citations. To deal with the more complex task of author-year
citations as used in many natural sciences, a variety of packages has
been developed which define derived forms of the \cite
macro.
RefTeX can be configured to produce these citation macros as well by
setting the variable reftex-cite-format
. For the most commonly
used packages (natbib
, harvard
, chicago
) this may
be done from the menu, under Ref->Citation Styles
. Since there
are usually several macros to create the citations, executing
reftex-citation
(C-c [) starts by prompting for the correct
macro. For the Natbib style, this looks like this:
SELECT A CITATION FORMAT [^M] \cite{%l} [t] \citet{%l} [T] \citet*{%l} [p] \citep{%l} [P] \citep*{%l} [e] \citep[e.g.][]{%l} [s] \citep[see][]{%l} [a] \citeauthor{%l} [A] \citeauthor*{%l} [y] \citeyear{%l} |
Following the most generic of these packages, natbib
, the builtin
citation packages always accept the t key for a textual
citation (like: Jones et al. (1997) have shown...
) as well as
the p key for a parenthetical citation (like: As shown
earlier (Jones et al, 1997)
).
To make one of these styles the default, customize the variable
reftex-cite-format
or put into `.emacs':
(setq reftex-cite-format 'natbib) |
You can also use AUCTeX style files to automatically set the
citation style based on the usepackage
commands in a given
document. See section 6.8.2 Style Files, for information on how to set up the style
files correctly.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When point is idle for more than reftex-idle-time
seconds on the
argument of a \cite
macro, the echo area will display some
information about the article cited there. Note that the information is
only displayed if the echo area is not occupied by a different message.
RefTeX can also display the \bibitem
or BibTeX database
entry corresponding to a \cite
macro, or all citation locations
corresponding to a \bibitem
or BibTeX database entry.
See section 6. Viewing Cross--References.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
chapterbib
and bibunits
are two LaTeX packages which
produce multiple bibliographies in a document. This is no problem for
RefTeX as long as all bibliographies use the same BibTeX database
files. If they do not, it is best to have each document part in a
separate file (as it is required for chapterbib
anyway). Then
RefTeX will still scan the locally relevant databases correctly. If
you have multiple bibliographies within a single file, this may
or may not be the case.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The command reftex-citation
can also be executed outside a LaTeX
buffer. This can be useful to reference articles in the mail buffer and
other documents. You should not enter reftex-mode
for
this, just execute the command. The list of BibTeX files will in this
case be taken from the variable reftex-default-bibliography
.
Setting the variable reftex-cite-format
to the symbol
locally
does a decent job of putting all relevant information
about a citation directly into the buffer. Here is the lisp code to add
the C-c [ binding to the mail buffer. It also provides a local
binding for reftex-cite-format
.
(add-hook 'mail-setup-hook (lambda () (define-key mail-mode-map "\C-c[" (lambda () (interactive) (require 'reftex) (let ((reftex-cite-format 'locally)) (reftex-citation)))))) |
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by XEmacs shared group account on December, 19 2009
using texi2html 1.65.