diff options
| -rw-r--r-- | doc/misc/ChangeLog | 31 | ||||
| -rw-r--r-- | doc/misc/reftex.texi | 1279 | ||||
| -rw-r--r-- | lisp/ChangeLog | 143 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-auc.el | 29 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-cite.el | 166 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-dcr.el | 16 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-global.el | 7 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-index.el | 21 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-parse.el | 17 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-ref.el | 130 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-sel.el | 47 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-toc.el | 18 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-vars.el | 215 | ||||
| -rw-r--r-- | lisp/textmodes/reftex.el | 651 |
14 files changed, 1608 insertions, 1162 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 2e48b61def9..c30e2282fce 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,34 @@ | |||
| 1 | 2012-09-30 Ralf Angeli <angeli@caeruleus.net> | ||
| 2 | |||
| 3 | Merge from standalone RefTeX repository. | ||
| 4 | |||
| 5 | * reftex.texi: Express TeX, LaTeX, AUCTeX, BibTeX and RefTeX | ||
| 6 | with macros. | ||
| 7 | (Imprint): Mention Wolfgang in list of contributors. | ||
| 8 | (Creating Citations): Give a hint about how to | ||
| 9 | auto-revert the BibTeX database file when using external editors. | ||
| 10 | (Referencing Labels): Simplify section about reference macro | ||
| 11 | cycling. | ||
| 12 | (Options (Referencing Labels)): Adapt to new structure of | ||
| 13 | `reftex-ref-style-alist'. | ||
| 14 | (Referencing Labels, Reference Styles): Document changes in the | ||
| 15 | referencing functionality. | ||
| 16 | (Commands): Mention options for definition of header and footer in | ||
| 17 | BibTeX files. | ||
| 18 | (Options (Creating Citations)): Document | ||
| 19 | `reftex-create-bibtex-header' and `reftex-create-bibtex-footer'. | ||
| 20 | (Reference Styles): New section. | ||
| 21 | (varioref (LaTeX package), fancyref (LaTeX package)): Remove. | ||
| 22 | (Options (Referencing Labels)): Remove descriptions of deprecated | ||
| 23 | variables `reftex-vref-is-default' and `reftex-fref-is-default'. | ||
| 24 | Add descriptions for `reftex-ref-style-alist' and | ||
| 25 | `reftex-ref-style-default-list'. | ||
| 26 | (Referencing Labels): Update regarding reference styles. | ||
| 27 | (Citation Styles): Mention support for ConTeXt. | ||
| 28 | (Options (Defining Label Environments)): Fix typo. | ||
| 29 | (Options (Creating Citations)): Document | ||
| 30 | `reftex-cite-key-separator'. | ||
| 31 | |||
| 1 | 2012-09-30 Achim Gratz <Stromeko@Stromeko.DE> | 32 | 2012-09-30 Achim Gratz <Stromeko@Stromeko.DE> |
| 2 | 33 | ||
| 3 | * org.texi: Add description of ORG_ADD_CONTRIB to info | 34 | * org.texi: Add description of ORG_ADD_CONTRIB to info |
diff --git a/doc/misc/reftex.texi b/doc/misc/reftex.texi index 69092093af8..c7efa875dc7 100644 --- a/doc/misc/reftex.texi +++ b/doc/misc/reftex.texi | |||
| @@ -6,26 +6,44 @@ | |||
| 6 | @syncodeindex vr cp | 6 | @syncodeindex vr cp |
| 7 | @syncodeindex fn cp | 7 | @syncodeindex fn cp |
| 8 | 8 | ||
| 9 | @c Version and Contact Info | 9 | @ifnottex |
| 10 | @set VERSION 4.31 | 10 | @macro RefTeX {} |
| 11 | @set EDITION 4.31 | 11 | Ref@TeX{} |
| 12 | @set DATE February 2006 | 12 | @end macro |
| 13 | @set AUCTEXSITE @uref{http://www.gnu.org/software/auctex/,AUCTeX distribution site} | 13 | @macro AUCTeX {} |
| 14 | @set MAINTAINERSITE @uref{http://www.gnu.org/software/auctex/reftex.html,Ref@TeX{} web page} | 14 | AUC@TeX{} |
| 15 | @end macro | ||
| 16 | @macro BibTeX {} | ||
| 17 | Bib@TeX{} | ||
| 18 | @end macro | ||
| 19 | @macro ConTeXt {} | ||
| 20 | Con@TeX{}t | ||
| 21 | @end macro | ||
| 22 | @end ifnottex | ||
| 23 | @tex | ||
| 24 | \gdef\RefTeX{Ref\TeX} | ||
| 25 | \gdef\AUCTeX{AUC\TeX} | ||
| 26 | \gdef\BibTeX{Bib\TeX} | ||
| 27 | \gdef\ConTeXt{Con\TeX t} | ||
| 28 | @end tex | ||
| 29 | |||
| 30 | @include ../emacs/emacsver.texi | ||
| 31 | |||
| 32 | @set VERSION @value{EMACSVER} | ||
| 33 | @set AUCTEXSITE @uref{http://www.gnu.org/software/auctex/,@AUCTeX{} web site} | ||
| 34 | @set MAINTAINERSITE @uref{http://www.gnu.org/software/auctex/reftex.html,@RefTeX{} web page} | ||
| 15 | @set MAINTAINERCONTACT @uref{mailto:auctex-devel@@gnu.org,contact the maintainers} | 35 | @set MAINTAINERCONTACT @uref{mailto:auctex-devel@@gnu.org,contact the maintainers} |
| 16 | @set MAINTAINER the AUC@TeX{} project | 36 | @set MAINTAINER the @AUCTeX{} project |
| 17 | @set SUPPORTADDRESS AUC@TeX{} user mailing list (@email{auctex@@gnu.org}) | 37 | @set SUPPORTADDRESS @AUCTeX{} user mailing list (@email{auctex@@gnu.org}) |
| 18 | @set DEVELADDRESS AUC@TeX{} developer mailing list (@email{auctex-devel@@gnu.org}) | 38 | @set DEVELADDRESS @AUCTeX{} developer mailing list (@email{auctex-devel@@gnu.org}) |
| 19 | @set BUGADDRESS AUC@TeX{} bug mailing list (@email{bug-auctex@@gnu.org}) | 39 | @set BUGADDRESS @AUCTeX{} bug mailing list (@email{bug-auctex@@gnu.org}) |
| 20 | @set XEMACSFTP @uref{ftp://ftp.xemacs.org/pub/xemacs/packages/,XEmacs ftp site} | 40 | @set XEMACSFTP @uref{ftp://ftp.xemacs.org/pub/xemacs/packages/,XEmacs FTP site} |
| 21 | @c %**end of header | 41 | @c %**end of header |
| 22 | 42 | ||
| 23 | @copying | 43 | @copying |
| 24 | This file documents @b{Ref@TeX{}}, a package to do labels, references, | 44 | This manual documents @RefTeX{} (version @value{VERSION}), a package |
| 25 | citations and indices for LaTeX documents with Emacs. | 45 | to do labels, references, citations and indices for LaTeX documents |
| 26 | 46 | with Emacs. | |
| 27 | This is edition @value{EDITION} of the @b{Ref@TeX{}} User Manual for | ||
| 28 | @b{Ref@TeX{}} @value{VERSION} | ||
| 29 | 47 | ||
| 30 | Copyright @copyright{} 1997-2012 Free Software Foundation, Inc. | 48 | Copyright @copyright{} 1997-2012 Free Software Foundation, Inc. |
| 31 | 49 | ||
| @@ -64,9 +82,9 @@ developing GNU and promoting software freedom.'' | |||
| 64 | @end macro | 82 | @end macro |
| 65 | 83 | ||
| 66 | @titlepage | 84 | @titlepage |
| 67 | @title Ref@TeX{} User Manual | 85 | @title @RefTeX{} User Manual |
| 68 | @subtitle Support for LaTeX labels, references, citations and index entries with GNU Emacs | 86 | @subtitle Support for @LaTeX{} labels, references, citations and index entries with GNU Emacs |
| 69 | @subtitle Edition @value{EDITION}, @value{DATE} | 87 | @subtitle Version @value{VERSION} |
| 70 | 88 | ||
| 71 | @author by Carsten Dominik | 89 | @author by Carsten Dominik |
| 72 | @page | 90 | @page |
| @@ -79,18 +97,17 @@ developing GNU and promoting software freedom.'' | |||
| 79 | 97 | ||
| 80 | @ifnottex | 98 | @ifnottex |
| 81 | @node Top,,,(dir) | 99 | @node Top,,,(dir) |
| 82 | @top RefTeX | 100 | @top @RefTeX{} |
| 83 | 101 | ||
| 84 | @b{Ref@TeX{}} is a package for managing Labels, References, | 102 | @RefTeX{} is a package for managing Labels, References, Citations and |
| 85 | Citations and index entries with GNU Emacs. | 103 | index entries with GNU Emacs. |
| 86 | 104 | ||
| 87 | Don't be discouraged by the size of this manual, which covers | 105 | This manual documents @RefTeX{} version @value{VERSION}. |
| 88 | @b{Ref@TeX{}} in great depth. All you need to know to use | ||
| 89 | @b{Ref@TeX{}} can be summarized on two pages (@pxref{RefTeX in a | ||
| 90 | Nutshell}). You can go back later to other parts of this document when | ||
| 91 | needed. | ||
| 92 | 106 | ||
| 93 | @insertcopying | 107 | Don't be discouraged by the size of this manual, which covers @RefTeX{} |
| 108 | in great depth. All you need to know to use @RefTeX{} can be summarized | ||
| 109 | on two pages (@pxref{RefTeX in a Nutshell}). You can go back later to | ||
| 110 | other parts of this document when needed. | ||
| 94 | 111 | ||
| 95 | @menu | 112 | @menu |
| 96 | * Introduction:: Quick-Start information. | 113 | * Introduction:: Quick-Start information. |
| @@ -106,8 +123,8 @@ needed. | |||
| 106 | * Faces:: Fontification of RefTeX's buffers. | 123 | * Faces:: Fontification of RefTeX's buffers. |
| 107 | * Multifile Documents:: Document spread over many files. | 124 | * Multifile Documents:: Document spread over many files. |
| 108 | * Language Support:: How to support other languages. | 125 | * Language Support:: How to support other languages. |
| 109 | * Finding Files:: Included TeX files and BibTeX .bib files. | 126 | * Finding Files:: Included @TeX{} files and @BibTeX{} .bib files. |
| 110 | * AUCTeX:: Cooperation with AUCTeX. | 127 | * AUCTeX:: Cooperation with @AUCTeX{}. |
| 111 | * Optimizations:: When RefTeX is too slow. | 128 | * Optimizations:: When RefTeX is too slow. |
| 112 | * Problems and Work-Arounds:: First Aid. | 129 | * Problems and Work-Arounds:: First Aid. |
| 113 | * Imprint:: Author, Web-site, Thanks | 130 | * Imprint:: Author, Web-site, Thanks |
| @@ -123,6 +140,7 @@ The Index | |||
| 123 | * Index:: The full index. | 140 | * Index:: The full index. |
| 124 | 141 | ||
| 125 | @detailmenu | 142 | @detailmenu |
| 143 | --- The Detailed Node Listing --- | ||
| 126 | 144 | ||
| 127 | Introduction | 145 | Introduction |
| 128 | 146 | ||
| @@ -136,9 +154,8 @@ Labels and References | |||
| 136 | * Builtin Label Environments:: The environments RefTeX knows about. | 154 | * Builtin Label Environments:: The environments RefTeX knows about. |
| 137 | * Defining Label Environments:: ... and environments it doesn't. | 155 | * Defining Label Environments:: ... and environments it doesn't. |
| 138 | * Reference Info:: View the label corresponding to a \ref. | 156 | * Reference Info:: View the label corresponding to a \ref. |
| 157 | * Reference Styles:: Macros to be used instead of \ref. | ||
| 139 | * xr (LaTeX package):: References to external documents. | 158 | * xr (LaTeX package):: References to external documents. |
| 140 | * varioref (LaTeX package):: How to create \vref instead of \ref. | ||
| 141 | * fancyref (LaTeX package):: How to create \fref instead of \ref. | ||
| 142 | 159 | ||
| 143 | Defining Label Environments | 160 | Defining Label Environments |
| 144 | 161 | ||
| @@ -176,7 +193,7 @@ The Index Phrases File | |||
| 176 | AUCTeX | 193 | AUCTeX |
| 177 | 194 | ||
| 178 | * AUCTeX-RefTeX Interface:: How both packages work together | 195 | * AUCTeX-RefTeX Interface:: How both packages work together |
| 179 | * Style Files:: AUCTeX's style files can support RefTeX | 196 | * Style Files:: @AUCTeX{}'s style files can support RefTeX |
| 180 | * Bib-Cite:: Hypertext reading of a document | 197 | * Bib-Cite:: Hypertext reading of a document |
| 181 | 198 | ||
| 182 | Options, Keymaps, Hooks | 199 | Options, Keymaps, Hooks |
| @@ -202,18 +219,18 @@ Options, Keymaps, Hooks | |||
| 202 | @chapter Introduction | 219 | @chapter Introduction |
| 203 | @cindex Introduction | 220 | @cindex Introduction |
| 204 | 221 | ||
| 205 | @b{Ref@TeX{}} is a specialized package for support of labels, | 222 | @RefTeX{} is a specialized package for support of labels, references, |
| 206 | references, citations, and the index in LaTeX. @b{Ref@TeX{}} wraps | 223 | citations, and the index in @LaTeX{}. @RefTeX{} wraps itself round four |
| 207 | itself round 4 LaTeX macros: @code{\label}, @code{\ref}, @code{\cite}, | 224 | @LaTeX{} macros: @code{\label}, @code{\ref}, @code{\cite}, and |
| 208 | and @code{\index}. Using these macros usually requires looking up | 225 | @code{\index}. Using these macros usually requires looking up different |
| 209 | different parts of the document and searching through BibTeX database | 226 | parts of the document and searching through @BibTeX{} database files. |
| 210 | files. @b{Ref@TeX{}} automates these time--consuming tasks almost | 227 | @RefTeX{} automates these time-consuming tasks almost entirely. It also |
| 211 | entirely. It also provides functions to display the structure of a | 228 | provides functions to display the structure of a document and to move |
| 212 | document and to move around in this structure quickly. | 229 | around in this structure quickly. |
| 213 | 230 | ||
| 214 | @iftex | 231 | @iftex |
| 215 | Don't be discouraged by the size of this manual, which covers @b{Ref@TeX{}} | 232 | Don't be discouraged by the size of this manual, which covers @RefTeX{} |
| 216 | in great depth. All you need to know to use @b{Ref@TeX{}} can be | 233 | in great depth. All you need to know to use @RefTeX{} can be |
| 217 | summarized on two pages (@pxref{RefTeX in a Nutshell}). You can go | 234 | summarized on two pages (@pxref{RefTeX in a Nutshell}). You can go |
| 218 | back later to other parts of this document when needed. | 235 | back later to other parts of this document when needed. |
| 219 | @end iftex | 236 | @end iftex |
| @@ -230,51 +247,122 @@ reports or suggestions. | |||
| 230 | @section Installation | 247 | @section Installation |
| 231 | @cindex Installation | 248 | @cindex Installation |
| 232 | 249 | ||
| 233 | @b{Ref@TeX{}} is bundled and pre--installed with Emacs since version | 250 | @RefTeX{} has been bundled and pre-installed with Emacs since |
| 234 | 20.2. It was also bundled and pre--installed with XEmacs 19.16--20.x. | 251 | version 20.2. It has also been bundled and pre-installed with XEmacs |
| 235 | XEmacs 21.x users want to install the corresponding plug-in package | 252 | 19.16--20.x. XEmacs 21.x users want to install the corresponding |
| 236 | which is available from the @value{XEMACSFTP}. See the XEmacs 21.x | 253 | plug-in package which is available from the @value{XEMACSFTP}. See the |
| 237 | documentation on package installation for details. | 254 | XEmacs 21.x documentation on package installation for details. |
| 238 | 255 | ||
| 239 | Users of earlier Emacs distributions (including Emacs 19) can get a copy | 256 | Users of earlier Emacs distributions (including Emacs 19) or people |
| 240 | of the @b{Ref@TeX{}} distribution from the maintainers web-page. | 257 | craving for new features and bugs can get a copy of the @RefTeX{} |
| 241 | @xref{Imprint}, for more information. | 258 | distribution from the maintainer's web page. @xref{Imprint}, for more |
| 259 | information. The following instructions will guide you through the | ||
| 260 | process of installing such a distribution. | ||
| 242 | 261 | ||
| 243 | @section Environment | 262 | @subsection Building and Installing |
| 244 | @cindex Finding files | ||
| 245 | @cindex BibTeX database files, not found | ||
| 246 | @cindex TeX files, not found | ||
| 247 | @cindex @code{TEXINPUTS}, environment variable | ||
| 248 | @cindex @code{BIBINPUTS}, environment variable | ||
| 249 | 263 | ||
| 250 | @b{Ref@TeX{}} needs to access all files which are part of a multifile | 264 | Note: Currently installation is supported for Emacs only. XEmacs users |
| 251 | document, and the BibTeX database files requested by the | 265 | might want to refer to the @RefTeX{} package available through the |
| 252 | @code{\bibliography} command. To find these files, @b{Ref@TeX{}} will | 266 | package system of XEmacs. |
| 253 | require a search path, i.e. a list of directories to check. Normally | 267 | |
| 254 | this list is stored in the environment variables @code{TEXINPUTS} and | 268 | @subsubheading Installation with make |
| 255 | @code{BIBINPUTS} which are also used by @b{Ref@TeX{}}. However, on some | 269 | |
| 256 | systems these variables do not contain the full search path. If | 270 | In order to install RefTeX, unpack the distribution and edit the header |
| 257 | @b{Ref@TeX{}} does not work for you because it cannot find some files, | 271 | of the Makefile. Basically, you need to change the path specifications |
| 258 | read @ref{Finding Files}. | 272 | for Emacs Lisp files and info files. Also, enter the name of your Emacs |
| 273 | executable (usually either @samp{emacs} or @samp{xemacs}). | ||
| 274 | |||
| 275 | Then, type | ||
| 276 | |||
| 277 | @example | ||
| 278 | make | ||
| 279 | make install | ||
| 280 | @end example | ||
| 281 | |||
| 282 | to compile and install the code and documentation. | ||
| 283 | |||
| 284 | Per default @RefTeX{} is installed in its own subdirectory which might | ||
| 285 | not be on your load path. In this case, add it to load path with a | ||
| 286 | command like the following, replacing the sample directory with the one | ||
| 287 | where @RefTeX{} is installed in your case. | ||
| 288 | |||
| 289 | @example | ||
| 290 | (add-to-list 'load-path "/path/to/reftex") | ||
| 291 | @end example | ||
| 259 | 292 | ||
| 260 | @section Entering @b{Ref@TeX{}} Mode | 293 | Put this command into your init file before other @RefTeX{}-related |
| 294 | settings. | ||
| 295 | |||
| 296 | @subsubheading Installation by Hand | ||
| 297 | |||
| 298 | If you want to get your hands dirty, there is also the possibility to | ||
| 299 | install by manually copying files. | ||
| 300 | |||
| 301 | @enumerate a | ||
| 302 | @item | ||
| 303 | Copy the reftex*.el lisp files to a directory on your load path. Make | ||
| 304 | sure that no old copy of @RefTeX{} shadows these files. | ||
| 305 | @item | ||
| 306 | Byte compile the files. The sequence of compiling should be: | ||
| 307 | reftex-var.el, reftex.el, and then all the others. | ||
| 308 | @item | ||
| 309 | Copy the info file reftex.info to the info directory. | ||
| 310 | @end enumerate | ||
| 311 | |||
| 312 | @subsection Loading @RefTeX{} | ||
| 313 | |||
| 314 | In order to make the most important functions for entering @RefTeX{} | ||
| 315 | mode available add the following line to your init file. | ||
| 316 | |||
| 317 | @example | ||
| 318 | (require 'reftex) | ||
| 319 | @end example | ||
| 320 | |||
| 321 | @subsection Entering @RefTeX{} Mode | ||
| 261 | 322 | ||
| 262 | @findex turn-on-reftex | 323 | @findex turn-on-reftex |
| 263 | @findex reftex-mode | 324 | @findex reftex-mode |
| 264 | @vindex LaTeX-mode-hook | 325 | @vindex LaTeX-mode-hook |
| 265 | @vindex latex-mode-hook | 326 | @vindex latex-mode-hook |
| 266 | To turn @b{Ref@TeX{}} Mode on and off in a particular buffer, use | 327 | To turn @RefTeX{} Mode on and off in a particular buffer, use |
| 267 | @kbd{M-x reftex-mode}. To turn on @b{Ref@TeX{}} Mode for all LaTeX | 328 | @kbd{M-x reftex-mode @key{RET}}. To turn on @RefTeX{} Mode for all |
| 268 | files, add the following lines to your @file{.emacs} file: | 329 | LaTeX files, add the following lines to your @file{.emacs} file: |
| 269 | 330 | ||
| 270 | @example | 331 | @example |
| 271 | (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode | 332 | (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode |
| 272 | (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode | 333 | (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode |
| 273 | @end example | 334 | @end example |
| 274 | 335 | ||
| 336 | That's all! | ||
| 337 | |||
| 338 | To get started, read the documentation, in particular the | ||
| 339 | summary. (@pxref{RefTeX in a Nutshell}) | ||
| 340 | |||
| 341 | In order to produce a printed version of the documentation, use | ||
| 342 | @code{make pdf} to produce a reftex.pdf file. Analogously you can use | ||
| 343 | the @code{dvi}, @code{ps}, or @code{html} targets to create DVI, | ||
| 344 | PostScript or HTML files. | ||
| 345 | |||
| 346 | @subsection Environment | ||
| 347 | @cindex Finding files | ||
| 348 | @cindex BibTeX database files, not found | ||
| 349 | @cindex TeX files, not found | ||
| 350 | @cindex @code{TEXINPUTS}, environment variable | ||
| 351 | @cindex @code{BIBINPUTS}, environment variable | ||
| 352 | |||
| 353 | @RefTeX{} needs to access all files which are part of a multifile | ||
| 354 | document, and the BibTeX database files requested by the | ||
| 355 | @code{\bibliography} command. To find these files, @RefTeX{} will | ||
| 356 | require a search path, i.e. a list of directories to check. Normally | ||
| 357 | this list is stored in the environment variables @code{TEXINPUTS} and | ||
| 358 | @code{BIBINPUTS} which are also used by @RefTeX{}. However, on some | ||
| 359 | systems these variables do not contain the full search path. If | ||
| 360 | @RefTeX{} does not work for you because it cannot find some files, | ||
| 361 | @xref{Finding Files}. | ||
| 362 | |||
| 275 | @page | 363 | @page |
| 276 | @node RefTeX in a Nutshell, , Installation, Introduction | 364 | @node RefTeX in a Nutshell, , Installation, Introduction |
| 277 | @section @b{Ref@TeX{}} in a Nutshell | 365 | @section @RefTeX{} in a Nutshell |
| 278 | @cindex Quick-Start | 366 | @cindex Quick-Start |
| 279 | @cindex Getting Started | 367 | @cindex Getting Started |
| 280 | @cindex RefTeX in a Nutshell | 368 | @cindex RefTeX in a Nutshell |
| @@ -289,7 +377,7 @@ can jump quickly to every part of your document. Press @kbd{?} to get | |||
| 289 | help. | 377 | help. |
| 290 | 378 | ||
| 291 | @item | 379 | @item |
| 292 | @b{Labels and References}@* @b{Ref@TeX{}} helps to create unique labels | 380 | @b{Labels and References}@* @RefTeX{} helps to create unique labels |
| 293 | and to find the correct key for references quickly. It distinguishes | 381 | and to find the correct key for references quickly. It distinguishes |
| 294 | labels for different environments, knows about all standard | 382 | labels for different environments, knows about all standard |
| 295 | environments (and many others), and can be configured to recognize any | 383 | environments (and many others), and can be configured to recognize any |
| @@ -300,7 +388,7 @@ additional labeled environments you have defined yourself (variable | |||
| 300 | @item | 388 | @item |
| 301 | @b{Creating Labels}@* | 389 | @b{Creating Labels}@* |
| 302 | Type @kbd{C-c (} (@code{reftex-label}) to insert a label at point. | 390 | Type @kbd{C-c (} (@code{reftex-label}) to insert a label at point. |
| 303 | @b{Ref@TeX{}} will either | 391 | @RefTeX{} will either |
| 304 | @itemize @minus | 392 | @itemize @minus |
| 305 | @item | 393 | @item |
| 306 | derive a label from context (default for section labels) | 394 | derive a label from context (default for section labels) |
| @@ -325,7 +413,7 @@ into the original buffer. | |||
| 325 | @item | 413 | @item |
| 326 | @b{Citations}@* | 414 | @b{Citations}@* |
| 327 | Typing @kbd{C-c [} (@code{reftex-citation}) will let you specify a | 415 | Typing @kbd{C-c [} (@code{reftex-citation}) will let you specify a |
| 328 | regular expression to search in current BibTeX database files (as | 416 | regular expression to search in current @BibTeX{} database files (as |
| 329 | specified in the @code{\bibliography} command) and pull out a list of | 417 | specified in the @code{\bibliography} command) and pull out a list of |
| 330 | matches for you to choose from. The list is @emph{formatted} and | 418 | matches for you to choose from. The list is @emph{formatted} and |
| 331 | sorted. The selected article is referenced as @samp{\cite@{@var{key}@}} | 419 | sorted. The selected article is referenced as @samp{\cite@{@var{key}@}} |
| @@ -334,9 +422,9 @@ different macros). | |||
| 334 | 422 | ||
| 335 | @item | 423 | @item |
| 336 | @b{Index Support}@* | 424 | @b{Index Support}@* |
| 337 | @b{Ref@TeX{}} helps to enter index entries. It also compiles all | 425 | @RefTeX{} helps to enter index entries. It also compiles all |
| 338 | entries into an alphabetically sorted @file{*Index*} buffer which you | 426 | entries into an alphabetically sorted @file{*Index*} buffer which you |
| 339 | can use to check and edit the entries. @b{Ref@TeX{}} knows about the | 427 | can use to check and edit the entries. @RefTeX{} knows about the |
| 340 | standard index macros and can be configured to recognize any additional | 428 | standard index macros and can be configured to recognize any additional |
| 341 | macros you have defined (@code{reftex-index-macros}). Multiple indices | 429 | macros you have defined (@code{reftex-index-macros}). Multiple indices |
| 342 | are supported. | 430 | are supported. |
| @@ -354,7 +442,7 @@ and enter the arguments with completion. | |||
| 354 | @b{The Index Phrases File (Delayed Indexing)}@* | 442 | @b{The Index Phrases File (Delayed Indexing)}@* |
| 355 | Type @kbd{C-c \} (@code{reftex-index-phrase-selection-or-word}) to add | 443 | Type @kbd{C-c \} (@code{reftex-index-phrase-selection-or-word}) to add |
| 356 | the current word or selection to a special @emph{index phrase file}. | 444 | the current word or selection to a special @emph{index phrase file}. |
| 357 | @b{Ref@TeX{}} can later search the document for occurrences of these | 445 | @RefTeX{} can later search the document for occurrences of these |
| 358 | phrases and let you interactively index the matches. | 446 | phrases and let you interactively index the matches. |
| 359 | 447 | ||
| 360 | @item | 448 | @item |
| @@ -366,11 +454,11 @@ all entries. | |||
| 366 | 454 | ||
| 367 | @page | 455 | @page |
| 368 | @item @b{Viewing Cross-References}@* | 456 | @item @b{Viewing Cross-References}@* |
| 369 | When point is on the @var{key} argument of a cross--referencing macro | 457 | When point is on the @var{key} argument of a cross-referencing macro |
| 370 | (@code{\label}, @code{\ref}, @code{\cite}, @code{\bibitem}, | 458 | (@code{\label}, @code{\ref}, @code{\cite}, @code{\bibitem}, |
| 371 | @code{\index}, and variations) or inside a BibTeX database entry, you | 459 | @code{\index}, and variations) or inside a @BibTeX{} database entry, you |
| 372 | can press @kbd{C-c &} (@code{reftex-view-crossref}) to display | 460 | can press @kbd{C-c &} (@code{reftex-view-crossref}) to display |
| 373 | corresponding locations in the document and associated BibTeX database | 461 | corresponding locations in the document and associated @BibTeX{} database |
| 374 | files. @* | 462 | files. @* |
| 375 | When the enclosing macro is @code{\cite} or @code{\ref} and no other | 463 | When the enclosing macro is @code{\cite} or @code{\ref} and no other |
| 376 | message occupies the echo area, information about the citation or label | 464 | message occupies the echo area, information about the citation or label |
| @@ -380,12 +468,12 @@ will automatically be displayed in the echo area. | |||
| 380 | @b{Multifile Documents}@* | 468 | @b{Multifile Documents}@* |
| 381 | Multifile Documents are fully supported. The included files must have a | 469 | Multifile Documents are fully supported. The included files must have a |
| 382 | file variable @code{TeX-master} or @code{tex-main-file} pointing to the | 470 | file variable @code{TeX-master} or @code{tex-main-file} pointing to the |
| 383 | master file. @b{Ref@TeX{}} provides cross-referencing information from | 471 | master file. @RefTeX{} provides cross-referencing information from |
| 384 | all parts of the document, and across document borders | 472 | all parts of the document, and across document borders |
| 385 | (@file{xr.sty}). | 473 | (@file{xr.sty}). |
| 386 | 474 | ||
| 387 | @item | 475 | @item |
| 388 | @b{Document Parsing}@* @b{Ref@TeX{}} needs to parse the document in | 476 | @b{Document Parsing}@* @RefTeX{} needs to parse the document in |
| 389 | order to find labels and other information. It does it automatically | 477 | order to find labels and other information. It does it automatically |
| 390 | once and updates its list internally when @code{reftex-label} and | 478 | once and updates its list internally when @code{reftex-label} and |
| 391 | @code{reftex-index} are used. To enforce reparsing, call any of the | 479 | @code{reftex-index} are used. To enforce reparsing, call any of the |
| @@ -394,20 +482,20 @@ commands described above with a raw @kbd{C-u} prefix, or press the | |||
| 394 | buffer, or the index buffer. | 482 | buffer, or the index buffer. |
| 395 | 483 | ||
| 396 | @item | 484 | @item |
| 397 | @b{AUCTeX} @* If your major LaTeX mode is AUCTeX, @b{Ref@TeX{}} can | 485 | @b{@AUCTeX{}} @* If your major @LaTeX{} mode is @AUCTeX{}, @RefTeX{} can |
| 398 | cooperate with it (see variable @code{reftex-plug-into-AUCTeX}). AUCTeX | 486 | cooperate with it (see variable @code{reftex-plug-into-AUCTeX}). @AUCTeX{} |
| 399 | contains style files which trigger appropriate settings in | 487 | contains style files which trigger appropriate settings in |
| 400 | @b{Ref@TeX{}}, so that for many of the popular LaTeX packages no | 488 | @RefTeX{}, so that for many of the popular @LaTeX{} packages no |
| 401 | additional customizations will be necessary. | 489 | additional customizations will be necessary. |
| 402 | 490 | ||
| 403 | @item | 491 | @item |
| 404 | @b{Useful Settings}@* | 492 | @b{Useful Settings}@* |
| 405 | To integrate RefTeX with AUCTeX, use | 493 | To integrate RefTeX with @AUCTeX{}, use |
| 406 | @lisp | 494 | @lisp |
| 407 | (setq reftex-plug-into-AUCTeX t) | 495 | (setq reftex-plug-into-AUCTeX t) |
| 408 | @end lisp | 496 | @end lisp |
| 409 | 497 | ||
| 410 | To make your own LaTeX macro definitions known to @b{Ref@TeX{}}, | 498 | To make your own @LaTeX{} macro definitions known to @RefTeX{}, |
| 411 | customize the variables | 499 | customize the variables |
| 412 | @example | 500 | @example |
| 413 | @code{reftex-label-alist} @r{(for label macros/environments)} | 501 | @code{reftex-label-alist} @r{(for label macros/environments)} |
| @@ -417,15 +505,15 @@ customize the variables | |||
| 417 | @code{reftex-index-default-macro} @r{(to set the default macro)} | 505 | @code{reftex-index-default-macro} @r{(to set the default macro)} |
| 418 | @end example | 506 | @end example |
| 419 | If you have a large number of macros defined, you may want to write | 507 | If you have a large number of macros defined, you may want to write |
| 420 | an AUCTeX style file to support them with both AUCTeX and | 508 | an @AUCTeX{} style file to support them with both @AUCTeX{} and |
| 421 | @b{Ref@TeX{}}. | 509 | @RefTeX{}. |
| 422 | 510 | ||
| 423 | @item @b{Where Next?}@* Go ahead and use @b{Ref@TeX{}}. Use its menus | 511 | @item @b{Where Next?}@* Go ahead and use @RefTeX{}. Use its menus |
| 424 | until you have picked up the key bindings. For an overview of what you | 512 | until you have picked up the key bindings. For an overview of what you |
| 425 | can do in each of the different special buffers, press @kbd{?}. Read | 513 | can do in each of the different special buffers, press @kbd{?}. Read |
| 426 | the manual if you get stuck, of if you are curious what else might be | 514 | the manual if you get stuck, or if you are curious what else might be |
| 427 | available. The first part of the manual explains in | 515 | available. The first part of the manual explains in |
| 428 | a tutorial way how to use and customize @b{Ref@TeX{}}. The second | 516 | a tutorial way how to use and customize @RefTeX{}. The second |
| 429 | part is a command and variable reference. | 517 | part is a command and variable reference. |
| 430 | @end enumerate | 518 | @end enumerate |
| 431 | 519 | ||
| @@ -463,10 +551,10 @@ Prefix argument. | |||
| 463 | 551 | ||
| 464 | @tablesubheading{Moving around} | 552 | @tablesubheading{Moving around} |
| 465 | @item n | 553 | @item n |
| 466 | Goto next entry in the table of context. | 554 | Goto next entry in the table of contents. |
| 467 | 555 | ||
| 468 | @item p | 556 | @item p |
| 469 | Goto previous entry in the table of context. | 557 | Goto previous entry in the table of contents. |
| 470 | 558 | ||
| 471 | @item C-c C-n | 559 | @item C-c C-n |
| 472 | Goto next section heading. Useful when many labels and index entries | 560 | Goto next section heading. Useful when many labels and index entries |
| @@ -506,7 +594,7 @@ always show the location corresponding to the line at point in the | |||
| 506 | @file{*toc*} buffer. This is similar to pressing @key{SPC} after each | 594 | @file{*toc*} buffer. This is similar to pressing @key{SPC} after each |
| 507 | cursor motion. The default for this flag can be set with the variable | 595 | cursor motion. The default for this flag can be set with the variable |
| 508 | @code{reftex-toc-follow-mode}. Note that only context in files already | 596 | @code{reftex-toc-follow-mode}. Note that only context in files already |
| 509 | visited is shown. @b{Ref@TeX{}} will not visit a file just for follow | 597 | visited is shown. @RefTeX{} will not visit a file just for follow |
| 510 | mode. See, however, the variable | 598 | mode. See, however, the variable |
| 511 | @code{reftex-revisit-to-follow}. | 599 | @code{reftex-revisit-to-follow}. |
| 512 | 600 | ||
| @@ -521,8 +609,8 @@ Show calling point in another window. This is the point from where | |||
| 521 | Promote the current section. This will convert @code{\section} to | 609 | Promote the current section. This will convert @code{\section} to |
| 522 | @code{\chapter}, @code{\subsection} to @code{\section} etc. If there is | 610 | @code{\chapter}, @code{\subsection} to @code{\section} etc. If there is |
| 523 | an active region, all sections in the region will be promoted, including | 611 | an active region, all sections in the region will be promoted, including |
| 524 | the one at point. To avoid mistakes, @b{Ref@TeX{}} requires a fresh | 612 | the one at point. To avoid mistakes, @RefTeX{} requires a fresh |
| 525 | document scan before executing this command - if necessary, it will | 613 | document scan before executing this command -- if necessary, it will |
| 526 | automatically do this scan and ask the user to repeat the promotion | 614 | automatically do this scan and ask the user to repeat the promotion |
| 527 | command. | 615 | command. |
| 528 | 616 | ||
| @@ -578,7 +666,7 @@ variable @code{reftex-toc-include-file-boundaries}. | |||
| 578 | Toggle the display of labels in the @file{*toc*} buffer. The default | 666 | Toggle the display of labels in the @file{*toc*} buffer. The default |
| 579 | for this flag can be set with the variable | 667 | for this flag can be set with the variable |
| 580 | @code{reftex-toc-include-labels}. When called with a prefix argument, | 668 | @code{reftex-toc-include-labels}. When called with a prefix argument, |
| 581 | @b{Ref@TeX{}} will prompt for a label type and include only labels of | 669 | @RefTeX{} will prompt for a label type and include only labels of |
| 582 | the selected type in the @file{*toc*} buffer. The mode line @samp{L<>} | 670 | the selected type in the @file{*toc*} buffer. The mode line @samp{L<>} |
| 583 | indicator shows which labels are included. | 671 | indicator shows which labels are included. |
| 584 | 672 | ||
| @@ -587,7 +675,7 @@ indicator shows which labels are included. | |||
| 587 | Toggle the display of index entries in the @file{*toc*} buffer. The | 675 | Toggle the display of index entries in the @file{*toc*} buffer. The |
| 588 | default for this flag can be set with the variable | 676 | default for this flag can be set with the variable |
| 589 | @code{reftex-toc-include-index-entries}. When called with a prefix | 677 | @code{reftex-toc-include-index-entries}. When called with a prefix |
| 590 | argument, @b{Ref@TeX{}} will prompt for a specific index and include | 678 | argument, @RefTeX{} will prompt for a specific index and include |
| 591 | only entries in the selected index in the @file{*toc*} buffer. The mode | 679 | only entries in the selected index in the @file{*toc*} buffer. The mode |
| 592 | line @samp{I<>} indicator shows which index is used. | 680 | line @samp{I<>} indicator shows which index is used. |
| 593 | 681 | ||
| @@ -605,18 +693,18 @@ document. | |||
| 605 | 693 | ||
| 606 | @item r | 694 | @item r |
| 607 | @vindex reftex-enable-partial-scans | 695 | @vindex reftex-enable-partial-scans |
| 608 | Reparse the LaTeX document and rebuild the @file{*toc*} buffer. When | 696 | Reparse the @LaTeX{} document and rebuild the @file{*toc*} buffer. When |
| 609 | @code{reftex-enable-partial-scans} is non-@code{nil}, rescan only the file this | 697 | @code{reftex-enable-partial-scans} is non-@code{nil}, rescan only the file this |
| 610 | location is defined in, not the entire document. | 698 | location is defined in, not the entire document. |
| 611 | 699 | ||
| 612 | @item C-u r | 700 | @item C-u r |
| 613 | Reparse the @emph{entire} LaTeX document and rebuild the @file{*toc*} | 701 | Reparse the @emph{entire} @LaTeX{} document and rebuild the @file{*toc*} |
| 614 | buffer. | 702 | buffer. |
| 615 | 703 | ||
| 616 | @item x | 704 | @item x |
| 617 | Switch to the @file{*toc*} buffer of an external document. When the | 705 | Switch to the @file{*toc*} buffer of an external document. When the |
| 618 | current document is using the @code{xr} package (@pxref{xr (LaTeX | 706 | current document is using the @code{xr} package (@pxref{xr (LaTeX |
| 619 | package)}), @b{Ref@TeX{}} will switch to one of the external | 707 | package)}), @RefTeX{} will switch to one of the external |
| 620 | documents. | 708 | documents. |
| 621 | 709 | ||
| 622 | 710 | ||
| @@ -669,11 +757,11 @@ recentering of the TOC window on the current frame with | |||
| 669 | @cindex LaTeX classes, KOMA-Script | 757 | @cindex LaTeX classes, KOMA-Script |
| 670 | @cindex TOC entries for environments | 758 | @cindex TOC entries for environments |
| 671 | @vindex reftex-section-levels | 759 | @vindex reftex-section-levels |
| 672 | The section macros recognized by @b{Ref@TeX{}} are all LaTeX section | 760 | The section macros recognized by @RefTeX{} are all @LaTeX{} section |
| 673 | macros (from @code{\part} to @code{\subsubparagraph}) and the commands | 761 | macros (from @code{\part} to @code{\subsubparagraph}) and the commands |
| 674 | @code{\addchap} and @code{\addsec} from the KOMA-Script classes. | 762 | @code{\addchap} and @code{\addsec} from the KOMA-Script classes. |
| 675 | Additional macros can be configured with the variable | 763 | Additional macros can be configured with the variable |
| 676 | @code{reftex-section-levels}. It is also possible to add certain LaTeX | 764 | @code{reftex-section-levels}. It is also possible to add certain @LaTeX{} |
| 677 | environments to the table of contents. This is probably only useful for | 765 | environments to the table of contents. This is probably only useful for |
| 678 | theorem-like environments. @xref{Defining Label Environments}, for an | 766 | theorem-like environments. @xref{Defining Label Environments}, for an |
| 679 | example. | 767 | example. |
| @@ -686,21 +774,21 @@ example. | |||
| 686 | @cindex Label environment | 774 | @cindex Label environment |
| 687 | @cindex @code{\label} | 775 | @cindex @code{\label} |
| 688 | 776 | ||
| 689 | LaTeX provides a powerful mechanism to deal with cross--references in a | 777 | @LaTeX{} provides a powerful mechanism to deal with cross-references in a |
| 690 | document. When writing a document, any part of it can be marked with a | 778 | document. When writing a document, any part of it can be marked with a |
| 691 | label, like @samp{\label@{mark@}}. LaTeX records the current value of a | 779 | label, like @samp{\label@{mark@}}. @LaTeX{} records the current value of a |
| 692 | certain counter when a label is defined. Later references to this label | 780 | certain counter when a label is defined. Later references to this label |
| 693 | (like @samp{\ref@{mark@}}) will produce the recorded value of the | 781 | (like @samp{\ref@{mark@}}) will produce the recorded value of the |
| 694 | counter. | 782 | counter. |
| 695 | 783 | ||
| 696 | Labels can be used to mark sections, figures, tables, equations, | 784 | Labels can be used to mark sections, figures, tables, equations, |
| 697 | footnotes, items in enumerate lists etc. LaTeX is context sensitive in | 785 | footnotes, items in enumerate lists etc. @LaTeX{} is context sensitive in |
| 698 | doing this: A label defined in a figure environment automatically | 786 | doing this: A label defined in a figure environment automatically |
| 699 | records the figure counter, not the section counter. | 787 | records the figure counter, not the section counter. |
| 700 | 788 | ||
| 701 | Several different environments can share a common counter and therefore | 789 | Several different environments can share a common counter and therefore |
| 702 | a common label category. E.g. labels in both @code{equation} and | 790 | a common label category. For example labels in both @code{equation} and |
| 703 | @code{eqnarray} environments record the value of the same counter - the | 791 | @code{eqnarray} environments record the value of the same counter -- the |
| 704 | equation counter. | 792 | equation counter. |
| 705 | 793 | ||
| 706 | @menu | 794 | @menu |
| @@ -709,9 +797,8 @@ equation counter. | |||
| 709 | * Builtin Label Environments:: The environments RefTeX knows about. | 797 | * Builtin Label Environments:: The environments RefTeX knows about. |
| 710 | * Defining Label Environments:: ... and environments it doesn't. | 798 | * Defining Label Environments:: ... and environments it doesn't. |
| 711 | * Reference Info:: View the label corresponding to a \ref. | 799 | * Reference Info:: View the label corresponding to a \ref. |
| 800 | * Reference Styles:: Macros to be used instead of \ref. | ||
| 712 | * xr (LaTeX package):: References to external documents. | 801 | * xr (LaTeX package):: References to external documents. |
| 713 | * varioref (LaTeX package):: How to create \vref instead of \ref. | ||
| 714 | * fancyref (LaTeX package):: How to create \fref instead of \ref. | ||
| 715 | @end menu | 802 | @end menu |
| 716 | 803 | ||
| 717 | @node Creating Labels, Referencing Labels, , Labels and References | 804 | @node Creating Labels, Referencing Labels, , Labels and References |
| @@ -722,12 +809,12 @@ equation counter. | |||
| 722 | @kindex C-c ( | 809 | @kindex C-c ( |
| 723 | @findex reftex-label | 810 | @findex reftex-label |
| 724 | 811 | ||
| 725 | In order to create a label in a LaTeX document, press @kbd{C-c (} | 812 | In order to create a label in a @LaTeX{} document, press @kbd{C-c (} |
| 726 | (@code{reftex-label}). Just like LaTeX, @b{Ref@TeX{}} is context sensitive | 813 | (@code{reftex-label}). Just like @LaTeX{}, @RefTeX{} is context sensitive |
| 727 | and will figure out the environment it currently is in and adapt the | 814 | and will figure out the environment it currently is in and adapt the |
| 728 | label to that environment. A label usually consists of a short prefix | 815 | label to that environment. A label usually consists of a short prefix |
| 729 | indicating the type of the label and a unique mark. @b{Ref@TeX{}} has | 816 | indicating the type of the label and a unique mark. @RefTeX{} has |
| 730 | 3 different modes to create this mark. | 817 | three different modes to create this mark. |
| 731 | 818 | ||
| 732 | @enumerate | 819 | @enumerate |
| 733 | @item | 820 | @item |
| @@ -735,10 +822,10 @@ indicating the type of the label and a unique mark. @b{Ref@TeX{}} has | |||
| 735 | @vindex reftex-derive-label-parameters | 822 | @vindex reftex-derive-label-parameters |
| 736 | @vindex reftex-label-illegal-re | 823 | @vindex reftex-label-illegal-re |
| 737 | @vindex reftex-abbrev-parameters | 824 | @vindex reftex-abbrev-parameters |
| 738 | A label can be derived from context. This means, @b{Ref@TeX{}} takes | 825 | A label can be derived from context. This means, @RefTeX{} takes |
| 739 | the context of the label definition and constructs a label from | 826 | the context of the label definition and constructs a label from |
| 740 | that@footnote{Note that the context may contain constructs which are | 827 | that@footnote{Note that the context may contain constructs which are |
| 741 | invalid in labels. @b{Ref@TeX{}} will therefore strip the accent from | 828 | invalid in labels. @RefTeX{} will therefore strip the accent from |
| 742 | accented Latin-1 characters and remove everything else which is not | 829 | accented Latin-1 characters and remove everything else which is not |
| 743 | valid in labels. This mechanism is safe, but may not be satisfactory | 830 | valid in labels. This mechanism is safe, but may not be satisfactory |
| 744 | for non-western languages. Check the following variables if you need to | 831 | for non-western languages. Check the following variables if you need to |
| @@ -746,28 +833,28 @@ change things: @code{reftex-translate-to-ascii-function}, | |||
| 746 | @code{reftex-derive-label-parameters}, @code{reftex-label-illegal-re}, | 833 | @code{reftex-derive-label-parameters}, @code{reftex-label-illegal-re}, |
| 747 | @code{reftex-abbrev-parameters}.}. This works best for section labels, | 834 | @code{reftex-abbrev-parameters}.}. This works best for section labels, |
| 748 | where the section heading is used to construct a label. In fact, | 835 | where the section heading is used to construct a label. In fact, |
| 749 | @b{Ref@TeX{}}'s default settings use this method only for section | 836 | @RefTeX{}'s default settings use this method only for section |
| 750 | labels. You will be asked to confirm the derived label, or edit | 837 | labels. You will be asked to confirm the derived label, or edit |
| 751 | it. | 838 | it. |
| 752 | 839 | ||
| 753 | @item | 840 | @item |
| 754 | We may also use a simple unique number to identify a label. This is | 841 | We may also use a simple unique number to identify a label. This is |
| 755 | mostly useful for labels where it is difficult to come up with a very | 842 | mostly useful for labels where it is difficult to come up with a very |
| 756 | good descriptive name. @b{Ref@TeX{}}'s default settings use this method | 843 | good descriptive name. @RefTeX{}'s default settings use this method |
| 757 | for equations, enumerate items and footnotes. The author of @b{Ref@TeX{}} | 844 | for equations, enumerate items and footnotes. The author of @RefTeX{} |
| 758 | tends to write documents with many equations and finds it impossible | 845 | tends to write documents with many equations and finds it impossible |
| 759 | to come up with good names for each of them. These simple labels are | 846 | to come up with good names for each of them. These simple labels are |
| 760 | inserted without query, and are therefore very fast. Good descriptive | 847 | inserted without query, and are therefore very fast. Good descriptive |
| 761 | names are not really necessary as @b{Ref@TeX{}} will provide context to | 848 | names are not really necessary as @RefTeX{} will provide context to |
| 762 | reference a label (@pxref{Referencing Labels}). | 849 | reference a label (@pxref{Referencing Labels}). |
| 763 | 850 | ||
| 764 | @item | 851 | @item |
| 765 | The third method is to ask the user for a label. This is most | 852 | The third method is to ask the user for a label. This is most |
| 766 | useful for things which are easy to describe briefly and do not turn up | 853 | useful for things which are easy to describe briefly and do not turn up |
| 767 | too frequently in a document. @b{Ref@TeX{}} uses this for figures and | 854 | too frequently in a document. @RefTeX{} uses this for figures and |
| 768 | tables. Of course, one can enter the label directly by typing the full | 855 | tables. Of course, one can enter the label directly by typing the full |
| 769 | @samp{\label@{mark@}}. The advantage of using @code{reftex-label} | 856 | @samp{\label@{mark@}}. The advantage of using @code{reftex-label} |
| 770 | anyway is that @b{Ref@TeX{}} will know that a new label has been defined. | 857 | anyway is that @RefTeX{} will know that a new label has been defined. |
| 771 | It will then not be necessary to rescan the document in order to access | 858 | It will then not be necessary to rescan the document in order to access |
| 772 | this label later. | 859 | this label later. |
| 773 | @end enumerate | 860 | @end enumerate |
| @@ -777,9 +864,9 @@ If you want to change the way certain labels are created, check out the | |||
| 777 | variable @code{reftex-insert-label-flags} (@pxref{Options (Creating | 864 | variable @code{reftex-insert-label-flags} (@pxref{Options (Creating |
| 778 | Labels)}). | 865 | Labels)}). |
| 779 | 866 | ||
| 780 | If you are using AUCTeX to write your LaTeX documents, you can | 867 | If you are using @AUCTeX{} to write your @LaTeX{} documents, you can |
| 781 | set it up to delegate the creation of labels to | 868 | set it up to delegate the creation of labels to |
| 782 | @b{Ref@TeX{}}. @xref{AUCTeX}, for more information. | 869 | @RefTeX{}. @xref{AUCTeX}, for more information. |
| 783 | 870 | ||
| 784 | @node Referencing Labels, Builtin Label Environments, Creating Labels, Labels and References | 871 | @node Referencing Labels, Builtin Label Environments, Creating Labels, Labels and References |
| 785 | @section Referencing Labels | 872 | @section Referencing Labels |
| @@ -792,24 +879,31 @@ set it up to delegate the creation of labels to | |||
| 792 | @findex reftex-reference | 879 | @findex reftex-reference |
| 793 | 880 | ||
| 794 | @vindex reftex-trust-label-prefix | 881 | @vindex reftex-trust-label-prefix |
| 795 | @b{Ref@TeX{}} scans the document in order to find all labels. To make | 882 | @RefTeX{} scans the document in order to find all labels. To make |
| 796 | referencing labels easier, it assigns to each label a category, the | 883 | referencing labels easier, it assigns to each label a category, the |
| 797 | @emph{label type} (for example section, table, figure, equation, etc.). | 884 | @emph{label type} (for example section, table, figure, equation, etc.). |
| 798 | In order to determine the label type, RefTeX parses around each label | 885 | In order to determine the label type, @RefTeX{} parses around each label |
| 799 | to see in what kind of environments it is located. You can speed up | 886 | to see in what kind of environments it is located. You can speed up |
| 800 | the parsing by using type-specific prefixes for labels and configuring | 887 | the parsing by using type-specific prefixes for labels and configuring |
| 801 | the variable @code{reftex-trust-label-prefix}. | 888 | the variable @code{reftex-trust-label-prefix}. |
| 802 | 889 | ||
| 803 | Referencing Labels is really at the heart of @b{Ref@TeX{}}. Press @kbd{C-c | 890 | Referencing Labels is really at the heart of @RefTeX{}. Press @kbd{C-c |
| 804 | )} in order to reference a label (reftex-reference). This will start a | 891 | )} in order to reference a label (@code{reftex-reference}). This will |
| 805 | selection process and finally insert the complete @samp{\ref@{label@}} | 892 | start a selection process and finally insert the complete |
| 806 | into the buffer. | 893 | @samp{\ref@{label@}} into the buffer. |
| 894 | |||
| 895 | @vindex reftex-ref-macro-prompt | ||
| 896 | First, you can select which reference macro you want to use, | ||
| 897 | e.g. @samp{\ref} or @samp{\pageref}. Later in the process you have | ||
| 898 | another chance to make this selection and you can therefore disable this | ||
| 899 | step by customizing @code{reftex-ref-macro-prompt} if you find it too | ||
| 900 | intrusive. @xref{Reference Styles}. | ||
| 807 | 901 | ||
| 808 | First, @b{Ref@TeX{}} will determine the label category which is required. | 902 | Then, @RefTeX{} will determine the label category which is required. |
| 809 | Often that can be figured out from context. For example, if you | 903 | Often that can be figured out from context. For example, if you write |
| 810 | write @samp{As shown in eq.} and the press @kbd{C-c )}, @b{Ref@TeX{}} knows | 904 | @samp{As shown in eq.} and then press @kbd{C-c )}, @RefTeX{} knows that |
| 811 | that an equation label is going to be referenced. If it cannot figure | 905 | an equation label is going to be referenced. If it cannot figure out |
| 812 | out what label category is needed, it will query for one. | 906 | what label category is needed, it will query for one. |
| 813 | 907 | ||
| 814 | You will then be presented with a label selection menu. This is a | 908 | You will then be presented with a label selection menu. This is a |
| 815 | special buffer which contains an outline of the document along with all | 909 | special buffer which contains an outline of the document along with all |
| @@ -820,7 +914,7 @@ sufficient to identify the label. If you are unsure about a certain | |||
| 820 | label, pressing @key{SPC} will show the label definition point in | 914 | label, pressing @key{SPC} will show the label definition point in |
| 821 | another window. | 915 | another window. |
| 822 | 916 | ||
| 823 | In order to reference a label, move to cursor to the correct label and | 917 | In order to reference a label, move the cursor to the correct label and |
| 824 | press @key{RET}. You can also reference several labels with a single | 918 | press @key{RET}. You can also reference several labels with a single |
| 825 | call to @code{reftex-reference} by marking entries with the @kbd{m} | 919 | call to @code{reftex-reference} by marking entries with the @kbd{m} |
| 826 | key (see below). | 920 | key (see below). |
| @@ -871,7 +965,7 @@ window. See also the @kbd{f} key. | |||
| 871 | Toggle follow mode. When follow mode is active, the other window will | 965 | Toggle follow mode. When follow mode is active, the other window will |
| 872 | always display the full context of the current label. This is similar | 966 | always display the full context of the current label. This is similar |
| 873 | to pressing @key{SPC} after each cursor motion. Note that only context | 967 | to pressing @key{SPC} after each cursor motion. Note that only context |
| 874 | in files already visited is shown. @b{RefTeX} will not visit a file | 968 | in files already visited is shown. @RefTeX{} will not visit a file |
| 875 | just for follow mode. See, however, the variable | 969 | just for follow mode. See, however, the variable |
| 876 | @code{reftex-revisit-to-follow}. | 970 | @code{reftex-revisit-to-follow}. |
| 877 | 971 | ||
| @@ -888,8 +982,8 @@ references all marked labels. | |||
| 888 | @item mouse-2 | 982 | @item mouse-2 |
| 889 | @vindex reftex-highlight-selection | 983 | @vindex reftex-highlight-selection |
| 890 | Clicking with mouse button 2 on a label will accept it like @key{RET} | 984 | Clicking with mouse button 2 on a label will accept it like @key{RET} |
| 891 | would. See also variable @code{reftex-highlight-selection}, @ref{Options | 985 | would. See also variable @code{reftex-highlight-selection}, |
| 892 | (Misc)}. | 986 | @ref{Options (Misc)}. |
| 893 | 987 | ||
| 894 | @vindex reftex-multiref-punctuation | 988 | @vindex reftex-multiref-punctuation |
| 895 | @item m - + , | 989 | @item m - + , |
| @@ -923,26 +1017,15 @@ Enter a label with completion. This may also be a label which does not | |||
| 923 | yet exist in the document. | 1017 | yet exist in the document. |
| 924 | 1018 | ||
| 925 | @item v | 1019 | @item v |
| 926 | @cindex @code{varioref}, LaTeX package | 1020 | Cycle forward through active reference macros. The selected macro is |
| 927 | @cindex @code{\vref} | 1021 | displayed by the @samp{S<...>} indicator in the mode line of the |
| 928 | @cindex LaTeX packages, @code{varioref} | 1022 | selection buffer. This mechanism comes in handy if you are using |
| 929 | Toggle between @code{\ref} and @code{\vref} macro for references. The | 1023 | @LaTeX{} packages like @code{varioref} or @code{fancyref} and want to |
| 930 | @code{\vref} macro is defined in the @code{varioref} LaTeX package. | 1024 | use the special referencing macros they provide (e.g. @code{\vref} or |
| 931 | With this key you can force @b{Ref@TeX{}} to insert a @code{\vref} | 1025 | @code{\fref}) instead of @code{\ref}. |
| 932 | macro. The current state of this flag is displayed by the @samp{S<>} | ||
| 933 | indicator in the mode line of the selection buffer. | ||
| 934 | 1026 | ||
| 935 | @item V | 1027 | @item V |
| 936 | @cindex @code{fancyref}, LaTeX package | 1028 | Cycle backward through active reference macros. |
| 937 | @cindex @code{\fref} | ||
| 938 | @cindex @code{\Fref} | ||
| 939 | @cindex LaTeX packages, @code{fancyref} | ||
| 940 | Cycle between @code{\ref}, @code{\fref} and @code{\Fref}. The | ||
| 941 | @code{\fref} and @code{\Fref} macros are defined in the @code{fancyref} | ||
| 942 | LaTeX package. With this key you can force @b{Ref@TeX{}} to insert a | ||
| 943 | @code{\fref} or @code{\Fref} macro. The current state of this flag is | ||
| 944 | displayed by the @samp{S<>} indicator in the mode line of the | ||
| 945 | selection buffer. | ||
| 946 | 1029 | ||
| 947 | @tablesubheading{Exiting} | 1030 | @tablesubheading{Exiting} |
| 948 | 1031 | ||
| @@ -966,7 +1049,7 @@ selection buffer. | |||
| 966 | @item t | 1049 | @item t |
| 967 | Toggle the display of the table of contents in the selection buffer. | 1050 | Toggle the display of the table of contents in the selection buffer. |
| 968 | With prefix @var{arg}, change the maximum level of toc entries displayed | 1051 | With prefix @var{arg}, change the maximum level of toc entries displayed |
| 969 | to @var{arg}. Chapters are level 1, section are level 2. | 1052 | to @var{arg}. Chapters are level 1, sections are level 2. |
| 970 | 1053 | ||
| 971 | @item # | 1054 | @item # |
| 972 | Toggle the display of a label counter in the selection buffer. | 1055 | Toggle the display of a label counter in the selection buffer. |
| @@ -974,7 +1057,7 @@ Toggle the display of a label counter in the selection buffer. | |||
| 974 | @item % | 1057 | @item % |
| 975 | Toggle the display of labels hidden in comments in the selection | 1058 | Toggle the display of labels hidden in comments in the selection |
| 976 | buffers. Sometimes, you may have commented out parts of your document. | 1059 | buffers. Sometimes, you may have commented out parts of your document. |
| 977 | If these parts contain label definitions, @b{Ref@TeX{}} can still display | 1060 | If these parts contain label definitions, @RefTeX{} can still display |
| 978 | and reference these labels. | 1061 | and reference these labels. |
| 979 | 1062 | ||
| 980 | @tablesubheading{Updating the buffer} | 1063 | @tablesubheading{Updating the buffer} |
| @@ -998,7 +1081,7 @@ Switch the label category. After prompting for another label category, | |||
| 998 | a menu for that category will be shown. | 1081 | a menu for that category will be shown. |
| 999 | 1082 | ||
| 1000 | @item x | 1083 | @item x |
| 1001 | Reference a label from an external document. With the LaTeX package | 1084 | Reference a label from an external document. With the @LaTeX{} package |
| 1002 | @code{xr} it is possible to reference labels defined in another | 1085 | @code{xr} it is possible to reference labels defined in another |
| 1003 | document. This key will switch to the label menu of an external | 1086 | document. This key will switch to the label menu of an external |
| 1004 | document and let you select a label from there (@pxref{xr (LaTeX | 1087 | document and let you select a label from there (@pxref{xr (LaTeX |
| @@ -1018,10 +1101,10 @@ keymap @code{reftex-select-label-map} may be used. | |||
| 1018 | @vindex reftex-label-alist | 1101 | @vindex reftex-label-alist |
| 1019 | @vindex reftex-label-alist-builtin | 1102 | @vindex reftex-label-alist-builtin |
| 1020 | 1103 | ||
| 1021 | @b{Ref@TeX{}} needs to be aware of the environments which can be referenced | 1104 | @RefTeX{} needs to be aware of the environments which can be referenced |
| 1022 | with a label (i.e. which carry their own counters). By default, @b{Ref@TeX{}} | 1105 | with a label (i.e. which carry their own counters). By default, @RefTeX{} |
| 1023 | recognizes all labeled environments and macros discussed in @cite{The | 1106 | recognizes all labeled environments and macros discussed in @cite{The |
| 1024 | LaTeX Companion by Goossens, Mittelbach & Samarin, Addison-Wesley | 1107 | @LaTeX{} Companion by Goossens, Mittelbach & Samarin, Addison-Wesley |
| 1025 | 1994.}. These are: | 1108 | 1994.}. These are: |
| 1026 | 1109 | ||
| 1027 | @itemize @minus | 1110 | @itemize @minus |
| @@ -1038,7 +1121,7 @@ LaTeX Companion by Goossens, Mittelbach & Samarin, Addison-Wesley | |||
| 1038 | @cindex LaTeX core | 1121 | @cindex LaTeX core |
| 1039 | @code{figure}, @code{figure*}, @code{table}, @code{table*}, @code{equation}, | 1122 | @code{figure}, @code{figure*}, @code{table}, @code{table*}, @code{equation}, |
| 1040 | @code{eqnarray}, @code{enumerate}, the @code{\footnote} macro (this is | 1123 | @code{eqnarray}, @code{enumerate}, the @code{\footnote} macro (this is |
| 1041 | the LaTeX core stuff) | 1124 | the @LaTeX{} core stuff) |
| 1042 | @item | 1125 | @item |
| 1043 | @cindex AMS-LaTeX | 1126 | @cindex AMS-LaTeX |
| 1044 | @cindex @code{amsmath}, LaTeX package | 1127 | @cindex @code{amsmath}, LaTeX package |
| @@ -1053,7 +1136,7 @@ the LaTeX core stuff) | |||
| 1053 | @cindex @code{subequations}, AMS-LaTeX environment | 1136 | @cindex @code{subequations}, AMS-LaTeX environment |
| 1054 | @code{align}, @code{gather}, @code{multline}, @code{flalign}, | 1137 | @code{align}, @code{gather}, @code{multline}, @code{flalign}, |
| 1055 | @code{alignat}, @code{xalignat}, @code{xxalignat}, @code{subequations} | 1138 | @code{alignat}, @code{xalignat}, @code{xxalignat}, @code{subequations} |
| 1056 | (from AMS-LaTeX's @file{amsmath.sty} package) | 1139 | (from AMS-@LaTeX{}'s @file{amsmath.sty} package) |
| 1057 | @item | 1140 | @item |
| 1058 | @cindex @code{endnote}, LaTeX package | 1141 | @cindex @code{endnote}, LaTeX package |
| 1059 | @cindex LaTeX packages, @code{endnote} | 1142 | @cindex LaTeX packages, @code{endnote} |
| @@ -1112,7 +1195,7 @@ the @code{\endnote} macro (from @file{endnotes.sty}) | |||
| 1112 | @end itemize | 1195 | @end itemize |
| 1113 | 1196 | ||
| 1114 | If you want to use other labeled environments, defined with | 1197 | If you want to use other labeled environments, defined with |
| 1115 | @code{\newtheorem}, @b{Ref@TeX{}} needs to be configured to recognize | 1198 | @code{\newtheorem}, @RefTeX{} needs to be configured to recognize |
| 1116 | them (@pxref{Defining Label Environments}). | 1199 | them (@pxref{Defining Label Environments}). |
| 1117 | 1200 | ||
| 1118 | @node Defining Label Environments, Reference Info, Builtin Label Environments, Labels and References | 1201 | @node Defining Label Environments, Reference Info, Builtin Label Environments, Labels and References |
| @@ -1120,7 +1203,7 @@ them (@pxref{Defining Label Environments}). | |||
| 1120 | @cindex Label environments, defining | 1203 | @cindex Label environments, defining |
| 1121 | 1204 | ||
| 1122 | @vindex reftex-label-alist | 1205 | @vindex reftex-label-alist |
| 1123 | @b{Ref@TeX{}} can be configured to recognize additional labeled | 1206 | @RefTeX{} can be configured to recognize additional labeled |
| 1124 | environments and macros. This is done with the variable | 1207 | environments and macros. This is done with the variable |
| 1125 | @code{reftex-label-alist} (@pxref{Options (Defining Label | 1208 | @code{reftex-label-alist} (@pxref{Options (Defining Label |
| 1126 | Environments)}). If you are not familiar with Lisp, you can use the | 1209 | Environments)}). If you are not familiar with Lisp, you can use the |
| @@ -1143,7 +1226,7 @@ Environments}). | |||
| 1143 | * Quick Equation:: When a macro sets the label type. | 1226 | * Quick Equation:: When a macro sets the label type. |
| 1144 | * Figure Wrapper:: When a macro argument is a label. | 1227 | * Figure Wrapper:: When a macro argument is a label. |
| 1145 | * Adding Magic Words:: Other words for other languages. | 1228 | * Adding Magic Words:: Other words for other languages. |
| 1146 | * Using \eqref:: How to switch to this AMS-LaTeX macro. | 1229 | * Using \eqref:: How to switch to this AMS-@LaTeX{} macro. |
| 1147 | * Non-Standard Environments:: Environments without \begin and \end | 1230 | * Non-Standard Environments:: Environments without \begin and \end |
| 1148 | * Putting it Together:: How to combine many entries. | 1231 | * Putting it Together:: How to combine many entries. |
| 1149 | @end menu | 1232 | @end menu |
| @@ -1154,7 +1237,7 @@ Environments}). | |||
| 1154 | @cindex @code{axiom}, newtheorem | 1237 | @cindex @code{axiom}, newtheorem |
| 1155 | @cindex @code{\newtheorem} | 1238 | @cindex @code{\newtheorem} |
| 1156 | 1239 | ||
| 1157 | Suppose you are using @code{\newtheorem} in LaTeX in order to define two | 1240 | Suppose you are using @code{\newtheorem} in @LaTeX{} in order to define two |
| 1158 | new environments, @code{theorem} and @code{axiom} | 1241 | new environments, @code{theorem} and @code{axiom} |
| 1159 | 1242 | ||
| 1160 | @example | 1243 | @example |
| @@ -1172,7 +1255,7 @@ to be used like this: | |||
| 1172 | \end@{axiom@} | 1255 | \end@{axiom@} |
| 1173 | @end example | 1256 | @end example |
| 1174 | 1257 | ||
| 1175 | So we need to tell @b{Ref@TeX{}} that @code{theorem} and @code{axiom} are new | 1258 | So we need to tell @RefTeX{} that @code{theorem} and @code{axiom} are new |
| 1176 | labeled environments which define their own label categories. We can | 1259 | labeled environments which define their own label categories. We can |
| 1177 | either use Lisp to do this (e.g. in @file{.emacs}) or use the custom | 1260 | either use Lisp to do this (e.g. in @file{.emacs}) or use the custom |
| 1178 | library. With Lisp it would look like this | 1261 | library. With Lisp it would look like this |
| @@ -1184,7 +1267,7 @@ library. With Lisp it would look like this | |||
| 1184 | @end lisp | 1267 | @end lisp |
| 1185 | 1268 | ||
| 1186 | The type indicator characters @code{?a} and @code{?h} are used for | 1269 | The type indicator characters @code{?a} and @code{?h} are used for |
| 1187 | prompts when @b{Ref@TeX{}} queries for a label type. @code{?h} | 1270 | prompts when @RefTeX{} queries for a label type. @code{?h} |
| 1188 | was chosen for @code{theorem} since @code{?t} is already taken by | 1271 | was chosen for @code{theorem} since @code{?t} is already taken by |
| 1189 | @code{table}. Note that also @code{?s}, @code{?f}, @code{?e}, | 1272 | @code{table}. Note that also @code{?s}, @code{?f}, @code{?e}, |
| 1190 | @code{?i}, @code{?n} are already used for standard environments. | 1273 | @code{?i}, @code{?n} are already used for standard environments. |
| @@ -1192,10 +1275,10 @@ was chosen for @code{theorem} since @code{?t} is already taken by | |||
| 1192 | @noindent | 1275 | @noindent |
| 1193 | The labels for Axioms and Theorems will have the prefixes @samp{ax:} and | 1276 | The labels for Axioms and Theorems will have the prefixes @samp{ax:} and |
| 1194 | @samp{thr:}, respectively. @xref{AUCTeX}, for information on how | 1277 | @samp{thr:}, respectively. @xref{AUCTeX}, for information on how |
| 1195 | AUCTeX can use RefTeX to automatically create labels when a new environment | 1278 | @AUCTeX{} can use @RefTeX{} to automatically create labels when a new |
| 1196 | is inserted into a buffer. Additionally, the following needs to be | 1279 | environment is inserted into a buffer. Additionally, the following |
| 1197 | added to one's .emacs file before AUCTeX will automatically create | 1280 | needs to be added to one's .emacs file before @AUCTeX{} will |
| 1198 | labels for the new environments. | 1281 | automatically create labels for the new environments. |
| 1199 | 1282 | ||
| 1200 | @lisp | 1283 | @lisp |
| 1201 | (add-hook 'LaTeX-mode-hook | 1284 | (add-hook 'LaTeX-mode-hook |
| @@ -1226,9 +1309,9 @@ Environments)}). | |||
| 1226 | @end itemize | 1309 | @end itemize |
| 1227 | 1310 | ||
| 1228 | The following list of strings is used to guess the correct label type | 1311 | The following list of strings is used to guess the correct label type |
| 1229 | from the word before point when creating a reference. E.g. if you | 1312 | from the word before point when creating a reference. For example if you |
| 1230 | write: @samp{As we have shown in Theorem} and then press @kbd{C-c )}, | 1313 | write: @samp{As we have shown in Theorem} and then press @kbd{C-c )}, |
| 1231 | @b{Ref@TeX{}} will know that you are looking for a theorem label and | 1314 | @RefTeX{} will know that you are looking for a theorem label and |
| 1232 | restrict the menu to only these labels without even asking. | 1315 | restrict the menu to only these labels without even asking. |
| 1233 | 1316 | ||
| 1234 | The final item in each entry is the level at which the environment | 1317 | The final item in each entry is the level at which the environment |
| @@ -1299,7 +1382,7 @@ and used like this: | |||
| 1299 | Einstein's equation is \quickeq@{E=mc^2 \label@{eq:einstein@}@}. | 1382 | Einstein's equation is \quickeq@{E=mc^2 \label@{eq:einstein@}@}. |
| 1300 | @end example | 1383 | @end example |
| 1301 | 1384 | ||
| 1302 | We need to tell @b{Ref@TeX{}} that any label defined in the argument of the | 1385 | We need to tell @RefTeX{} that any label defined in the argument of the |
| 1303 | @code{\quickeq} is an equation label. Here is how to do this with lisp: | 1386 | @code{\quickeq} is an equation label. Here is how to do this with lisp: |
| 1304 | 1387 | ||
| 1305 | @lisp | 1388 | @lisp |
| @@ -1310,7 +1393,7 @@ The first element in this list is now the macro with empty braces as an | |||
| 1310 | @emph{image} of the macro arguments. @code{?e} indicates that this is | 1393 | @emph{image} of the macro arguments. @code{?e} indicates that this is |
| 1311 | an equation label, the different @code{nil} elements indicate to use the | 1394 | an equation label, the different @code{nil} elements indicate to use the |
| 1312 | default values for equations. The @samp{1} as the fifth element | 1395 | default values for equations. The @samp{1} as the fifth element |
| 1313 | indicates that the context of the label definition should be the 1st | 1396 | indicates that the context of the label definition should be the first |
| 1314 | argument of the macro. | 1397 | argument of the macro. |
| 1315 | 1398 | ||
| 1316 | Here is again how this would look in the customization buffer: | 1399 | Here is again how this would look in the customization buffer: |
| @@ -1352,7 +1435,7 @@ which would be called like | |||
| 1352 | \myfig[htp]@{filename@}@{caption text@}@{label@}@{1@} | 1435 | \myfig[htp]@{filename@}@{caption text@}@{label@}@{1@} |
| 1353 | @end example | 1436 | @end example |
| 1354 | 1437 | ||
| 1355 | Now we need to tell @b{Ref@TeX{}} that the 4th argument of the | 1438 | Now we need to tell @RefTeX{} that the fourth argument of the |
| 1356 | @code{\myfig} macro @emph{is itself} a figure label, and where to find | 1439 | @code{\myfig} macro @emph{is itself} a figure label, and where to find |
| 1357 | the context. | 1440 | the context. |
| 1358 | 1441 | ||
| @@ -1366,8 +1449,8 @@ The empty pairs of brackets indicate the different arguments of the | |||
| 1366 | indicates that this is a figure label which will be listed together with | 1449 | indicates that this is a figure label which will be listed together with |
| 1367 | labels from normal figure environments. The @code{nil} entries for | 1450 | labels from normal figure environments. The @code{nil} entries for |
| 1368 | prefix and reference format mean to use the defaults for figure labels. | 1451 | prefix and reference format mean to use the defaults for figure labels. |
| 1369 | The @samp{3} for the context method means to grab the 3rd macro argument | 1452 | The @samp{3} for the context method means to grab the third macro argument |
| 1370 | - the caption. | 1453 | -- the caption. |
| 1371 | 1454 | ||
| 1372 | As a side effect of this configuration, @code{reftex-label} will now | 1455 | As a side effect of this configuration, @code{reftex-label} will now |
| 1373 | insert the required naked label (without the @code{\label} macro) when | 1456 | insert the required naked label (without the @code{\label} macro) when |
| @@ -1420,7 +1503,7 @@ predefined label categories. | |||
| 1420 | 1503 | ||
| 1421 | Another case where one only wants to change the information associated | 1504 | Another case where one only wants to change the information associated |
| 1422 | with the label category is to change the macro which is used for | 1505 | with the label category is to change the macro which is used for |
| 1423 | referencing the label. When working with the AMS-LaTeX stuff, you might | 1506 | referencing the label. When working with the AMS-@LaTeX{}, you might |
| 1424 | prefer @code{\eqref} for doing equation references. Here is how to | 1507 | prefer @code{\eqref} for doing equation references. Here is how to |
| 1425 | do this: | 1508 | do this: |
| 1426 | 1509 | ||
| @@ -1428,7 +1511,7 @@ do this: | |||
| 1428 | (setq reftex-label-alist '((nil ?e nil "~\\eqref@{%s@}" nil nil))) | 1511 | (setq reftex-label-alist '((nil ?e nil "~\\eqref@{%s@}" nil nil))) |
| 1429 | @end lisp | 1512 | @end lisp |
| 1430 | 1513 | ||
| 1431 | @b{Ref@TeX{}} has also a predefined symbol for this special purpose. The | 1514 | @RefTeX{} has also a predefined symbol for this special purpose. The |
| 1432 | following is equivalent to the line above. | 1515 | following is equivalent to the line above. |
| 1433 | 1516 | ||
| 1434 | @lisp | 1517 | @lisp |
| @@ -1436,7 +1519,7 @@ following is equivalent to the line above. | |||
| 1436 | @end lisp | 1519 | @end lisp |
| 1437 | 1520 | ||
| 1438 | Note that this is automatically done by the @file{amsmath.el} style file | 1521 | Note that this is automatically done by the @file{amsmath.el} style file |
| 1439 | of AUCTeX (@pxref{Style Files}) - so if you use AUCTeX, | 1522 | of @AUCTeX{} (@pxref{Style Files}) -- so if you use @AUCTeX{}, |
| 1440 | this configuration will not be necessary. | 1523 | this configuration will not be necessary. |
| 1441 | 1524 | ||
| 1442 | @node Non-Standard Environments, Putting it Together, Using \eqref, Defining Label Environments | 1525 | @node Non-Standard Environments, Putting it Together, Using \eqref, Defining Label Environments |
| @@ -1446,8 +1529,8 @@ this configuration will not be necessary. | |||
| 1446 | @cindex Special parser functions | 1529 | @cindex Special parser functions |
| 1447 | @cindex Parser functions, for special environments | 1530 | @cindex Parser functions, for special environments |
| 1448 | 1531 | ||
| 1449 | Some LaTeX packages define environment-like structures without using the | 1532 | Some @LaTeX{} packages define environment-like structures without using the |
| 1450 | standard @samp{\begin..\end} structure. @b{Ref@TeX{}} cannot parse | 1533 | standard @samp{\begin..\end} structure. @RefTeX{} cannot parse |
| 1451 | these directly, but you can write your own special-purpose parser and | 1534 | these directly, but you can write your own special-purpose parser and |
| 1452 | use it instead of the name of an environment in an entry for | 1535 | use it instead of the name of an environment in an entry for |
| 1453 | @code{reftex-label-alist}. The function should check if point is | 1536 | @code{reftex-label-alist}. The function should check if point is |
| @@ -1506,7 +1589,7 @@ terminated by @samp{\z.} or by an empty line. | |||
| 1506 | The difficulty is that the @samp{\a.} lists can nest and that an empty | 1589 | The difficulty is that the @samp{\a.} lists can nest and that an empty |
| 1507 | line terminates all list levels in one go. So we have to count nesting | 1590 | line terminates all list levels in one go. So we have to count nesting |
| 1508 | levels between @samp{\a.} and @samp{\z.}. Here is the implementation | 1591 | levels between @samp{\a.} and @samp{\z.}. Here is the implementation |
| 1509 | for @b{Ref@TeX{}}. | 1592 | for @RefTeX{}. |
| 1510 | 1593 | ||
| 1511 | @lisp | 1594 | @lisp |
| 1512 | (setq reftex-label-alist | 1595 | (setq reftex-label-alist |
| @@ -1558,7 +1641,7 @@ the entries described above: | |||
| 1558 | (detect-linguex ?x "ex:" "~\\ref@{%s@}" nil ("Example" "Ex.")))) | 1641 | (detect-linguex ?x "ex:" "~\\ref@{%s@}" nil ("Example" "Ex.")))) |
| 1559 | @end lisp | 1642 | @end lisp |
| 1560 | 1643 | ||
| 1561 | @node Reference Info, xr (LaTeX package), Defining Label Environments, Labels and References | 1644 | @node Reference Info, Reference Styles, Defining Label Environments, Labels and References |
| 1562 | @section Reference Info | 1645 | @section Reference Info |
| 1563 | @findex reftex-view-crossref | 1646 | @findex reftex-view-crossref |
| 1564 | @findex reftex-mouse-view-crossref | 1647 | @findex reftex-mouse-view-crossref |
| @@ -1575,12 +1658,100 @@ information about the label referenced there. Note that the information | |||
| 1575 | is only displayed if the echo area is not occupied by a different | 1658 | is only displayed if the echo area is not occupied by a different |
| 1576 | message. | 1659 | message. |
| 1577 | 1660 | ||
| 1578 | @b{Ref@TeX{}} can also display the label definition corresponding to a | 1661 | @RefTeX{} can also display the label definition corresponding to a |
| 1579 | @code{\ref} macro, or all reference locations corresponding to a | 1662 | @code{\ref} macro, or all reference locations corresponding to a |
| 1580 | @code{\label} macro. @xref{Viewing Cross-References}, for more | 1663 | @code{\label} macro. @xref{Viewing Cross-References}, for more |
| 1581 | information. | 1664 | information. |
| 1582 | 1665 | ||
| 1583 | @node xr (LaTeX package), varioref (LaTeX package), Reference Info, Labels and References | 1666 | @node Reference Styles, xr (LaTeX package), Reference Info, Labels and References |
| 1667 | @section Reference Styles | ||
| 1668 | |||
| 1669 | In case you defined your own macros for referencing or you are using | ||
| 1670 | @LaTeX{} packages providing specialized macros to be used instead of | ||
| 1671 | @code{\ref}, @RefTeX{} provides ways to select and insert them in a | ||
| 1672 | convenient way. | ||
| 1673 | |||
| 1674 | @RefTeX{} comes equipped with a set of so-called reference styles where | ||
| 1675 | each relates to one or more reference macros. The standard macros | ||
| 1676 | @samp{\ref} and @samp{\pageref} or provided by the ``Default'' style. | ||
| 1677 | The ``Varioref'' style offers macros for the @samp{varioref} @LaTeX{} | ||
| 1678 | package (@samp{\vref}, @samp{\Vref}, @samp{\Ref}, @samp{\vpageref}), | ||
| 1679 | ``Fancyref'' for the @samp{fancyref} package (@samp{\fref}, | ||
| 1680 | @samp{\Fref}) and ``Hyperref'' for the @samp{hyperref} package | ||
| 1681 | (@samp{\autoref}, @samp{\autopageref}). | ||
| 1682 | |||
| 1683 | @vindex reftex-ref-style-default-list | ||
| 1684 | A style can be toggled by selecting the respective entry in the | ||
| 1685 | @samp{Reference Style} menu. Changes made through the menu will only | ||
| 1686 | last for the Emacs session. In order to configure a preference | ||
| 1687 | permanently, the variable @code{reftex-ref-style-default-list} should be | ||
| 1688 | customized. This variable specifies the list of styles to be activated. | ||
| 1689 | It can also be set as a file variable if the preference should be set | ||
| 1690 | for a specific file. | ||
| 1691 | |||
| 1692 | @vindex reftex-ref-style-alist | ||
| 1693 | In case the built-in styles do not suffice, you can add additional | ||
| 1694 | macros and styles to the variable @code{reftex-ref-style-alist}. Those | ||
| 1695 | do not necessarily have to be related to a certain @LaTeX{} package but | ||
| 1696 | can follow an arbitrary grouping rule. For example you could define a | ||
| 1697 | style called ``Personal'' for your personal referencing macros. (When | ||
| 1698 | changing the variable you should be aware that other Emacs packages, | ||
| 1699 | like @AUCTeX{}, might rely on the entries from the default value to be | ||
| 1700 | present.) | ||
| 1701 | |||
| 1702 | Once a style is active the macros it relates to are available for | ||
| 1703 | selection when you are about to insert a reference. In general this | ||
| 1704 | process involves three steps: the selection of a reference macro, a | ||
| 1705 | label type and a label. Reference macros can be chosen in the first and | ||
| 1706 | last step. | ||
| 1707 | |||
| 1708 | @vindex reftex-ref-macro-prompt | ||
| 1709 | In the first step you will be presented with a list of macros from which | ||
| 1710 | you can select one by typing a single key. If you dislike having an | ||
| 1711 | extra step for reference macro selection, you can disable it by | ||
| 1712 | customizing @code{reftex-ref-macro-prompt} and relying only on the | ||
| 1713 | selection facilities provided in the last step. | ||
| 1714 | |||
| 1715 | In the last step, i.e. the label selection, two key bindings are | ||
| 1716 | provided to set the reference macro. Type @key{v} in order to cycle | ||
| 1717 | forward through the list of available macros or @key{V} to cycle | ||
| 1718 | backward. The mode line of the selection buffer shows the macro | ||
| 1719 | currently selected. | ||
| 1720 | |||
| 1721 | In case you are not satisfied with the order of macros when cycling | ||
| 1722 | through them you should adapt the order of entries in the variable | ||
| 1723 | @code{reftex-ref-style-alist} to fit your liking. | ||
| 1724 | |||
| 1725 | For each entry in @code{reftex-ref-style-alist} a function with the name | ||
| 1726 | @code{reftex-<package>-<macro>} (e.g. @code{reftex-varioref-vref}) will | ||
| 1727 | be created automatically by @RefTeX{}. These functions can be used | ||
| 1728 | instead of @kbd{C-c )} and provide an alternative way of having your | ||
| 1729 | favorite referencing macro preselected and if cycling through the macros | ||
| 1730 | seems inconvenient to you.@footnote{You could e.g. bind | ||
| 1731 | @code{reftex-varioref-vref} to @kbd{C-c v} and | ||
| 1732 | @code{reftex-fancyref-fref} to @kbd{C-c f}.} | ||
| 1733 | |||
| 1734 | @cindex @code{varioref}, LaTeX package | ||
| 1735 | @cindex LaTeX packages, @code{varioref} | ||
| 1736 | @cindex @code{fancyref}, LaTeX package | ||
| 1737 | @cindex LaTeX packages, @code{fancyref} | ||
| 1738 | @vindex reftex-vref-is-default (deprecated) | ||
| 1739 | @vindex reftex-fref-is-default (deprecated) | ||
| 1740 | In former versions of @RefTeX{} only support for @code{varioref} and | ||
| 1741 | @code{fancyref} was included. @code{varioref} is a @LaTeX{} package to | ||
| 1742 | create cross-references with page information. @code{fancyref} is a | ||
| 1743 | package where a macro call like @code{\fref@{@var{fig:map-of-germany}@}} | ||
| 1744 | creates not only the number of the referenced counter but also the | ||
| 1745 | complete text around it, like @samp{Figure 3 on the preceding page}. In | ||
| 1746 | order to make it work you need to use label prefixes like @samp{fig:} | ||
| 1747 | consistently -- something @RefTeX{} does automatically. For each of | ||
| 1748 | these packages a variable could be configured to make its macros to take | ||
| 1749 | precedence over @code{\ref}. Those were @code{reftex-vref-is-default} | ||
| 1750 | and @code{reftex-fref-is-default} respectively. While still working, | ||
| 1751 | these variables are deprecated now. Instead of setting them, the | ||
| 1752 | variable @code{reftex-ref-style-default-list} should be adapted now. | ||
| 1753 | |||
| 1754 | @node xr (LaTeX package), , Reference Styles, Labels and References | ||
| 1584 | @section @code{xr}: Cross-Document References | 1755 | @section @code{xr}: Cross-Document References |
| 1585 | @cindex @code{xr}, LaTeX package | 1756 | @cindex @code{xr}, LaTeX package |
| 1586 | @cindex LaTeX packages, @code{xr} | 1757 | @cindex LaTeX packages, @code{xr} |
| @@ -1589,7 +1760,7 @@ information. | |||
| 1589 | @cindex References to external documents | 1760 | @cindex References to external documents |
| 1590 | @cindex Cross-document references | 1761 | @cindex Cross-document references |
| 1591 | 1762 | ||
| 1592 | The LaTeX package @code{xr} makes it possible to create references to | 1763 | The @LaTeX{} package @code{xr} makes it possible to create references to |
| 1593 | labels defined in external documents. The preamble of a document using | 1764 | labels defined in external documents. The preamble of a document using |
| 1594 | @code{xr} will contain something like this: | 1765 | @code{xr} will contain something like this: |
| 1595 | 1766 | ||
| @@ -1604,66 +1775,26 @@ and we can make references to any labels defined in these | |||
| 1604 | external documents by using the prefixes @samp{V1-} and @samp{V3-}, | 1775 | external documents by using the prefixes @samp{V1-} and @samp{V3-}, |
| 1605 | respectively. | 1776 | respectively. |
| 1606 | 1777 | ||
| 1607 | @b{Ref@TeX{}} can be used to create such references as well. Start the | 1778 | @RefTeX{} can be used to create such references as well. Start the |
| 1608 | referencing process normally, by pressing @kbd{C-c )}. Select a label | 1779 | referencing process normally, by pressing @kbd{C-c )}. Select a label |
| 1609 | type if necessary. When you see the label selection buffer, pressing | 1780 | type if necessary. When you see the label selection buffer, pressing |
| 1610 | @kbd{x} will switch to the label selection buffer of one of the external | 1781 | @kbd{x} will switch to the label selection buffer of one of the external |
| 1611 | documents. You may then select a label as before and @b{Ref@TeX{}} will | 1782 | documents. You may then select a label as before and @RefTeX{} will |
| 1612 | insert it along with the required prefix. | 1783 | insert it along with the required prefix. |
| 1613 | 1784 | ||
| 1614 | For this kind of inter-document cross-references, saving of parsing | 1785 | For this kind of inter-document cross-references, saving of parsing |
| 1615 | information and the use of multiple selection buffers can mean a large | 1786 | information and the use of multiple selection buffers can mean a large |
| 1616 | speed-up (@pxref{Optimizations}). | 1787 | speed-up (@pxref{Optimizations}). |
| 1617 | 1788 | ||
| 1618 | @node varioref (LaTeX package), fancyref (LaTeX package), xr (LaTeX package), Labels and References | ||
| 1619 | @section @code{varioref}: Variable Page References | ||
| 1620 | @cindex @code{varioref}, LaTeX package | ||
| 1621 | @cindex @code{\vref} | ||
| 1622 | @cindex LaTeX packages, @code{varioref} | ||
| 1623 | @vindex reftex-vref-is-default | ||
| 1624 | @code{varioref} is a frequently used LaTeX package to create | ||
| 1625 | cross--references with page information. When you want to make a | ||
| 1626 | reference with the @code{\vref} macro, just press the @kbd{v} key in the | ||
| 1627 | selection buffer to toggle between @code{\ref} and @code{\vref} | ||
| 1628 | (@pxref{Referencing Labels}). The mode line of the selection buffer | ||
| 1629 | shows the current status of this switch. If you find that you almost | ||
| 1630 | always use @code{\vref}, you may want to make it the default by | ||
| 1631 | customizing the variable @code{reftex-vref-is-default}. If this | ||
| 1632 | toggling seems too inconvenient, you can also use the command | ||
| 1633 | @code{reftex-varioref-vref}@footnote{bind it to @kbd{C-c v}.}. | ||
| 1634 | Or use AUCTeX to create your macros (@pxref{AUCTeX}). | ||
| 1635 | |||
| 1636 | @node fancyref (LaTeX package), , varioref (LaTeX package), Labels and References | ||
| 1637 | @section @code{fancyref}: Fancy Cross References | ||
| 1638 | @cindex @code{fancyref}, LaTeX package | ||
| 1639 | @cindex @code{\fref} | ||
| 1640 | @cindex @code{\Fref} | ||
| 1641 | @cindex LaTeX packages, @code{fancyref} | ||
| 1642 | @vindex reftex-fref-is-default | ||
| 1643 | @code{fancyref} is a LaTeX package where a macro call like | ||
| 1644 | @code{\fref@{@var{fig:map-of-germany}@}} creates not only the number of | ||
| 1645 | the referenced counter but also the complete text around it, like | ||
| 1646 | @samp{Figure 3 on the preceding page}. In order to make it work you | ||
| 1647 | need to use label prefixes like @samp{fig:} consistently - something | ||
| 1648 | @b{Ref@TeX{}} does automatically. When you want to make a reference | ||
| 1649 | with the @code{\fref} macro, just press the @kbd{V} key in the selection | ||
| 1650 | buffer to cycle between @code{\ref}, @code{\fref} and @code{\Fref} | ||
| 1651 | (@pxref{Referencing Labels}). The mode line of the selection buffer | ||
| 1652 | shows the current status of this switch. If this cycling seems | ||
| 1653 | inconvenient, you can also use the commands @code{reftex-fancyref-fref} | ||
| 1654 | and @code{reftex-fancyref-Fref}@footnote{bind them to @kbd{C-c | ||
| 1655 | f} and @kbd{C-c F}.}. Or use AUCTeX to create your macros | ||
| 1656 | (@pxref{AUCTeX}). | ||
| 1657 | |||
| 1658 | @node Citations, Index Support, Labels and References, Top | 1789 | @node Citations, Index Support, Labels and References, Top |
| 1659 | @chapter Citations | 1790 | @chapter Citations |
| 1660 | @cindex Citations | 1791 | @cindex Citations |
| 1661 | @cindex @code{\cite} | 1792 | @cindex @code{\cite} |
| 1662 | 1793 | ||
| 1663 | Citations in LaTeX are done with the @code{\cite} macro or variations of | 1794 | Citations in @LaTeX{} are done with the @code{\cite} macro or variations of |
| 1664 | it. The argument of the macro is a citation key which identifies an | 1795 | it. The argument of the macro is a citation key which identifies an |
| 1665 | article or book in either a BibTeX database file or in an explicit | 1796 | article or book in either a @BibTeX{} database file or in an explicit |
| 1666 | @code{thebibliography} environment in the document. @b{Ref@TeX{}}'s | 1797 | @code{thebibliography} environment in the document. @RefTeX{}'s |
| 1667 | support for citations helps to select the correct key quickly. | 1798 | support for citations helps to select the correct key quickly. |
| 1668 | 1799 | ||
| 1669 | @menu | 1800 | @menu |
| @@ -1684,7 +1815,7 @@ support for citations helps to select the correct key quickly. | |||
| 1684 | @cindex Selection buffer, citations | 1815 | @cindex Selection buffer, citations |
| 1685 | @cindex Selection process | 1816 | @cindex Selection process |
| 1686 | 1817 | ||
| 1687 | In order to create a citation, press @kbd{C-c [}. @b{Ref@TeX{}} then | 1818 | In order to create a citation, press @kbd{C-c [}. @RefTeX{} then |
| 1688 | prompts for a regular expression which will be used to search through | 1819 | prompts for a regular expression which will be used to search through |
| 1689 | the database and present the list of matches to choose from in a | 1820 | the database and present the list of matches to choose from in a |
| 1690 | selection process similar to that for selecting labels | 1821 | selection process similar to that for selecting labels |
| @@ -1695,8 +1826,8 @@ logic @code{and} for regular expressions. For example | |||
| 1695 | @samp{Einstein&&Bose} will match all articles which mention | 1826 | @samp{Einstein&&Bose} will match all articles which mention |
| 1696 | Bose-Einstein condensation, or which are co-authored by Bose and | 1827 | Bose-Einstein condensation, or which are co-authored by Bose and |
| 1697 | Einstein. When entering the regular expression, you can complete on | 1828 | Einstein. When entering the regular expression, you can complete on |
| 1698 | known citation keys. RefTeX also offers a default when prompting for a | 1829 | known citation keys. @RefTeX{} also offers a default when prompting for |
| 1699 | regular expression. This default is the word before the cursor or the | 1830 | a regular expression. This default is the word before the cursor or the |
| 1700 | word before the current @samp{\cite} command. Sometimes this may be a | 1831 | word before the current @samp{\cite} command. Sometimes this may be a |
| 1701 | good search key. | 1832 | good search key. |
| 1702 | 1833 | ||
| @@ -1704,16 +1835,16 @@ good search key. | |||
| 1704 | @cindex @code{thebibliography}, LaTeX environment | 1835 | @cindex @code{thebibliography}, LaTeX environment |
| 1705 | @cindex @code{BIBINPUTS}, environment variable | 1836 | @cindex @code{BIBINPUTS}, environment variable |
| 1706 | @cindex @code{TEXBIB}, environment variable | 1837 | @cindex @code{TEXBIB}, environment variable |
| 1707 | @b{Ref@TeX{}} prefers to use BibTeX database files specified with a | 1838 | @RefTeX{} prefers to use @BibTeX{} database files specified with a |
| 1708 | @code{\bibliography} macro to collect its information. Just like | 1839 | @code{\bibliography} macro to collect its information. Just like |
| 1709 | BibTeX, it will search for the specified files in the current directory | 1840 | @BibTeX{}, it will search for the specified files in the current directory |
| 1710 | and along the path given in the environment variable @code{BIBINPUTS}. | 1841 | and along the path given in the environment variable @code{BIBINPUTS}. |
| 1711 | If you do not use BibTeX, but the document contains an explicit | 1842 | If you do not use @BibTeX{}, but the document contains an explicit |
| 1712 | @code{thebibliography} environment, @b{Ref@TeX{}} will collect its | 1843 | @code{thebibliography} environment, @RefTeX{} will collect its |
| 1713 | information from there. Note that in this case the information | 1844 | information from there. Note that in this case the information |
| 1714 | presented in the selection buffer will just be a copy of relevant | 1845 | presented in the selection buffer will just be a copy of relevant |
| 1715 | @code{\bibitem} entries, not the structured listing available with | 1846 | @code{\bibitem} entries, not the structured listing available with |
| 1716 | BibTeX database files. | 1847 | @BibTeX{} database files. |
| 1717 | 1848 | ||
| 1718 | @kindex ? | 1849 | @kindex ? |
| 1719 | In the selection buffer, the following keys provide special commands. A | 1850 | In the selection buffer, the following keys provide special commands. A |
| @@ -1743,7 +1874,7 @@ another window. See also the @kbd{f} key. | |||
| 1743 | @item f | 1874 | @item f |
| 1744 | Toggle follow mode. When follow mode is active, the other window will | 1875 | Toggle follow mode. When follow mode is active, the other window will |
| 1745 | always display the full database entry of the current article. This is | 1876 | always display the full database entry of the current article. This is |
| 1746 | equivalent to pressing @key{SPC} after each cursor motion. With BibTeX | 1877 | equivalent to pressing @key{SPC} after each cursor motion. With @BibTeX{} |
| 1747 | entries, follow mode can be rather slow. | 1878 | entries, follow mode can be rather slow. |
| 1748 | 1879 | ||
| 1749 | @tablesubheading{Selecting entries and creating the citation} | 1880 | @tablesubheading{Selecting entries and creating the citation} |
| @@ -1774,12 +1905,12 @@ Accept all (marked) entries in the selection buffer and create a | |||
| 1774 | separate @code{\cite} macro for each of it. | 1905 | separate @code{\cite} macro for each of it. |
| 1775 | 1906 | ||
| 1776 | @item e | 1907 | @item e |
| 1777 | Create a new BibTeX database file which contains all @i{marked} entries | 1908 | Create a new @BibTeX{} database file which contains all @i{marked} entries |
| 1778 | in the selection buffer. If no entries are marked, all entries are | 1909 | in the selection buffer. If no entries are marked, all entries are |
| 1779 | selected. | 1910 | selected. |
| 1780 | 1911 | ||
| 1781 | @item E | 1912 | @item E |
| 1782 | Create a new BibTeX database file which contains all @i{unmarked} | 1913 | Create a new @BibTeX{} database file which contains all @i{unmarked} |
| 1783 | entries in the selection buffer. If no entries are marked, all entries | 1914 | entries in the selection buffer. If no entries are marked, all entries |
| 1784 | are selected. | 1915 | are selected. |
| 1785 | 1916 | ||
| @@ -1814,6 +1945,17 @@ entries. | |||
| 1814 | In order to define additional commands for this selection process, the | 1945 | In order to define additional commands for this selection process, the |
| 1815 | keymap @code{reftex-select-bib-map} may be used. | 1946 | keymap @code{reftex-select-bib-map} may be used. |
| 1816 | 1947 | ||
| 1948 | Note that if you do not use Emacs to edit the @BibTeX{} database files, | ||
| 1949 | @RefTeX{} will ask if the related buffers should be updated once it | ||
| 1950 | detects that the files were changed externally. If you do not want to | ||
| 1951 | be bothered by such queries, you can activate Auto Revert mode for these | ||
| 1952 | buffers by adding the following expression to your init file: | ||
| 1953 | |||
| 1954 | @lisp | ||
| 1955 | (add-hook 'bibtex-mode-hook 'turn-on-auto-revert-mode) | ||
| 1956 | @end lisp | ||
| 1957 | |||
| 1958 | |||
| 1817 | @node Citation Styles, Citation Info, Creating Citations, Citations | 1959 | @node Citation Styles, Citation Info, Creating Citations, Citations |
| 1818 | @section Citation Styles | 1960 | @section Citation Styles |
| 1819 | @cindex Citation styles | 1961 | @cindex Citation styles |
| @@ -1821,20 +1963,22 @@ keymap @code{reftex-select-bib-map} may be used. | |||
| 1821 | @cindex Citation styles, @code{harvard} | 1963 | @cindex Citation styles, @code{harvard} |
| 1822 | @cindex Citation styles, @code{chicago} | 1964 | @cindex Citation styles, @code{chicago} |
| 1823 | @cindex Citation styles, @code{jurabib} | 1965 | @cindex Citation styles, @code{jurabib} |
| 1966 | @cindex Citation styles, @ConTeXt{} | ||
| 1824 | @cindex @code{natbib}, citation style | 1967 | @cindex @code{natbib}, citation style |
| 1825 | @cindex @code{harvard}, citation style | 1968 | @cindex @code{harvard}, citation style |
| 1826 | @cindex @code{chicago}, citation style | 1969 | @cindex @code{chicago}, citation style |
| 1827 | @cindex @code{jurabib}, citation style | 1970 | @cindex @code{jurabib}, citation style |
| 1971 | @cindex @ConTeXt{}, citation style | ||
| 1828 | 1972 | ||
| 1829 | @vindex reftex-cite-format | 1973 | @vindex reftex-cite-format |
| 1830 | The standard LaTeX macro @code{\cite} works well with numeric or simple | 1974 | The standard @LaTeX{} macro @code{\cite} works well with numeric or |
| 1831 | key citations. To deal with the more complex task of author-year | 1975 | simple key citations. To deal with the more complex task of author-year |
| 1832 | citations as used in many natural sciences, a variety of packages has | 1976 | citations as used in many natural sciences, a variety of packages has |
| 1833 | been developed which define derived forms of the @code{\cite} macro. | 1977 | been developed which define derived forms of the @code{\cite} macro. |
| 1834 | @b{Ref@TeX{}} can be configured to produce these citation macros as well | 1978 | @RefTeX{} can be configured to produce these citation macros as well by |
| 1835 | by setting the variable @code{reftex-cite-format}. For the most | 1979 | setting the variable @code{reftex-cite-format}. For the most commonly |
| 1836 | commonly used packages (@code{natbib}, @code{harvard}, @code{chicago}, | 1980 | used @LaTeX{} packages (@code{natbib}, @code{harvard}, @code{chicago}, |
| 1837 | @code{jurabib}) this may be done from the menu, under | 1981 | @code{jurabib}) and for @ConTeXt{} this may be done from the menu, under |
| 1838 | @code{Ref->Citation Styles}. Since there are usually several macros to | 1982 | @code{Ref->Citation Styles}. Since there are usually several macros to |
| 1839 | create the citations, executing @code{reftex-citation} (@kbd{C-c [}) | 1983 | create the citations, executing @code{reftex-citation} (@kbd{C-c [}) |
| 1840 | starts by prompting for the correct macro. For the Natbib style, this | 1984 | starts by prompting for the correct macro. For the Natbib style, this |
| @@ -1856,7 +2000,7 @@ SELECT A CITATION FORMAT | |||
| 1856 | @end example | 2000 | @end example |
| 1857 | 2001 | ||
| 1858 | @vindex reftex-cite-prompt-optional-args | 2002 | @vindex reftex-cite-prompt-optional-args |
| 1859 | If cite formats contain empty paris of square brackets, RefTeX can | 2003 | If citation formats contain empty pairs of square brackets, @RefTeX{} |
| 1860 | will prompt for values of these optional arguments if you call the | 2004 | will prompt for values of these optional arguments if you call the |
| 1861 | @code{reftex-citation} command with a @kbd{C-u} prefix. | 2005 | @code{reftex-citation} command with a @kbd{C-u} prefix. |
| 1862 | Following the most generic of these packages, @code{natbib}, the builtin | 2006 | Following the most generic of these packages, @code{natbib}, the builtin |
| @@ -1872,12 +2016,12 @@ To make one of these styles the default, customize the variable | |||
| 1872 | (setq reftex-cite-format 'natbib) | 2016 | (setq reftex-cite-format 'natbib) |
| 1873 | @end lisp | 2017 | @end lisp |
| 1874 | 2018 | ||
| 1875 | You can also use AUCTeX style files to automatically set the | 2019 | You can also use @AUCTeX{} style files to automatically set the |
| 1876 | citation style based on the @code{usepackage} commands in a given | 2020 | citation style based on the @code{usepackage} commands in a given |
| 1877 | document. @xref{Style Files}, for information on how to set up the style | 2021 | document. @xref{Style Files}, for information on how to set up the style |
| 1878 | files correctly. | 2022 | files correctly. |
| 1879 | 2023 | ||
| 1880 | @node Citation Info, Chapterbib and Bibunits, Citation Styles, Citations, Top | 2024 | @node Citation Info, Chapterbib and Bibunits, Citation Styles, Citations |
| 1881 | @section Citation Info | 2025 | @section Citation Info |
| 1882 | @cindex Displaying citations | 2026 | @cindex Displaying citations |
| 1883 | @cindex Citations, displaying | 2027 | @cindex Citations, displaying |
| @@ -1893,9 +2037,9 @@ argument of a @code{\cite} macro, the echo area will display some | |||
| 1893 | information about the article cited there. Note that the information is | 2037 | information about the article cited there. Note that the information is |
| 1894 | only displayed if the echo area is not occupied by a different message. | 2038 | only displayed if the echo area is not occupied by a different message. |
| 1895 | 2039 | ||
| 1896 | @b{Ref@TeX{}} can also display the @code{\bibitem} or BibTeX database | 2040 | @RefTeX{} can also display the @code{\bibitem} or @BibTeX{} database |
| 1897 | entry corresponding to a @code{\cite} macro, or all citation locations | 2041 | entry corresponding to a @code{\cite} macro, or all citation locations |
| 1898 | corresponding to a @code{\bibitem} or BibTeX database entry. | 2042 | corresponding to a @code{\bibitem} or @BibTeX{} database entry. |
| 1899 | @xref{Viewing Cross-References}. | 2043 | @xref{Viewing Cross-References}. |
| 1900 | 2044 | ||
| 1901 | @node Chapterbib and Bibunits, Citations Outside LaTeX, Citation Info, Citations | 2045 | @node Chapterbib and Bibunits, Citations Outside LaTeX, Citation Info, Citations |
| @@ -1904,24 +2048,24 @@ corresponding to a @code{\bibitem} or BibTeX database entry. | |||
| 1904 | @cindex @code{bibunits}, LaTeX package | 2048 | @cindex @code{bibunits}, LaTeX package |
| 1905 | @cindex Bibliographies, multiple | 2049 | @cindex Bibliographies, multiple |
| 1906 | 2050 | ||
| 1907 | @code{chapterbib} and @code{bibunits} are two LaTeX packages which | 2051 | @code{chapterbib} and @code{bibunits} are two @LaTeX{} packages which |
| 1908 | produce multiple bibliographies in a document. This is no problem for | 2052 | produce multiple bibliographies in a document. This is no problem for |
| 1909 | @b{Ref@TeX{}} as long as all bibliographies use the same BibTeX database | 2053 | @RefTeX{} as long as all bibliographies use the same @BibTeX{} database |
| 1910 | files. If they do not, it is best to have each document part in a | 2054 | files. If they do not, it is best to have each document part in a |
| 1911 | separate file (as it is required for @code{chapterbib} anyway). Then | 2055 | separate file (as it is required for @code{chapterbib} anyway). Then |
| 1912 | @b{Ref@TeX{}} will still scan the locally relevant databases correctly. If | 2056 | @RefTeX{} will still scan the locally relevant databases correctly. If |
| 1913 | you have multiple bibliographies within a @emph{single file}, this may | 2057 | you have multiple bibliographies within a @emph{single file}, this may |
| 1914 | or may not be the case. | 2058 | or may not be the case. |
| 1915 | 2059 | ||
| 1916 | @node Citations Outside LaTeX, BibTeX Database Subsets, Chapterbib and Bibunits, Citations | 2060 | @node Citations Outside LaTeX, BibTeX Database Subsets, Chapterbib and Bibunits, Citations |
| 1917 | @section Citations outside LaTeX | 2061 | @section Citations outside @LaTeX{} |
| 1918 | @cindex Citations outside LaTeX | 2062 | @cindex Citations outside LaTeX |
| 1919 | @vindex reftex-default-bibliography | 2063 | @vindex reftex-default-bibliography |
| 1920 | 2064 | ||
| 1921 | The command @code{reftex-citation} can also be executed outside a LaTeX | 2065 | The command @code{reftex-citation} can also be executed outside a @LaTeX{} |
| 1922 | buffer. This can be useful to reference articles in the mail buffer and | 2066 | buffer. This can be useful to reference articles in the mail buffer and |
| 1923 | other documents. You should @emph{not} enter @code{reftex-mode} for | 2067 | other documents. You should @emph{not} enter @code{reftex-mode} for |
| 1924 | this, just execute the command. The list of BibTeX files will in this | 2068 | this, just execute the command. The list of @BibTeX{} files will in this |
| 1925 | case be taken from the variable @code{reftex-default-bibliography}. | 2069 | case be taken from the variable @code{reftex-default-bibliography}. |
| 1926 | Setting the variable @code{reftex-cite-format} to the symbol | 2070 | Setting the variable @code{reftex-cite-format} to the symbol |
| 1927 | @code{locally} does a decent job of putting all relevant information | 2071 | @code{locally} does a decent job of putting all relevant information |
| @@ -1943,24 +2087,24 @@ binding for @code{reftex-cite-format}. | |||
| 1943 | @cindex BibTeX database subsets | 2087 | @cindex BibTeX database subsets |
| 1944 | @findex reftex-create-bibtex-file | 2088 | @findex reftex-create-bibtex-file |
| 1945 | 2089 | ||
| 1946 | @b{Ref@TeX{}} offers two ways to create a new BibTeX database file. | 2090 | @RefTeX{} offers two ways to create a new @BibTeX{} database file. |
| 1947 | 2091 | ||
| 1948 | The first option produces a file which contains only the entries | 2092 | The first option produces a file which contains only the entries |
| 1949 | actually referenced in the current document. This can be useful if | 2093 | actually referenced in the current document. This can be useful if |
| 1950 | the database in only meant for a single document and you want to clean | 2094 | the database is only meant for a single document and you want to clean |
| 1951 | it of old and unused ballast. It can also be useful while writing a | 2095 | it of old and unused ballast. It can also be useful while writing a |
| 1952 | document together with collaborators, in order to avoid sending around | 2096 | document together with collaborators, in order to avoid sending around |
| 1953 | the entire (possibly very large) database. To create the file, use | 2097 | the entire (possibly very large) database. To create the file, use |
| 1954 | @kbd{M-x reftex-create-bibtex-file}, also available from the menu | 2098 | @kbd{M-x reftex-create-bibtex-file}, also available from the menu |
| 1955 | under @code{Ref->Global Actions->Create Bibtex File}. The command will | 2099 | under @code{Ref->Global Actions->Create Bibtex File}. The command will |
| 1956 | prompt for a BibTeX file name and write the extracted entries to that | 2100 | prompt for a @BibTeX{} file name and write the extracted entries to that |
| 1957 | file. | 2101 | file. |
| 1958 | 2102 | ||
| 1959 | The second option makes use of the selection process started by the | 2103 | The second option makes use of the selection process started by the |
| 1960 | command @kbd{C-c [} (@pxref{Creating Citations}). This command uses a | 2104 | command @kbd{C-c [} (@pxref{Creating Citations}). This command uses a |
| 1961 | regular expression to select entries, and lists them in a formatted | 2105 | regular expression to select entries, and lists them in a formatted |
| 1962 | selection buffer. After pressing the @kbd{e} key (mnemonics: Export), | 2106 | selection buffer. After pressing the @kbd{e} key (mnemonics: Export), |
| 1963 | the command will prompt for the name of a new BibTeX file and write | 2107 | the command will prompt for the name of a new @BibTeX{} file and write |
| 1964 | the selected entries to that file. You can also first mark some | 2108 | the selected entries to that file. You can also first mark some |
| 1965 | entries in the selection buffer with the @kbd{m} key and then export | 2109 | entries in the selection buffer with the @kbd{m} key and then export |
| 1966 | either the @i{marked} entries (with the @kbd{e} key) or the | 2110 | either the @i{marked} entries (with the @kbd{e} key) or the |
| @@ -1971,15 +2115,15 @@ either the @i{marked} entries (with the @kbd{e} key) or the | |||
| 1971 | @cindex Index Support | 2115 | @cindex Index Support |
| 1972 | @cindex @code{\index} | 2116 | @cindex @code{\index} |
| 1973 | 2117 | ||
| 1974 | LaTeX has builtin support for creating an Index. The LaTeX core | 2118 | @LaTeX{} has builtin support for creating an Index. The @LaTeX{} core |
| 1975 | supports two different indices, the standard index and a glossary. With | 2119 | supports two different indices, the standard index and a glossary. With |
| 1976 | the help of special LaTeX packages (@file{multind.sty} or | 2120 | the help of special @LaTeX{} packages (@file{multind.sty} or |
| 1977 | @file{index.sty}), any number of indices can be supported. | 2121 | @file{index.sty}), any number of indices can be supported. |
| 1978 | 2122 | ||
| 1979 | Index entries are created with the @code{\index@{@var{entry}@}} macro. | 2123 | Index entries are created with the @code{\index@{@var{entry}@}} macro. |
| 1980 | All entries defined in a document are written out to the @file{.aux} | 2124 | All entries defined in a document are written out to the @file{.aux} |
| 1981 | file. A separate tool must be used to convert this information into a | 2125 | file. A separate tool must be used to convert this information into a |
| 1982 | nicely formatted index. Tools used with LaTeX include @code{MakeIndex} | 2126 | nicely formatted index. Tools used with @LaTeX{} include @code{MakeIndex} |
| 1983 | and @code{xindy}. | 2127 | and @code{xindy}. |
| 1984 | 2128 | ||
| 1985 | Indexing is a very difficult task. It must follow strict conventions to | 2129 | Indexing is a very difficult task. It must follow strict conventions to |
| @@ -1996,27 +2140,27 @@ correspond to appropriate index entries. This part of the index can | |||
| 1996 | very well be developed along with the document. Often it is worthwhile | 2140 | very well be developed along with the document. Often it is worthwhile |
| 1997 | to define special purpose macros which define an item and at the same | 2141 | to define special purpose macros which define an item and at the same |
| 1998 | time make an index entry, possibly with special formatting to make the | 2142 | time make an index entry, possibly with special formatting to make the |
| 1999 | reference page in the index bold or underlined. To make @b{Ref@TeX{}} | 2143 | reference page in the index bold or underlined. To make @RefTeX{} |
| 2000 | support for indexing possible, these special macros must be added to | 2144 | support for indexing possible, these special macros must be added to |
| 2001 | @b{Ref@TeX{}}'s configuration (@pxref{Defining Index Macros}). | 2145 | @RefTeX{}'s configuration (@pxref{Defining Index Macros}). |
| 2002 | 2146 | ||
| 2003 | @item | 2147 | @item |
| 2004 | The rest of the index is often just a collection of where in the | 2148 | The rest of the index is often just a collection of where in the |
| 2005 | document certain words or phrases are being used. This part is | 2149 | document certain words or phrases are being used. This part is |
| 2006 | difficult to develop along with the document, because consistent entries | 2150 | difficult to develop along with the document, because consistent entries |
| 2007 | for each occurrence are needed and are best selected when the document | 2151 | for each occurrence are needed and are best selected when the document |
| 2008 | is ready. @b{Ref@TeX{}} supports this with an @emph{index phrases file} | 2152 | is ready. @RefTeX{} supports this with an @emph{index phrases file} |
| 2009 | which collects phrases and helps indexing the phrases globally. | 2153 | which collects phrases and helps indexing the phrases globally. |
| 2010 | @end enumerate | 2154 | @end enumerate |
| 2011 | 2155 | ||
| 2012 | Before you start, you need to make sure that @b{Ref@TeX{}} knows about | 2156 | Before you start, you need to make sure that @RefTeX{} knows about |
| 2013 | the index style being used in the current document. @b{Ref@TeX{}} has | 2157 | the index style being used in the current document. @RefTeX{} has |
| 2014 | builtin support for the default @code{\index} and @code{\glossary} | 2158 | builtin support for the default @code{\index} and @code{\glossary} |
| 2015 | macros. Other LaTeX packages, like the @file{multind} or @file{index} | 2159 | macros. Other @LaTeX{} packages, like the @file{multind} or @file{index} |
| 2016 | package, redefine the @code{\index} macro to have an additional | 2160 | package, redefine the @code{\index} macro to have an additional |
| 2017 | argument, and @b{Ref@TeX{}} needs to be configured for those. A | 2161 | argument, and @RefTeX{} needs to be configured for those. A |
| 2018 | sufficiently new version of AUCTeX (9.10c or later) will do this | 2162 | sufficiently new version of @AUCTeX{} (9.10c or later) will do this |
| 2019 | automatically. If you really don't use AUCTeX (you should!), this | 2163 | automatically. If you really don't use @AUCTeX{} (you should!), this |
| 2020 | configuration needs to be done by hand with the menu (@code{Ref->Index | 2164 | configuration needs to be done by hand with the menu (@code{Ref->Index |
| 2021 | Style}), or globally for all your documents with | 2165 | Style}), or globally for all your documents with |
| 2022 | 2166 | ||
| @@ -2057,7 +2201,7 @@ When there is nothing selected and no word at point, this command will | |||
| 2057 | just call @code{reftex-index}, described below. | 2201 | just call @code{reftex-index}, described below. |
| 2058 | 2202 | ||
| 2059 | In order to create a general index entry, press @kbd{C-c <} | 2203 | In order to create a general index entry, press @kbd{C-c <} |
| 2060 | (@code{reftex-index}). @b{Ref@TeX{}} will prompt for one of the | 2204 | (@code{reftex-index}). @RefTeX{} will prompt for one of the |
| 2061 | available index macros and for its arguments. Completion will be | 2205 | available index macros and for its arguments. Completion will be |
| 2062 | available for the index entry and, if applicable, the index tag. The | 2206 | available for the index entry and, if applicable, the index tag. The |
| 2063 | index tag is a string identifying one of multiple indices. With the | 2207 | index tag is a string identifying one of multiple indices. With the |
| @@ -2072,7 +2216,7 @@ to the redefined @code{\index} macro. | |||
| 2072 | @findex reftex-index-visit-phrases-buffer | 2216 | @findex reftex-index-visit-phrases-buffer |
| 2073 | @cindex Macro definition lines, in phrase buffer | 2217 | @cindex Macro definition lines, in phrase buffer |
| 2074 | 2218 | ||
| 2075 | @b{Ref@TeX{}} maintains a file in which phrases can be collected for | 2219 | @RefTeX{} maintains a file in which phrases can be collected for |
| 2076 | later indexing. The file is located in the same directory as the master | 2220 | later indexing. The file is located in the same directory as the master |
| 2077 | file of the document and has the extension @file{.rip} (@b{R}eftex | 2221 | file of the document and has the extension @file{.rip} (@b{R}eftex |
| 2078 | @b{I}ndex @b{P}hrases). You can create or visit the file with @kbd{C-c | 2222 | @b{I}ndex @b{P}hrases). You can create or visit the file with @kbd{C-c |
| @@ -2080,7 +2224,7 @@ file of the document and has the extension @file{.rip} (@b{R}eftex | |||
| 2080 | is initialized by inserting a file header which contains the definition | 2224 | is initialized by inserting a file header which contains the definition |
| 2081 | of the available index macros. This list is initialized from | 2225 | of the available index macros. This list is initialized from |
| 2082 | @code{reftex-index-macros} (@pxref{Defining Index Macros}). You can | 2226 | @code{reftex-index-macros} (@pxref{Defining Index Macros}). You can |
| 2083 | edit the header as needed, but if you define new LaTeX indexing macros, | 2227 | edit the header as needed, but if you define new @LaTeX{} indexing macros, |
| 2084 | don't forget to add them to @code{reftex-index-macros} as well. Here is | 2228 | don't forget to add them to @code{reftex-index-macros} as well. Here is |
| 2085 | a phrase file header example: | 2229 | a phrase file header example: |
| 2086 | 2230 | ||
| @@ -2122,7 +2266,7 @@ Phrases for indexing can be collected while writing the document. The | |||
| 2122 | command @kbd{C-c \} (@code{reftex-index-phrase-selection-or-word}) | 2266 | command @kbd{C-c \} (@code{reftex-index-phrase-selection-or-word}) |
| 2123 | copies the current selection (if active) or the word near point into the | 2267 | copies the current selection (if active) or the word near point into the |
| 2124 | phrases buffer. It then selects this buffer, so that the phrase line | 2268 | phrases buffer. It then selects this buffer, so that the phrase line |
| 2125 | can be edited. To return to the LaTeX document, press @kbd{C-c C-c} | 2269 | can be edited. To return to the @LaTeX{} document, press @kbd{C-c C-c} |
| 2126 | (@code{reftex-index-phrases-save-and-return}). | 2270 | (@code{reftex-index-phrases-save-and-return}). |
| 2127 | 2271 | ||
| 2128 | You can also prepare the list of index phrases in a different way and | 2272 | You can also prepare the list of index phrases in a different way and |
| @@ -2131,7 +2275,7 @@ a word list of the document and remove all words which should not be | |||
| 2131 | indexed. | 2275 | indexed. |
| 2132 | 2276 | ||
| 2133 | The phrase lines in the phrase buffer must have a specific format. | 2277 | The phrase lines in the phrase buffer must have a specific format. |
| 2134 | @b{Ref@TeX{}} will use font-lock to indicate if a line has the proper | 2278 | @RefTeX{} will use font-lock to indicate if a line has the proper |
| 2135 | format. A phrase line looks like this: | 2279 | format. A phrase line looks like this: |
| 2136 | 2280 | ||
| 2137 | @example | 2281 | @example |
| @@ -2226,7 +2370,7 @@ region and @kbd{C-c C-a} on all phrase lines in the buffer. It is | |||
| 2226 | probably good to do indexing in small chunks since your concentration | 2370 | probably good to do indexing in small chunks since your concentration |
| 2227 | may not last long enough to do everything in one go. | 2371 | may not last long enough to do everything in one go. |
| 2228 | 2372 | ||
| 2229 | @b{Ref@TeX{}} will start at the first phrase line and search the phrase | 2373 | @RefTeX{} will start at the first phrase line and search the phrase |
| 2230 | globally in the whole document. At each match it will stop, compute the | 2374 | globally in the whole document. At each match it will stop, compute the |
| 2231 | replacement string and offer you the following choices@footnote{Windows | 2375 | replacement string and offer you the following choices@footnote{Windows |
| 2232 | users: Restrict yourself to the described keys during indexing. Pressing | 2376 | users: Restrict yourself to the described keys during indexing. Pressing |
| @@ -2275,9 +2419,9 @@ sentence, and even typos. You can always say @emph{no} at a match you | |||
| 2275 | do not like. | 2419 | do not like. |
| 2276 | @item Wrap Long Lines | 2420 | @item Wrap Long Lines |
| 2277 | Inserting index macros increases the line length. Turn this option on | 2421 | Inserting index macros increases the line length. Turn this option on |
| 2278 | to allow @b{Ref@TeX{}} to wrap long lines. | 2422 | to allow @RefTeX{} to wrap long lines. |
| 2279 | @item Skip Indexed Matches | 2423 | @item Skip Indexed Matches |
| 2280 | When this is on, @b{Ref@TeX{}} will at each match try to figure out if | 2424 | When this is on, @RefTeX{} will at each match try to figure out if |
| 2281 | this match is already indexed. A match is considered indexed if it is | 2425 | this match is already indexed. A match is considered indexed if it is |
| 2282 | either the argument of an index macro, or if an index macro is directly | 2426 | either the argument of an index macro, or if an index macro is directly |
| 2283 | (without whitespace separation) before or after the match. Index macros | 2427 | (without whitespace separation) before or after the match. Index macros |
| @@ -2289,7 +2433,7 @@ Even though indexing should be the last thing you do to a document, you | |||
| 2289 | are bound to make changes afterwards. Indexing then has to be applied | 2433 | are bound to make changes afterwards. Indexing then has to be applied |
| 2290 | to the changed regions. The command | 2434 | to the changed regions. The command |
| 2291 | @code{reftex-index-phrases-apply-to-region} is designed for this | 2435 | @code{reftex-index-phrases-apply-to-region} is designed for this |
| 2292 | purpose. When called from a LaTeX document with active region, it will | 2436 | purpose. When called from a @LaTeX{} document with active region, it will |
| 2293 | apply @code{reftex-index-all-phrases} to the current region. | 2437 | apply @code{reftex-index-all-phrases} to the current region. |
| 2294 | 2438 | ||
| 2295 | @node Displaying and Editing the Index, Builtin Index Macros, The Index Phrases File, Index Support | 2439 | @node Displaying and Editing the Index, Builtin Index Macros, The Index Phrases File, Index Support |
| @@ -2303,7 +2447,7 @@ apply @code{reftex-index-all-phrases} to the current region. | |||
| 2303 | @findex reftex-display-index | 2447 | @findex reftex-display-index |
| 2304 | 2448 | ||
| 2305 | In order to compile and display the index, press @kbd{C-c >}. If the | 2449 | In order to compile and display the index, press @kbd{C-c >}. If the |
| 2306 | document uses multiple indices, @b{Ref@TeX{}} will ask you to select | 2450 | document uses multiple indices, @RefTeX{} will ask you to select |
| 2307 | one. Then, all index entries will be sorted alphabetically and | 2451 | one. Then, all index entries will be sorted alphabetically and |
| 2308 | displayed in a special buffer, the @file{*Index*} buffer. From that | 2452 | displayed in a special buffer, the @file{*Index*} buffer. From that |
| 2309 | buffer you can check and edit each entry. | 2453 | buffer you can check and edit each entry. |
| @@ -2317,7 +2461,7 @@ region, make the region active and use a numeric prefix @samp{3} (press | |||
| 2317 | restriction can be moved from one section to the next by pressing the | 2461 | restriction can be moved from one section to the next by pressing the |
| 2318 | @kbd{<} and @kbd{>} keys. | 2462 | @kbd{<} and @kbd{>} keys. |
| 2319 | 2463 | ||
| 2320 | One caveat: @b{Ref@TeX{}} finds the definition point of an index entry | 2464 | One caveat: @RefTeX{} finds the definition point of an index entry |
| 2321 | by searching near the buffer position where it had found to macro during | 2465 | by searching near the buffer position where it had found to macro during |
| 2322 | scanning. If you have several identical index entries in the same | 2466 | scanning. If you have several identical index entries in the same |
| 2323 | buffer and significant changes have shifted the entries around, you must | 2467 | buffer and significant changes have shifted the entries around, you must |
| @@ -2371,7 +2515,7 @@ always show the location corresponding to the line in the @file{*Index*} | |||
| 2371 | buffer at point. This is similar to pressing @key{SPC} after each | 2515 | buffer at point. This is similar to pressing @key{SPC} after each |
| 2372 | cursor motion. The default for this flag can be set with the variable | 2516 | cursor motion. The default for this flag can be set with the variable |
| 2373 | @code{reftex-index-follow-mode}. Note that only context in files | 2517 | @code{reftex-index-follow-mode}. Note that only context in files |
| 2374 | already visited is shown. @b{Ref@TeX{}} will not visit a file just for | 2518 | already visited is shown. @RefTeX{} will not visit a file just for |
| 2375 | follow mode. See, however, the variable | 2519 | follow mode. See, however, the variable |
| 2376 | @code{reftex-revisit-to-follow}. | 2520 | @code{reftex-revisit-to-follow}. |
| 2377 | 2521 | ||
| @@ -2459,12 +2603,12 @@ will move to the correct position. | |||
| 2459 | 2603 | ||
| 2460 | @item r | 2604 | @item r |
| 2461 | @vindex reftex-enable-partial-scans | 2605 | @vindex reftex-enable-partial-scans |
| 2462 | Reparse the LaTeX document and rebuild the @file{*Index*} buffer. When | 2606 | Reparse the @LaTeX{} document and rebuild the @file{*Index*} buffer. When |
| 2463 | @code{reftex-enable-partial-scans} is non-@code{nil}, rescan only the file this | 2607 | @code{reftex-enable-partial-scans} is non-@code{nil}, rescan only the file this |
| 2464 | location is defined in, not the entire document. | 2608 | location is defined in, not the entire document. |
| 2465 | 2609 | ||
| 2466 | @item C-u r | 2610 | @item C-u r |
| 2467 | Reparse the @emph{entire} LaTeX document and rebuild the @file{*Index*} | 2611 | Reparse the @emph{entire} @LaTeX{} document and rebuild the @file{*Index*} |
| 2468 | buffer. | 2612 | buffer. |
| 2469 | 2613 | ||
| 2470 | @item s | 2614 | @item s |
| @@ -2483,8 +2627,8 @@ indices). | |||
| 2483 | @cindex LaTeX packages, @code{multind} | 2627 | @cindex LaTeX packages, @code{multind} |
| 2484 | @cindex LaTeX packages, @code{index} | 2628 | @cindex LaTeX packages, @code{index} |
| 2485 | 2629 | ||
| 2486 | @b{Ref@TeX{}} by default recognizes the @code{\index} and | 2630 | @RefTeX{} by default recognizes the @code{\index} and |
| 2487 | @code{\glossary} macros which are defined in the LaTeX core. It has | 2631 | @code{\glossary} macros which are defined in the @LaTeX{} core. It has |
| 2488 | also builtin support for the re-implementations of @code{\index} | 2632 | also builtin support for the re-implementations of @code{\index} |
| 2489 | in the @file{multind} and @file{index} packages. However, since | 2633 | in the @file{multind} and @file{index} packages. However, since |
| 2490 | the different definitions of the @code{\index} macro are incompatible, | 2634 | the different definitions of the @code{\index} macro are incompatible, |
| @@ -2513,7 +2657,7 @@ argument in the text and places it into a separate index with the tag | |||
| 2513 | @samp{name}@footnote{We are using the syntax of the @file{index} package | 2657 | @samp{name}@footnote{We are using the syntax of the @file{index} package |
| 2514 | here.}. The last macro also places its argument into the index, but as | 2658 | here.}. The last macro also places its argument into the index, but as |
| 2515 | subitems under the main index entry @samp{Astronomical Objects}. Here | 2659 | subitems under the main index entry @samp{Astronomical Objects}. Here |
| 2516 | is how to make @b{Ref@TeX{}} recognize and correctly interpret these | 2660 | is how to make @RefTeX{} recognize and correctly interpret these |
| 2517 | macros, first with Emacs Lisp. | 2661 | macros, first with Emacs Lisp. |
| 2518 | 2662 | ||
| 2519 | @lisp | 2663 | @lisp |
| @@ -2528,7 +2672,7 @@ Note that the index tag is @samp{idx} for the main index, and | |||
| 2528 | for the default index and for the glossary. | 2672 | for the default index and for the glossary. |
| 2529 | 2673 | ||
| 2530 | The character arguments @code{?x}, @code{?n}, and @code{?o} are for | 2674 | The character arguments @code{?x}, @code{?n}, and @code{?o} are for |
| 2531 | quick identification of these macros when @b{Ref@TeX{}} inserts new | 2675 | quick identification of these macros when @RefTeX{} inserts new |
| 2532 | index entries with @code{reftex-index}. These codes need to be | 2676 | index entries with @code{reftex-index}. These codes need to be |
| 2533 | unique. @code{?i}, @code{?I}, and @code{?g} are reserved for the | 2677 | unique. @code{?i}, @code{?I}, and @code{?g} are reserved for the |
| 2534 | @code{\index}, @code{\index*}, and @code{\glossary} macros, | 2678 | @code{\index}, @code{\index*}, and @code{\glossary} macros, |
| @@ -2589,22 +2733,22 @@ in the buffer with @kbd{C-c /} (@code{reftex-index-selection-or-word}). | |||
| 2589 | The index tag is "idx". | 2733 | The index tag is "idx". |
| 2590 | 2734 | ||
| 2591 | @node Viewing Cross-References, RefTeXs Menu, Index Support, Top | 2735 | @node Viewing Cross-References, RefTeXs Menu, Index Support, Top |
| 2592 | @chapter Viewing Cross--References | 2736 | @chapter Viewing Cross-References |
| 2593 | @findex reftex-view-crossref | 2737 | @findex reftex-view-crossref |
| 2594 | @findex reftex-mouse-view-crossref | 2738 | @findex reftex-mouse-view-crossref |
| 2595 | @kindex C-c & | 2739 | @kindex C-c & |
| 2596 | @kindex S-mouse-2 | 2740 | @kindex S-mouse-2 |
| 2597 | 2741 | ||
| 2598 | @b{Ref@TeX{}} can display cross--referencing information. This means, | 2742 | @RefTeX{} can display cross-referencing information. This means, |
| 2599 | if two document locations are linked, @b{Ref@TeX{}} can display the | 2743 | if two document locations are linked, @RefTeX{} can display the |
| 2600 | matching location(s) in another window. The @code{\label} and @code{\ref} | 2744 | matching location(s) in another window. The @code{\label} and @code{\ref} |
| 2601 | macros are one way of establishing such a link. Also, a @code{\cite} | 2745 | macros are one way of establishing such a link. Also, a @code{\cite} |
| 2602 | macro is linked to the corresponding @code{\bibitem} macro or a BibTeX | 2746 | macro is linked to the corresponding @code{\bibitem} macro or a @BibTeX{} |
| 2603 | database entry. | 2747 | database entry. |
| 2604 | 2748 | ||
| 2605 | The feature is invoked by pressing @kbd{C-c &} | 2749 | The feature is invoked by pressing @kbd{C-c &} |
| 2606 | (@code{reftex-view-crossref}) while point is on the @var{key} argument | 2750 | (@code{reftex-view-crossref}) while point is on the @var{key} argument |
| 2607 | of a macro involved in cross--referencing. You can also click with | 2751 | of a macro involved in cross-referencing. You can also click with |
| 2608 | @kbd{S-mouse-2} on the macro argument. Here is what will happen for | 2752 | @kbd{S-mouse-2} on the macro argument. Here is what will happen for |
| 2609 | individual classes of macros: | 2753 | individual classes of macros: |
| 2610 | 2754 | ||
| @@ -2615,7 +2759,7 @@ individual classes of macros: | |||
| 2615 | Display the corresponding label definition. All usual | 2759 | Display the corresponding label definition. All usual |
| 2616 | variants@footnote{all macros that start with @samp{ref} or end with | 2760 | variants@footnote{all macros that start with @samp{ref} or end with |
| 2617 | @samp{ref} or @samp{refrange}} of the @code{\ref} macro are active for | 2761 | @samp{ref} or @samp{refrange}} of the @code{\ref} macro are active for |
| 2618 | cross--reference display. This works also for labels defined in an | 2762 | cross-reference display. This works also for labels defined in an |
| 2619 | external document when the current document refers to them through the | 2763 | external document when the current document refers to them through the |
| 2620 | @code{xr} interface (@pxref{xr (LaTeX package)}). | 2764 | @code{xr} interface (@pxref{xr (LaTeX package)}). |
| 2621 | 2765 | ||
| @@ -2626,13 +2770,13 @@ Display a document location which references this label. Pressing | |||
| 2626 | @kbd{C-c &} several times moves through the entire document and finds | 2770 | @kbd{C-c &} several times moves through the entire document and finds |
| 2627 | all locations. Not only the @code{\label} macro but also other macros | 2771 | all locations. Not only the @code{\label} macro but also other macros |
| 2628 | with label arguments (as configured with @code{reftex-label-alist}) are | 2772 | with label arguments (as configured with @code{reftex-label-alist}) are |
| 2629 | active for cross--reference display. | 2773 | active for cross-reference display. |
| 2630 | 2774 | ||
| 2631 | @item @code{\cite} | 2775 | @item @code{\cite} |
| 2632 | @cindex @code{\cite} | 2776 | @cindex @code{\cite} |
| 2633 | Display the corresponding BibTeX database entry or @code{\bibitem}. | 2777 | Display the corresponding @BibTeX{} database entry or @code{\bibitem}. |
| 2634 | All usual variants@footnote{all macros that either start or end with | 2778 | All usual variants@footnote{all macros that either start or end with |
| 2635 | @samp{cite}} of the @code{\cite} macro are active for cross--reference | 2779 | @samp{cite}} of the @code{\cite} macro are active for cross-reference |
| 2636 | display. | 2780 | display. |
| 2637 | 2781 | ||
| 2638 | @item @code{\bibitem} | 2782 | @item @code{\bibitem} |
| @@ -2641,12 +2785,12 @@ Display a document location which cites this article. Pressing | |||
| 2641 | @kbd{C-c &} several times moves through the entire document and finds | 2785 | @kbd{C-c &} several times moves through the entire document and finds |
| 2642 | all locations. | 2786 | all locations. |
| 2643 | 2787 | ||
| 2644 | @item BibTeX | 2788 | @item @BibTeX{} |
| 2645 | @cindex BibTeX buffer, viewing cite locations from | 2789 | @cindex BibTeX buffer, viewing cite locations from |
| 2646 | @cindex Viewing cite locations from BibTeX buffer | 2790 | @cindex Viewing cite locations from BibTeX buffer |
| 2647 | @kbd{C-c &} is also active in BibTeX buffers. All locations in a | 2791 | @kbd{C-c &} is also active in @BibTeX{} buffers. All locations in a |
| 2648 | document where the database entry at point is cited will be displayed. | 2792 | document where the database entry at point is cited will be displayed. |
| 2649 | On first use, @b{Ref@TeX{}} will prompt for a buffer which belongs to | 2793 | On first use, @RefTeX{} will prompt for a buffer which belongs to |
| 2650 | the document you want to search. Subsequent calls will use the same | 2794 | the document you want to search. Subsequent calls will use the same |
| 2651 | document, until you break this link with a prefix argument to @kbd{C-c | 2795 | document, until you break this link with a prefix argument to @kbd{C-c |
| 2652 | &}. | 2796 | &}. |
| @@ -2661,7 +2805,7 @@ and @code{\glossary} macros, all macros configured in | |||
| 2661 | 2805 | ||
| 2662 | @vindex reftex-view-crossref-extra | 2806 | @vindex reftex-view-crossref-extra |
| 2663 | While the display of cross referencing information for the above | 2807 | While the display of cross referencing information for the above |
| 2664 | mentioned macros is hard--coded, you can configure additional relations | 2808 | mentioned macros is hard-coded, you can configure additional relations |
| 2665 | in the variable @code{reftex-view-crossref-extra}. | 2809 | in the variable @code{reftex-view-crossref-extra}. |
| 2666 | 2810 | ||
| 2667 | @iftex | 2811 | @iftex |
| @@ -2669,14 +2813,14 @@ in the variable @code{reftex-view-crossref-extra}. | |||
| 2669 | @end iftex | 2813 | @end iftex |
| 2670 | 2814 | ||
| 2671 | @node RefTeXs Menu, Key Bindings, Viewing Cross-References, Top | 2815 | @node RefTeXs Menu, Key Bindings, Viewing Cross-References, Top |
| 2672 | @section @b{Ref@TeX{}}'s Menu | 2816 | @section @RefTeX{}'s Menu |
| 2673 | @cindex RefTeXs Menu | 2817 | @cindex RefTeXs Menu |
| 2674 | @cindex Menu, in the menu bar | 2818 | @cindex Menu, in the menu bar |
| 2675 | 2819 | ||
| 2676 | @b{Ref@TeX{}} installs a @code{Ref} menu in the menu bar on systems | 2820 | @RefTeX{} installs a @code{Ref} menu in the menu bar on systems |
| 2677 | which support this. From this menu you can access all of | 2821 | which support this. From this menu you can access all of |
| 2678 | @b{Ref@TeX{}}'s commands and a few of its options. There is also a | 2822 | @RefTeX{}'s commands and a few of its options. There is also a |
| 2679 | @code{Customize} submenu which can be used to access @b{Ref@TeX{}}'s | 2823 | @code{Customize} submenu which can be used to access @RefTeX{}'s |
| 2680 | entire set of options. | 2824 | entire set of options. |
| 2681 | 2825 | ||
| 2682 | @node Key Bindings, Faces, RefTeXs Menu, Top | 2826 | @node Key Bindings, Faces, RefTeXs Menu, Top |
| @@ -2713,7 +2857,7 @@ Here is a summary of the available key bindings. | |||
| 2713 | @end example | 2857 | @end example |
| 2714 | 2858 | ||
| 2715 | Note that the @kbd{S-mouse-2} binding is only provided if this key is | 2859 | Note that the @kbd{S-mouse-2} binding is only provided if this key is |
| 2716 | not already used by some other package. @b{Ref@TeX{}} will not override an | 2860 | not already used by some other package. @RefTeX{} will not override an |
| 2717 | existing binding to @kbd{S-mouse-2}. | 2861 | existing binding to @kbd{S-mouse-2}. |
| 2718 | 2862 | ||
| 2719 | Personally, I also bind some functions in the users @kbd{C-c} map for | 2863 | Personally, I also bind some functions in the users @kbd{C-c} map for |
| @@ -2749,7 +2893,7 @@ default. If you want to have these key bindings available, set in your | |||
| 2749 | @end lisp | 2893 | @end lisp |
| 2750 | 2894 | ||
| 2751 | @vindex reftex-load-hook | 2895 | @vindex reftex-load-hook |
| 2752 | Changing and adding to @b{Ref@TeX{}}'s key bindings is best done in the hook | 2896 | Changing and adding to @RefTeX{}'s key bindings is best done in the hook |
| 2753 | @code{reftex-load-hook}. For information on the keymaps | 2897 | @code{reftex-load-hook}. For information on the keymaps |
| 2754 | which should be used to add keys, see @ref{Keymaps and Hooks}. | 2898 | which should be used to add keys, see @ref{Keymaps and Hooks}. |
| 2755 | 2899 | ||
| @@ -2757,9 +2901,9 @@ which should be used to add keys, see @ref{Keymaps and Hooks}. | |||
| 2757 | @section Faces | 2901 | @section Faces |
| 2758 | @cindex Faces | 2902 | @cindex Faces |
| 2759 | 2903 | ||
| 2760 | @b{Ref@TeX{}} uses faces when available to structure the selection and | 2904 | @RefTeX{} uses faces when available to structure the selection and |
| 2761 | table of contents buffers. It does not create its own faces, but uses | 2905 | table of contents buffers. It does not create its own faces, but uses |
| 2762 | the ones defined in @file{font-lock.el}. Therefore, @b{Ref@TeX{}} will | 2906 | the ones defined in @file{font-lock.el}. Therefore, @RefTeX{} will |
| 2763 | use faces only when @code{font-lock} is loaded. This seems to be | 2907 | use faces only when @code{font-lock} is loaded. This seems to be |
| 2764 | reasonable because people who like faces will very likely have it | 2908 | reasonable because people who like faces will very likely have it |
| 2765 | loaded. If you wish to turn off fontification or change the involved | 2909 | loaded. If you wish to turn off fontification or change the involved |
| @@ -2775,9 +2919,9 @@ files: | |||
| 2775 | 2919 | ||
| 2776 | @itemize @bullet | 2920 | @itemize @bullet |
| 2777 | @item | 2921 | @item |
| 2778 | @b{Ref@TeX{}} has full support for multifile documents. You can edit parts of | 2922 | @RefTeX{} has full support for multifile documents. You can edit parts of |
| 2779 | several (multifile) documents at the same time without conflicts. | 2923 | several (multifile) documents at the same time without conflicts. |
| 2780 | @b{Ref@TeX{}} provides functions to run @code{grep}, @code{search} and | 2924 | @RefTeX{} provides functions to run @code{grep}, @code{search} and |
| 2781 | @code{query-replace} on all files which are part of a multifile | 2925 | @code{query-replace} on all files which are part of a multifile |
| 2782 | document. | 2926 | document. |
| 2783 | 2927 | ||
| @@ -2785,10 +2929,10 @@ document. | |||
| 2785 | @vindex tex-main-file | 2929 | @vindex tex-main-file |
| 2786 | @vindex TeX-master | 2930 | @vindex TeX-master |
| 2787 | All files belonging to a multifile document should define a File | 2931 | All files belonging to a multifile document should define a File |
| 2788 | Variable (@code{TeX-master} for AUCTeX or @code{tex-main-file} for the | 2932 | Variable (@code{TeX-master} for @AUCTeX{} or @code{tex-main-file} for the |
| 2789 | standard Emacs LaTeX mode) containing the name of the master file. For | 2933 | standard Emacs @LaTeX{} mode) containing the name of the master file. For |
| 2790 | example, to set the file variable @code{TeX-master}, include something | 2934 | example, to set the file variable @code{TeX-master}, include something |
| 2791 | like the following at the end of each TeX file: | 2935 | like the following at the end of each @TeX{} file: |
| 2792 | 2936 | ||
| 2793 | @example | 2937 | @example |
| 2794 | %%% Local Variables: *** | 2938 | %%% Local Variables: *** |
| @@ -2797,7 +2941,7 @@ like the following at the end of each TeX file: | |||
| 2797 | %%% End: *** | 2941 | %%% End: *** |
| 2798 | @end example | 2942 | @end example |
| 2799 | 2943 | ||
| 2800 | AUCTeX with the setting | 2944 | @AUCTeX{} with the setting |
| 2801 | 2945 | ||
| 2802 | @lisp | 2946 | @lisp |
| 2803 | (setq-default TeX-master nil) | 2947 | (setq-default TeX-master nil) |
| @@ -2805,14 +2949,14 @@ AUCTeX with the setting | |||
| 2805 | 2949 | ||
| 2806 | will actually ask you for each new file about the master file and insert | 2950 | will actually ask you for each new file about the master file and insert |
| 2807 | this comment automatically. For more details see the documentation of | 2951 | this comment automatically. For more details see the documentation of |
| 2808 | the AUCTeX (@pxref{Multifile,,,auctex, The AUC TeX User Manual}), the | 2952 | the @AUCTeX{} (@pxref{Multifile,,,auctex, The AUCTeX User Manual}), the |
| 2809 | documentation about the Emacs (La)TeX mode (@pxref{TeX Print,,,emacs, | 2953 | documentation about the Emacs (La)TeX mode (@pxref{TeX Print,,,emacs, |
| 2810 | The GNU Emacs Manual}) and the Emacs documentation on File Variables | 2954 | The GNU Emacs Manual}) and the Emacs documentation on File Variables |
| 2811 | (@pxref{File Variables,,,emacs, The GNU Emacs Manual}). | 2955 | (@pxref{File Variables,,,emacs, The GNU Emacs Manual}). |
| 2812 | 2956 | ||
| 2813 | @item | 2957 | @item |
| 2814 | The context of a label definition must be found in the same file as the | 2958 | The context of a label definition must be found in the same file as the |
| 2815 | label itself in order to be processed correctly by @b{Ref@TeX{}}. The only | 2959 | label itself in order to be processed correctly by @RefTeX{}. The only |
| 2816 | exception is that section labels referring to a section statement | 2960 | exception is that section labels referring to a section statement |
| 2817 | outside the current file can still use that section title as | 2961 | outside the current file can still use that section title as |
| 2818 | context. | 2962 | context. |
| @@ -2822,7 +2966,7 @@ context. | |||
| 2822 | @section Language Support | 2966 | @section Language Support |
| 2823 | @cindex Language support | 2967 | @cindex Language support |
| 2824 | 2968 | ||
| 2825 | Some parts of @b{Ref@TeX{}} are language dependent. The default | 2969 | Some parts of @RefTeX{} are language dependent. The default |
| 2826 | settings work well for English. If you are writing in a different | 2970 | settings work well for English. If you are writing in a different |
| 2827 | language, the following hints may be useful: | 2971 | language, the following hints may be useful: |
| 2828 | 2972 | ||
| @@ -2838,7 +2982,7 @@ to be changed for other languages. See the variables | |||
| 2838 | @item | 2982 | @item |
| 2839 | @vindex reftex-translate-to-ascii-function | 2983 | @vindex reftex-translate-to-ascii-function |
| 2840 | @vindex reftex-label-illegal-re | 2984 | @vindex reftex-label-illegal-re |
| 2841 | Also, when a label is derived from context, @b{Ref@TeX{}} clears the | 2985 | Also, when a label is derived from context, @RefTeX{} clears the |
| 2842 | context string from non-ASCII characters in order to make a valid label. | 2986 | context string from non-ASCII characters in order to make a valid label. |
| 2843 | If there should ever be a version of @TeX{} which allows extended | 2987 | If there should ever be a version of @TeX{} which allows extended |
| 2844 | characters @emph{in labels}, then we will have to look at the | 2988 | characters @emph{in labels}, then we will have to look at the |
| @@ -2846,7 +2990,7 @@ variables @code{reftex-translate-to-ascii-function} and | |||
| 2846 | @code{reftex-label-illegal-re}. | 2990 | @code{reftex-label-illegal-re}. |
| 2847 | 2991 | ||
| 2848 | @item | 2992 | @item |
| 2849 | When a label is referenced, @b{Ref@TeX{}} looks at the word before point | 2993 | When a label is referenced, @RefTeX{} looks at the word before point |
| 2850 | to guess which label type is required. These @emph{magic words} are | 2994 | to guess which label type is required. These @emph{magic words} are |
| 2851 | different in every language. For an example of how to add magic words, | 2995 | different in every language. For an example of how to add magic words, |
| 2852 | see @ref{Adding Magic Words}. | 2996 | see @ref{Adding Magic Words}. |
| @@ -2854,7 +2998,7 @@ see @ref{Adding Magic Words}. | |||
| 2854 | @vindex reftex-multiref-punctuation | 2998 | @vindex reftex-multiref-punctuation |
| 2855 | @vindex reftex-cite-punctuation | 2999 | @vindex reftex-cite-punctuation |
| 2856 | @item | 3000 | @item |
| 2857 | @b{Ref@TeX{}} inserts ``punctuation'' for multiple references and | 3001 | @RefTeX{} inserts ``punctuation'' for multiple references and |
| 2858 | for the author list in citations. Some of this may be language | 3002 | for the author list in citations. Some of this may be language |
| 2859 | dependent. See the variables @code{reftex-multiref-punctuation} and | 3003 | dependent. See the variables @code{reftex-multiref-punctuation} and |
| 2860 | @code{reftex-cite-punctuation}. | 3004 | @code{reftex-cite-punctuation}. |
| @@ -2865,25 +3009,25 @@ dependent. See the variables @code{reftex-multiref-punctuation} and | |||
| 2865 | @cindex Finding files | 3009 | @cindex Finding files |
| 2866 | 3010 | ||
| 2867 | In order to find files included in a document via @code{\input} or | 3011 | In order to find files included in a document via @code{\input} or |
| 2868 | @code{\include}, @b{Ref@TeX{}} searches all directories specified in the | 3012 | @code{\include}, @RefTeX{} searches all directories specified in the |
| 2869 | environment variable @code{TEXINPUTS}. Similarly, it will search the | 3013 | environment variable @code{TEXINPUTS}. Similarly, it will search the |
| 2870 | path specified in the variables @code{BIBINPUTS} and @code{TEXBIB} for | 3014 | path specified in the variables @code{BIBINPUTS} and @code{TEXBIB} for |
| 2871 | BibTeX database files. | 3015 | @BibTeX{} database files. |
| 2872 | 3016 | ||
| 2873 | When searching, @b{Ref@TeX{}} will also expand recursive path | 3017 | When searching, @RefTeX{} will also expand recursive path |
| 2874 | definitions (directories ending in @samp{//} or @samp{!!}). But it will | 3018 | definitions (directories ending in @samp{//} or @samp{!!}). But it will |
| 2875 | only search and expand directories @emph{explicitly} given in these | 3019 | only search and expand directories @emph{explicitly} given in these |
| 2876 | variables. This may cause problems under the following circumstances: | 3020 | variables. This may cause problems under the following circumstances: |
| 2877 | 3021 | ||
| 2878 | @itemize @bullet | 3022 | @itemize @bullet |
| 2879 | @item | 3023 | @item |
| 2880 | Most TeX system have a default search path for both TeX files and BibTeX | 3024 | Most @TeX{} system have a default search path for both @TeX{} files and @BibTeX{} |
| 2881 | files which is defined in some setup file. Usually this default path is | 3025 | files which is defined in some setup file. Usually this default path is |
| 2882 | for system files which @b{Ref@TeX{}} does not need to see. But if your | 3026 | for system files which @RefTeX{} does not need to see. But if your |
| 2883 | document needs TeX files or BibTeX database files in a directory only | 3027 | document needs @TeX{} files or @BibTeX{} database files in a directory only |
| 2884 | given in the default search path, @b{Ref@TeX{}} will fail to find them. | 3028 | given in the default search path, @RefTeX{} will fail to find them. |
| 2885 | @item | 3029 | @item |
| 2886 | Some TeX systems do not use environment variables at all in order to | 3030 | Some @TeX{} systems do not use environment variables at all in order to |
| 2887 | specify the search path. Both default and user search path are then | 3031 | specify the search path. Both default and user search path are then |
| 2888 | defined in setup files. | 3032 | defined in setup files. |
| 2889 | @end itemize | 3033 | @end itemize |
| @@ -2896,7 +3040,7 @@ There are three ways to solve this problem: | |||
| 2896 | Specify all relevant directories explicitly in the environment | 3040 | Specify all relevant directories explicitly in the environment |
| 2897 | variables. If for some reason you don't want to mess with the default | 3041 | variables. If for some reason you don't want to mess with the default |
| 2898 | variables @code{TEXINPUTS} and @code{BIBINPUTS}, define your own | 3042 | variables @code{TEXINPUTS} and @code{BIBINPUTS}, define your own |
| 2899 | variables and configure @b{Ref@TeX{}} to use them instead: | 3043 | variables and configure @RefTeX{} to use them instead: |
| 2900 | 3044 | ||
| 2901 | @lisp | 3045 | @lisp |
| 2902 | (setq reftex-texpath-environment-variables '("MYTEXINPUTS")) | 3046 | (setq reftex-texpath-environment-variables '("MYTEXINPUTS")) |
| @@ -2904,7 +3048,7 @@ variables and configure @b{Ref@TeX{}} to use them instead: | |||
| 2904 | @end lisp | 3048 | @end lisp |
| 2905 | 3049 | ||
| 2906 | @item | 3050 | @item |
| 2907 | Specify the full search path directly in @b{Ref@TeX{}}'s variables. | 3051 | Specify the full search path directly in @RefTeX{}'s variables. |
| 2908 | 3052 | ||
| 2909 | @lisp | 3053 | @lisp |
| 2910 | (setq reftex-texpath-environment-variables | 3054 | (setq reftex-texpath-environment-variables |
| @@ -2914,10 +3058,10 @@ Specify the full search path directly in @b{Ref@TeX{}}'s variables. | |||
| 2914 | @end lisp | 3058 | @end lisp |
| 2915 | 3059 | ||
| 2916 | @item | 3060 | @item |
| 2917 | Some TeX systems provide stand--alone programs to do the file search just | 3061 | Some @TeX{} systems provide stand-alone programs to do the file search just |
| 2918 | like TeX and BibTeX. E.g. Thomas Esser's @code{teTeX} uses the | 3062 | like @TeX{} and @BibTeX{}. E.g. Thomas Esser's @code{teTeX} uses the |
| 2919 | @code{kpathsearch} library which provides the command @code{kpsewhich} | 3063 | @code{kpathsearch} library which provides the command @code{kpsewhich} |
| 2920 | to search for files. @b{Ref@TeX{}} can be configured to use this | 3064 | to search for files. @RefTeX{} can be configured to use this |
| 2921 | program. Note that the exact syntax of the @code{kpsewhich} | 3065 | program. Note that the exact syntax of the @code{kpsewhich} |
| 2922 | command depends upon the version of that program. | 3066 | command depends upon the version of that program. |
| 2923 | 3067 | ||
| @@ -2935,8 +3079,8 @@ command depends upon the version of that program. | |||
| 2935 | Some people like to use RefTeX with noweb files, which usually have the | 3079 | Some people like to use RefTeX with noweb files, which usually have the |
| 2936 | extension @file{.nw}. In order to deal with such files, the new | 3080 | extension @file{.nw}. In order to deal with such files, the new |
| 2937 | extension must be added to the list of valid extensions in the variable | 3081 | extension must be added to the list of valid extensions in the variable |
| 2938 | @code{reftex-file-extensions}. When working with AUCTeX as major mode, | 3082 | @code{reftex-file-extensions}. When working with @AUCTeX{} as major mode, |
| 2939 | the new extension must also be known to AUCTeX via the variable | 3083 | the new extension must also be known to @AUCTeX{} via the variable |
| 2940 | @code{TeX-file-extension}. For example: | 3084 | @code{TeX-file-extension}. For example: |
| 2941 | 3085 | ||
| 2942 | @lisp | 3086 | @lisp |
| @@ -2956,15 +3100,15 @@ am leaving this stuff in the manual for people who want to write thick | |||
| 2956 | books, where some of it still might be useful.} | 3100 | books, where some of it still might be useful.} |
| 2957 | 3101 | ||
| 2958 | Implementing the principle of least surprises, the default settings of | 3102 | Implementing the principle of least surprises, the default settings of |
| 2959 | @b{Ref@TeX{}} ensure a safe ride for beginners and casual users. However, | 3103 | @RefTeX{} ensure a safe ride for beginners and casual users. However, |
| 2960 | when using @b{Ref@TeX{}} for a large project and/or on a small computer, | 3104 | when using @RefTeX{} for a large project and/or on a small computer, |
| 2961 | there are ways to improve speed or memory usage. | 3105 | there are ways to improve speed or memory usage. |
| 2962 | 3106 | ||
| 2963 | @itemize @bullet | 3107 | @itemize @bullet |
| 2964 | @item | 3108 | @item |
| 2965 | @b{Removing Lookup Buffers}@* | 3109 | @b{Removing Lookup Buffers}@* |
| 2966 | @cindex Removing lookup buffers | 3110 | @cindex Removing lookup buffers |
| 2967 | @b{Ref@TeX{}} will load other parts of a multifile document as well as BibTeX | 3111 | @RefTeX{} will load other parts of a multifile document as well as @BibTeX{} |
| 2968 | database files for lookup purposes. These buffers are kept, so that | 3112 | database files for lookup purposes. These buffers are kept, so that |
| 2969 | subsequent use of the same files is fast. If you can't afford keeping | 3113 | subsequent use of the same files is fast. If you can't afford keeping |
| 2970 | these buffers around, and if you can live with a speed penalty, try | 3114 | these buffers around, and if you can live with a speed penalty, try |
| @@ -2978,13 +3122,13 @@ these buffers around, and if you can live with a speed penalty, try | |||
| 2978 | @b{Partial Document Scans}@* | 3122 | @b{Partial Document Scans}@* |
| 2979 | @cindex Partial documents scans | 3123 | @cindex Partial documents scans |
| 2980 | @cindex Document scanning, partial | 3124 | @cindex Document scanning, partial |
| 2981 | A @kbd{C-u} prefix on the major @b{Ref@TeX{}} commands @code{reftex-label} | 3125 | A @kbd{C-u} prefix on the major @RefTeX{} commands @code{reftex-label} |
| 2982 | (@kbd{C-u C-c (}), @code{reftex-reference} (@kbd{C-u C-c )}), | 3126 | (@kbd{C-u C-c (}), @code{reftex-reference} (@kbd{C-u C-c )}), |
| 2983 | @code{reftex-citation} (@kbd{C-u C-c [}), @code{reftex-toc} (@kbd{C-u C-c | 3127 | @code{reftex-citation} (@kbd{C-u C-c [}), @code{reftex-toc} (@kbd{C-u C-c |
| 2984 | =}), and @code{reftex-view-crossref} (@kbd{C-u C-c &}) initiates | 3128 | =}), and @code{reftex-view-crossref} (@kbd{C-u C-c &}) initiates |
| 2985 | re-parsing of the entire document in order to update the parsing | 3129 | re-parsing of the entire document in order to update the parsing |
| 2986 | information. For a large document this can be unnecessary, in | 3130 | information. For a large document this can be unnecessary, in |
| 2987 | particular if only one file has changed. @b{Ref@TeX{}} can be configured | 3131 | particular if only one file has changed. @RefTeX{} can be configured |
| 2988 | to do partial scans instead of full ones. @kbd{C-u} re-parsing then | 3132 | to do partial scans instead of full ones. @kbd{C-u} re-parsing then |
| 2989 | does apply only to the current buffer and files included from it. | 3133 | does apply only to the current buffer and files included from it. |
| 2990 | Likewise, the @kbd{r} key in both the label selection buffer and the | 3134 | Likewise, the @kbd{r} key in both the label selection buffer and the |
| @@ -3004,7 +3148,7 @@ try | |||
| 3004 | @cindex Saving parser information | 3148 | @cindex Saving parser information |
| 3005 | @cindex Parse information, saving to a file | 3149 | @cindex Parse information, saving to a file |
| 3006 | @vindex reftex-parse-file-extension | 3150 | @vindex reftex-parse-file-extension |
| 3007 | Even with partial scans enabled, @b{Ref@TeX{}} still has to make one full | 3151 | Even with partial scans enabled, @RefTeX{} still has to make one full |
| 3008 | scan, when you start working with a document. To avoid this, parsing | 3152 | scan, when you start working with a document. To avoid this, parsing |
| 3009 | information can be stored in a file. The file @file{MASTER.rel} is used | 3153 | information can be stored in a file. The file @file{MASTER.rel} is used |
| 3010 | for storing information about a document with master file | 3154 | for storing information about a document with master file |
| @@ -3022,11 +3166,11 @@ session. To use this feature, put into @file{.emacs}: | |||
| 3022 | @b{Identifying label types by prefix}@* | 3166 | @b{Identifying label types by prefix}@* |
| 3023 | @cindex Parse information, saving to a file | 3167 | @cindex Parse information, saving to a file |
| 3024 | @vindex reftex-trust-label-prefix | 3168 | @vindex reftex-trust-label-prefix |
| 3025 | @b{Ref@TeX{}} normally parses around each label to check in which | 3169 | @RefTeX{} normally parses around each label to check in which |
| 3026 | environment this label is located, in order to assign a label type to | 3170 | environment this label is located, in order to assign a label type to |
| 3027 | the label. If your document contains thousands of labels, document | 3171 | the label. If your document contains thousands of labels, document |
| 3028 | parsing will take considerable time. If you have been using label prefixes | 3172 | parsing will take considerable time. If you have been using label prefixes |
| 3029 | like tab: and fn: consistently, you can tell @b{Ref@TeX{}} to get the | 3173 | like tab: and fn: consistently, you can tell @RefTeX{} to get the |
| 3030 | label type directly from the prefix, without additional parsing. This | 3174 | label type directly from the prefix, without additional parsing. This |
| 3031 | will be faster and also allow labels to end up in the correct category | 3175 | will be faster and also allow labels to end up in the correct category |
| 3032 | if for some reason it is not possible to derive the correct type from | 3176 | if for some reason it is not possible to derive the correct type from |
| @@ -3041,7 +3185,7 @@ equation labels, use | |||
| 3041 | @b{Automatic Document Scans}@* | 3185 | @b{Automatic Document Scans}@* |
| 3042 | @cindex Automatic document scans | 3186 | @cindex Automatic document scans |
| 3043 | @cindex Document scanning, automatic | 3187 | @cindex Document scanning, automatic |
| 3044 | At rare occasions, @b{Ref@TeX{}} will automatically rescan a part of the | 3188 | At rare occasions, @RefTeX{} will automatically rescan a part of the |
| 3045 | document. If this gets into your way, it can be turned off with | 3189 | document. If this gets into your way, it can be turned off with |
| 3046 | 3190 | ||
| 3047 | @vindex reftex-allow-automatic-rescan | 3191 | @vindex reftex-allow-automatic-rescan |
| @@ -3049,7 +3193,7 @@ document. If this gets into your way, it can be turned off with | |||
| 3049 | (setq reftex-allow-automatic-rescan nil) | 3193 | (setq reftex-allow-automatic-rescan nil) |
| 3050 | @end lisp | 3194 | @end lisp |
| 3051 | 3195 | ||
| 3052 | @b{Ref@TeX{}} will then occasionally annotate new labels in the selection | 3196 | @RefTeX{} will then occasionally annotate new labels in the selection |
| 3053 | buffer, saying that their position in the label list in uncertain. A | 3197 | buffer, saying that their position in the label list in uncertain. A |
| 3054 | manual document scan will fix this. | 3198 | manual document scan will fix this. |
| 3055 | 3199 | ||
| @@ -3059,7 +3203,7 @@ manual document scan will fix this. | |||
| 3059 | @cindex Selection buffers, multiple | 3203 | @cindex Selection buffers, multiple |
| 3060 | Normally, the selection buffer @file{*RefTeX Select*} is re-created for | 3204 | Normally, the selection buffer @file{*RefTeX Select*} is re-created for |
| 3061 | every selection process. In documents with very many labels this can | 3205 | every selection process. In documents with very many labels this can |
| 3062 | take several seconds. @b{Ref@TeX{}} provides an option to create a | 3206 | take several seconds. @RefTeX{} provides an option to create a |
| 3063 | separate selection buffer for each label type and to keep this buffer | 3207 | separate selection buffer for each label type and to keep this buffer |
| 3064 | from one selection to the next. These buffers are updated automatically | 3208 | from one selection to the next. These buffers are updated automatically |
| 3065 | only when a new label has been added in the buffers category with | 3209 | only when a new label has been added in the buffers category with |
| @@ -3089,7 +3233,7 @@ with the @kbd{g} key. To get this behavior, use instead | |||
| 3089 | @need 2000 | 3233 | @need 2000 |
| 3090 | @noindent | 3234 | @noindent |
| 3091 | @b{As a summary}, here are the settings I recommend for heavy use of | 3235 | @b{As a summary}, here are the settings I recommend for heavy use of |
| 3092 | @b{Ref@TeX{}} with large documents: | 3236 | @RefTeX{} with large documents: |
| 3093 | 3237 | ||
| 3094 | @lisp | 3238 | @lisp |
| 3095 | @group | 3239 | @group |
| @@ -3100,30 +3244,30 @@ with the @kbd{g} key. To get this behavior, use instead | |||
| 3100 | @end lisp | 3244 | @end lisp |
| 3101 | 3245 | ||
| 3102 | @node AUCTeX, Multifile Documents, Faces, Top | 3246 | @node AUCTeX, Multifile Documents, Faces, Top |
| 3103 | @section AUC@TeX{} | 3247 | @section @AUCTeX{} |
| 3104 | @cindex @code{AUCTeX}, Emacs package | 3248 | @cindex @code{AUCTeX}, Emacs package |
| 3105 | @cindex Emacs packages, @code{AUCTeX} | 3249 | @cindex Emacs packages, @code{AUCTeX} |
| 3106 | 3250 | ||
| 3107 | AUCTeX is without doubt the best major mode for editing TeX and LaTeX | 3251 | @AUCTeX{} is without doubt the best major mode for editing @TeX{} and @LaTeX{} |
| 3108 | files with Emacs (@pxref{Top,AUCTeX,,auctex, The AUCTeX User Manual}). | 3252 | files with Emacs (@pxref{Top,AUCTeX,,auctex, The AUCTeX User Manual}). |
| 3109 | If AUCTeX is not part of your Emacs distribution, you can get | 3253 | If @AUCTeX{} is not part of your Emacs distribution, you can get |
| 3110 | it@footnote{XEmacs 21.x users may want to install the corresponding | 3254 | it@footnote{XEmacs 21.x users may want to install the corresponding |
| 3111 | XEmacs package.} by ftp from the @value{AUCTEXSITE}. | 3255 | XEmacs package.} by FTP from the @value{AUCTEXSITE}. |
| 3112 | 3256 | ||
| 3113 | @menu | 3257 | @menu |
| 3114 | * AUCTeX-RefTeX Interface:: How both packages work together | 3258 | * AUCTeX-RefTeX Interface:: How both packages work together |
| 3115 | * Style Files:: AUCTeX's style files can support RefTeX | 3259 | * Style Files:: @AUCTeX{}'s style files can support RefTeX |
| 3116 | * Bib-Cite:: Hypertext reading of a document | 3260 | * Bib-Cite:: Hypertext reading of a document |
| 3117 | @end menu | 3261 | @end menu |
| 3118 | 3262 | ||
| 3119 | @node AUCTeX-RefTeX Interface, Style Files, , AUCTeX | 3263 | @node AUCTeX-RefTeX Interface, Style Files, , AUCTeX |
| 3120 | @subsection The AUC@TeX{}-@b{Ref@TeX{}} Interface | 3264 | @subsection The @AUCTeX{}-@RefTeX{} Interface |
| 3121 | 3265 | ||
| 3122 | @b{Ref@TeX{}} contains code to interface with AUCTeX. When this | 3266 | @RefTeX{} contains code to interface with @AUCTeX{}. When this |
| 3123 | interface is turned on, both packages will interact closely. Instead of | 3267 | interface is turned on, both packages will interact closely. Instead of |
| 3124 | using @b{Ref@TeX{}}'s commands directly, you can then also use them | 3268 | using @RefTeX{}'s commands directly, you can then also use them |
| 3125 | indirectly as part of the AUCTeX | 3269 | indirectly as part of the @AUCTeX{} |
| 3126 | environment@footnote{@b{Ref@TeX{}} 4.0 and AUCTeX 9.10c will be | 3270 | environment@footnote{@RefTeX{} 4.0 and @AUCTeX{} 9.10c will be |
| 3127 | needed for all of this to work. Parts of it work also with earlier | 3271 | needed for all of this to work. Parts of it work also with earlier |
| 3128 | versions.}. The interface is turned on with | 3272 | versions.}. The interface is turned on with |
| 3129 | 3273 | ||
| @@ -3146,12 +3290,12 @@ The following list describes the individual parts of the interface. | |||
| 3146 | @kindex C-c C-s | 3290 | @kindex C-c C-s |
| 3147 | @findex LaTeX-section, @r{AUCTeX} | 3291 | @findex LaTeX-section, @r{AUCTeX} |
| 3148 | @findex TeX-insert-macro, @r{AUCTeX} | 3292 | @findex TeX-insert-macro, @r{AUCTeX} |
| 3149 | @b{AUCTeX calls @code{reftex-label} to insert labels}@* | 3293 | @b{@AUCTeX{} calls @code{reftex-label} to insert labels}@* |
| 3150 | When a new section is created with @kbd{C-c C-s}, or a new environment | 3294 | When a new section is created with @kbd{C-c C-s}, or a new environment |
| 3151 | is inserted with @kbd{C-c C-e}, AUCTeX normally prompts for a label to | 3295 | is inserted with @kbd{C-c C-e}, @AUCTeX{} normally prompts for a label to |
| 3152 | go with it. With the interface, @code{reftex-label} is called instead. | 3296 | go with it. With the interface, @code{reftex-label} is called instead. |
| 3153 | For example, if you type @kbd{C-c C-e equation @key{RET}}, AUCTeX and | 3297 | For example, if you type @kbd{C-c C-e equation @key{RET}}, @AUCTeX{} and |
| 3154 | @b{Ref@TeX{}} will insert | 3298 | @RefTeX{} will insert |
| 3155 | 3299 | ||
| 3156 | @example | 3300 | @example |
| 3157 | \begin@{equation@} | 3301 | \begin@{equation@} |
| @@ -3163,12 +3307,12 @@ For example, if you type @kbd{C-c C-e equation @key{RET}}, AUCTeX and | |||
| 3163 | @noindent | 3307 | @noindent |
| 3164 | without further prompts. | 3308 | without further prompts. |
| 3165 | 3309 | ||
| 3166 | Similarly, when you type @kbd{C-c C-s section @key{RET}}, @b{Ref@TeX{}} | 3310 | Similarly, when you type @kbd{C-c C-s section @key{RET}}, @RefTeX{} |
| 3167 | will offer its default label which is derived from the section title. | 3311 | will offer its default label which is derived from the section title. |
| 3168 | 3312 | ||
| 3169 | @item | 3313 | @item |
| 3170 | @b{AUCTeX tells @b{Ref@TeX{}} about new sections}@* | 3314 | @b{@AUCTeX{} tells @RefTeX{} about new sections}@* |
| 3171 | When creating a new section with @kbd{C-c C-s}, @b{Ref@TeX{}} will not | 3315 | When creating a new section with @kbd{C-c C-s}, @RefTeX{} will not |
| 3172 | have to rescan the buffer in order to see it. | 3316 | have to rescan the buffer in order to see it. |
| 3173 | 3317 | ||
| 3174 | @item | 3318 | @item |
| @@ -3182,44 +3326,44 @@ have to rescan the buffer in order to see it. | |||
| 3182 | @findex TeX-arg-index, @r{AUCTeX function} | 3326 | @findex TeX-arg-index, @r{AUCTeX function} |
| 3183 | @findex TeX-insert-macro, @r{AUCTeX function} | 3327 | @findex TeX-insert-macro, @r{AUCTeX function} |
| 3184 | @kindex C-c @key{RET} | 3328 | @kindex C-c @key{RET} |
| 3185 | @b{@b{Ref@TeX{}} supplies macro arguments}@* When you insert a macro | 3329 | @b{@RefTeX{} supplies macro arguments}@* When you insert a macro |
| 3186 | interactively with @kbd{C-c @key{RET}}, AUCTeX normally prompts for | 3330 | interactively with @kbd{C-c @key{RET}}, @AUCTeX{} normally prompts for |
| 3187 | macro arguments. Internally, it uses the functions | 3331 | macro arguments. Internally, it uses the functions |
| 3188 | @code{TeX-arg-label}, @code{TeX-arg-cite}, and @code{TeX-arg-index} to | 3332 | @code{TeX-arg-label}, @code{TeX-arg-cite}, and @code{TeX-arg-index} to |
| 3189 | prompt for arguments which are labels, citation keys and index entries. | 3333 | prompt for arguments which are labels, citation keys and index entries. |
| 3190 | The interface takes over these functions@footnote{@code{fset} is used to | 3334 | The interface takes over these functions@footnote{@code{fset} is used to |
| 3191 | do this, which is not reversible. However, @b{Ref@TeX{}} implements the | 3335 | do this, which is not reversible. However, @RefTeX{} implements the |
| 3192 | old functionality when you later decide to turn off the interface.} and | 3336 | old functionality when you later decide to turn off the interface.} and |
| 3193 | supplies the macro arguments with @b{Ref@TeX{}'s} mechanisms. For | 3337 | supplies the macro arguments with @b{@RefTeX{}'s} mechanisms. For |
| 3194 | example, when you type @kbd{C-c @key{RET} ref @key{RET}}, @b{Ref@TeX{}} | 3338 | example, when you type @kbd{C-c @key{RET} ref @key{RET}}, @RefTeX{} |
| 3195 | will supply its label selection process (@pxref{Referencing | 3339 | will supply its label selection process (@pxref{Referencing |
| 3196 | Labels}). | 3340 | Labels}). |
| 3197 | 3341 | ||
| 3198 | @item | 3342 | @item |
| 3199 | @b{@b{Ref@TeX{}} tells AUCTeX about new labels, citation-- and index keys}@* | 3343 | @b{@RefTeX{} tells @AUCTeX{} about new labels, citation and index keys}@* |
| 3200 | @b{Ref@TeX{}} will add all newly created labels to AUCTeX's completion list. | 3344 | @RefTeX{} will add all newly created labels to @AUCTeX{}'s completion list. |
| 3201 | @end itemize | 3345 | @end itemize |
| 3202 | 3346 | ||
| 3203 | @node Style Files, Bib-Cite, AUCTeX-RefTeX Interface, AUCTeX | 3347 | @node Style Files, Bib-Cite, AUCTeX-RefTeX Interface, AUCTeX |
| 3204 | @subsection Style Files | 3348 | @subsection Style Files |
| 3205 | @cindex Style files, AUCTeX | 3349 | @cindex Style files, AUCTeX |
| 3206 | @findex TeX-add-style-hook, @r{AUCTeX} | 3350 | @findex TeX-add-style-hook, @r{AUCTeX} |
| 3207 | Style files are Emacs Lisp files which are evaluated by AUCTeX in | 3351 | Style files are Emacs Lisp files which are evaluated by @AUCTeX{} in |
| 3208 | association with the @code{\documentclass} and @code{\usepackage} | 3352 | association with the @code{\documentclass} and @code{\usepackage} |
| 3209 | commands of a document (@pxref{Style Files,,,auctex}). Support for | 3353 | commands of a document (@pxref{Style Files,,,auctex}). Support for |
| 3210 | @b{Ref@TeX{}} in such a style file is useful when the LaTeX style | 3354 | @RefTeX{} in such a style file is useful when the @LaTeX{} style |
| 3211 | defines macros or environments connected with labels, citations, or the | 3355 | defines macros or environments connected with labels, citations, or the |
| 3212 | index. Many style files (e.g. @file{amsmath.el} or @file{natbib.el}) | 3356 | index. Many style files (e.g. @file{amsmath.el} or @file{natbib.el}) |
| 3213 | distributed with AUCTeX already support @b{Ref@TeX{}} in this | 3357 | distributed with @AUCTeX{} already support @RefTeX{} in this |
| 3214 | way. | 3358 | way. |
| 3215 | 3359 | ||
| 3216 | Before calling a @b{Ref@TeX{}} function, the style hook should always | 3360 | Before calling a @RefTeX{} function, the style hook should always |
| 3217 | test for the availability of the function, so that the style file will | 3361 | test for the availability of the function, so that the style file will |
| 3218 | also work for people who do not use @b{Ref@TeX{}}. | 3362 | also work for people who do not use @RefTeX{}. |
| 3219 | 3363 | ||
| 3220 | Additions made with style files in the way described below remain local | 3364 | Additions made with style files in the way described below remain local |
| 3221 | to the current document. For example, if one package uses AMSTeX, the | 3365 | to the current document. For example, if one package uses AMSTeX, the |
| 3222 | style file will make @b{Ref@TeX{}} switch over to @code{\eqref}, but | 3366 | style file will make @RefTeX{} switch over to @code{\eqref}, but |
| 3223 | this will not affect other documents. | 3367 | this will not affect other documents. |
| 3224 | 3368 | ||
| 3225 | @findex reftex-add-label-environments | 3369 | @findex reftex-add-label-environments |
| @@ -3230,7 +3374,7 @@ function @code{reftex-add-to-label-alist} which is still available as an | |||
| 3230 | alias for compatibility.} which defines additions to | 3374 | alias for compatibility.} which defines additions to |
| 3231 | @code{reftex-label-alist}. The argument taken by this function must have | 3375 | @code{reftex-label-alist}. The argument taken by this function must have |
| 3232 | the same format as @code{reftex-label-alist}. The @file{amsmath.el} | 3376 | the same format as @code{reftex-label-alist}. The @file{amsmath.el} |
| 3233 | style file of AUCTeX for example contains the following: | 3377 | style file of @AUCTeX{} for example contains the following: |
| 3234 | 3378 | ||
| 3235 | @lisp | 3379 | @lisp |
| 3236 | @group | 3380 | @group |
| @@ -3262,7 +3406,7 @@ with @code{\newtheorem} might use | |||
| 3262 | Similarly, a style hook may contain a call to | 3406 | Similarly, a style hook may contain a call to |
| 3263 | @code{reftex-set-cite-format} to set the citation format. The style | 3407 | @code{reftex-set-cite-format} to set the citation format. The style |
| 3264 | file @file{natbib.el} for the Natbib citation style does switch | 3408 | file @file{natbib.el} for the Natbib citation style does switch |
| 3265 | @b{Ref@TeX{}}'s citation format like this: | 3409 | @RefTeX{}'s citation format like this: |
| 3266 | 3410 | ||
| 3267 | @lisp | 3411 | @lisp |
| 3268 | (TeX-add-style-hook "natbib" | 3412 | (TeX-add-style-hook "natbib" |
| @@ -3286,7 +3430,7 @@ the style @file{multind.el} contains | |||
| 3286 | @end lisp | 3430 | @end lisp |
| 3287 | 3431 | ||
| 3288 | If you have your own package @file{myindex} which defines the | 3432 | If you have your own package @file{myindex} which defines the |
| 3289 | following macros to be used with the LaTeX @file{index.sty} file | 3433 | following macros to be used with the @LaTeX{} @file{index.sty} file |
| 3290 | @example | 3434 | @example |
| 3291 | \newcommand@{\molec@}[1]@{#1\index@{Molecules!#1@}@} | 3435 | \newcommand@{\molec@}[1]@{#1\index@{Molecules!#1@}@} |
| 3292 | \newcommand@{\aindex@}[1]@{#1\index[author]@{#1@} | 3436 | \newcommand@{\aindex@}[1]@{#1\index[author]@{#1@} |
| @@ -3310,7 +3454,7 @@ you could write this in the style file @file{myindex.el}: | |||
| 3310 | Finally the hook may contain a call to @code{reftex-add-section-levels} | 3454 | Finally the hook may contain a call to @code{reftex-add-section-levels} |
| 3311 | to define additional section statements. For example, the FoilTeX class | 3455 | to define additional section statements. For example, the FoilTeX class |
| 3312 | has just two headers, @code{\foilhead} and @code{\rotatefoilhead}. Here | 3456 | has just two headers, @code{\foilhead} and @code{\rotatefoilhead}. Here |
| 3313 | is a style file @file{foils.el} that will inform @b{Ref@TeX{}} about these: | 3457 | is a style file @file{foils.el} that will inform @RefTeX{} about these: |
| 3314 | 3458 | ||
| 3315 | @lisp | 3459 | @lisp |
| 3316 | (TeX-add-style-hook "foils" | 3460 | (TeX-add-style-hook "foils" |
| @@ -3326,20 +3470,20 @@ is a style file @file{foils.el} that will inform @b{Ref@TeX{}} about these: | |||
| 3326 | @cindex Emacs packages, @code{bib-cite} | 3470 | @cindex Emacs packages, @code{bib-cite} |
| 3327 | 3471 | ||
| 3328 | Once you have written a document with labels, references and citations, | 3472 | Once you have written a document with labels, references and citations, |
| 3329 | it can be nice to read it like a hypertext document. @b{Ref@TeX{}} has | 3473 | it can be nice to read it like a hypertext document. @RefTeX{} has |
| 3330 | support for that: @code{reftex-view-crossref} (bound to @kbd{C-c | 3474 | support for that: @code{reftex-view-crossref} (bound to @kbd{C-c |
| 3331 | &}), @code{reftex-mouse-view-crossref} (bound to @kbd{S-mouse-2}), and | 3475 | &}), @code{reftex-mouse-view-crossref} (bound to @kbd{S-mouse-2}), and |
| 3332 | @code{reftex-search-document}. A somewhat fancier interface with mouse | 3476 | @code{reftex-search-document}. A somewhat fancier interface with mouse |
| 3333 | highlighting is provided (among other things) by Peter S. Galbraith's | 3477 | highlighting is provided (among other things) by Peter S. Galbraith's |
| 3334 | @file{bib-cite.el}. There is some overlap in the functionalities of | 3478 | @file{bib-cite.el}. There is some overlap in the functionalities of |
| 3335 | Bib-cite and @b{Ref@TeX{}}. Bib-cite.el comes bundled with | 3479 | Bib-cite and @RefTeX{}. Bib-cite.el comes bundled with |
| 3336 | AUCTeX. | 3480 | @AUCTeX{}. |
| 3337 | 3481 | ||
| 3338 | Bib-cite version 3.06 and later can be configured so that bib-cite's | 3482 | Bib-cite version 3.06 and later can be configured so that bib-cite's |
| 3339 | mouse functions use @b{Ref@TeX{}} for displaying references and citations. | 3483 | mouse functions use @RefTeX{} for displaying references and citations. |
| 3340 | This can be useful in particular when working with the LaTeX @code{xr} | 3484 | This can be useful in particular when working with the @LaTeX{} @code{xr} |
| 3341 | package or with an explicit @code{thebibliography} environment (rather | 3485 | package or with an explicit @code{thebibliography} environment (rather |
| 3342 | than BibTeX). Bib-cite cannot handle those, but @b{Ref@TeX{}} does. To | 3486 | than @BibTeX{}). Bib-cite cannot handle those, but @RefTeX{} does. To |
| 3343 | make use of this feature, try | 3487 | make use of this feature, try |
| 3344 | 3488 | ||
| 3345 | @vindex bib-cite-use-reftex-view-crossref | 3489 | @vindex bib-cite-use-reftex-view-crossref |
| @@ -3354,7 +3498,7 @@ make use of this feature, try | |||
| 3354 | 3498 | ||
| 3355 | @itemize @bullet | 3499 | @itemize @bullet |
| 3356 | @item | 3500 | @item |
| 3357 | @b{LaTeX commands}@* | 3501 | @b{@LaTeX{} commands}@* |
| 3358 | @cindex LaTeX commands, not found | 3502 | @cindex LaTeX commands, not found |
| 3359 | @code{\input}, @code{\include}, and @code{\section} (etc.) statements | 3503 | @code{\input}, @code{\include}, and @code{\section} (etc.) statements |
| 3360 | have to be first on a line (except for white space). | 3504 | have to be first on a line (except for white space). |
| @@ -3362,7 +3506,7 @@ have to be first on a line (except for white space). | |||
| 3362 | @item | 3506 | @item |
| 3363 | @b{Commented regions}@* | 3507 | @b{Commented regions}@* |
| 3364 | @cindex Labels, commented out | 3508 | @cindex Labels, commented out |
| 3365 | @b{Ref@TeX{}} sees also labels in regions commented out and will refuse to | 3509 | @RefTeX{} sees also labels in regions commented out and will refuse to |
| 3366 | make duplicates of such labels. This is considered to be a feature. | 3510 | make duplicates of such labels. This is considered to be a feature. |
| 3367 | 3511 | ||
| 3368 | @item | 3512 | @item |
| @@ -3382,7 +3526,7 @@ scan will fix this. | |||
| 3382 | The label environment definitions in @code{reftex-label-alist} are | 3526 | The label environment definitions in @code{reftex-label-alist} are |
| 3383 | global and apply to all documents. If you need to make definitions | 3527 | global and apply to all documents. If you need to make definitions |
| 3384 | local to a document, because they would interfere with settings in other | 3528 | local to a document, because they would interfere with settings in other |
| 3385 | documents, you should use AUCTeX and set up style files with calls to | 3529 | documents, you should use @AUCTeX{} and set up style files with calls to |
| 3386 | @code{reftex-add-label-environments}, @code{reftex-set-cite-format}, | 3530 | @code{reftex-add-label-environments}, @code{reftex-set-cite-format}, |
| 3387 | @code{reftex-add-index-macros}, and @code{reftex-add-section-levels}. | 3531 | @code{reftex-add-index-macros}, and @code{reftex-add-section-levels}. |
| 3388 | Settings made with these functions remain local to the current | 3532 | Settings made with these functions remain local to the current |
| @@ -3398,9 +3542,9 @@ document. @xref{AUCTeX}. | |||
| 3398 | @cindex Emacs packages, @code{iso-cvt} | 3542 | @cindex Emacs packages, @code{iso-cvt} |
| 3399 | When using packages which make the buffer representation of a file | 3543 | When using packages which make the buffer representation of a file |
| 3400 | different from its disk representation (e.g. x-symbol, isotex, | 3544 | different from its disk representation (e.g. x-symbol, isotex, |
| 3401 | iso-cvt) you may find that @b{Ref@TeX{}}'s parsing information sometimes | 3545 | iso-cvt) you may find that @RefTeX{}'s parsing information sometimes |
| 3402 | reflects the disk state of a file. This happens only in @emph{unvisited} | 3546 | reflects the disk state of a file. This happens only in @emph{unvisited} |
| 3403 | parts of a multifile document, because @b{Ref@TeX{}} visits these files | 3547 | parts of a multifile document, because @RefTeX{} visits these files |
| 3404 | literally for speed reasons. Then both short context and section | 3548 | literally for speed reasons. Then both short context and section |
| 3405 | headings may look different from what you usually see on your screen. | 3549 | headings may look different from what you usually see on your screen. |
| 3406 | In rare cases @code{reftex-toc} may have problems to jump to an affected | 3550 | In rare cases @code{reftex-toc} may have problems to jump to an affected |
| @@ -3410,7 +3554,7 @@ this: | |||
| 3410 | @item | 3554 | @item |
| 3411 | @vindex reftex-keep-temporary-buffers | 3555 | @vindex reftex-keep-temporary-buffers |
| 3412 | @code{(setq reftex-keep-temporary-buffers t)}@* | 3556 | @code{(setq reftex-keep-temporary-buffers t)}@* |
| 3413 | This implies that @b{Ref@TeX{}} will load all parts of a multifile | 3557 | This implies that @RefTeX{} will load all parts of a multifile |
| 3414 | document into Emacs (i.e. there won't be any temporary buffers). | 3558 | document into Emacs (i.e. there won't be any temporary buffers). |
| 3415 | @item | 3559 | @item |
| 3416 | @vindex reftex-initialize-temporary-buffers | 3560 | @vindex reftex-initialize-temporary-buffers |
| @@ -3437,7 +3581,7 @@ to specify a label. E.g. Lamport's @file{pf.sty} uses both | |||
| 3437 | @end example | 3581 | @end example |
| 3438 | 3582 | ||
| 3439 | @noindent | 3583 | @noindent |
| 3440 | We need to trick @b{Ref@TeX{}} into swallowing this: | 3584 | We need to trick @RefTeX{} into swallowing this: |
| 3441 | 3585 | ||
| 3442 | @lisp | 3586 | @lisp |
| 3443 | @group | 3587 | @group |
| @@ -3450,7 +3594,7 @@ We need to trick @b{Ref@TeX{}} into swallowing this: | |||
| 3450 | 3594 | ||
| 3451 | @noindent | 3595 | @noindent |
| 3452 | The first line is just a normal configuration for a macro. For the | 3596 | The first line is just a normal configuration for a macro. For the |
| 3453 | @code{step+} environment we actually tell @b{Ref@TeX{}} to look for the | 3597 | @code{step+} environment we actually tell @RefTeX{} to look for the |
| 3454 | @emph{macro} @samp{\begin@{step+@}} and interpret the @emph{first} | 3598 | @emph{macro} @samp{\begin@{step+@}} and interpret the @emph{first} |
| 3455 | argument (which really is a second argument to the macro @code{\begin}) | 3599 | argument (which really is a second argument to the macro @code{\begin}) |
| 3456 | as a label of type @code{?p}. Argument count for this macro starts only | 3600 | as a label of type @code{?p}. Argument count for this macro starts only |
| @@ -3462,7 +3606,7 @@ context. | |||
| 3462 | @cindex Idle timer restart | 3606 | @cindex Idle timer restart |
| 3463 | @vindex reftex-use-itimer-in-xemacs | 3607 | @vindex reftex-use-itimer-in-xemacs |
| 3464 | In XEmacs, idle timer restart does not work reliably after fast | 3608 | In XEmacs, idle timer restart does not work reliably after fast |
| 3465 | keystrokes. Therefore @b{Ref@TeX{}} currently uses the post command | 3609 | keystrokes. Therefore @RefTeX{} currently uses the post command |
| 3466 | hook to start the timer used for automatic crossref information. When | 3610 | hook to start the timer used for automatic crossref information. When |
| 3467 | this bug gets fixed, a real idle timer can be requested with | 3611 | this bug gets fixed, a real idle timer can be requested with |
| 3468 | @lisp | 3612 | @lisp |
| @@ -3475,7 +3619,7 @@ this bug gets fixed, a real idle timer can be requested with | |||
| 3475 | @cindex Key bindings, problems with Viper mode | 3619 | @cindex Key bindings, problems with Viper mode |
| 3476 | @findex viper-harness-minor-mode | 3620 | @findex viper-harness-minor-mode |
| 3477 | With @i{Viper} mode prior to Vipers version 3.01, you need to protect | 3621 | With @i{Viper} mode prior to Vipers version 3.01, you need to protect |
| 3478 | @b{Ref@TeX{}}'s keymaps with | 3622 | @RefTeX{}'s keymaps with |
| 3479 | 3623 | ||
| 3480 | @lisp | 3624 | @lisp |
| 3481 | (viper-harness-minor-mode "reftex") | 3625 | (viper-harness-minor-mode "reftex") |
| @@ -3491,15 +3635,15 @@ With @i{Viper} mode prior to Vipers version 3.01, you need to protect | |||
| 3491 | @cindex Acknowledgments | 3635 | @cindex Acknowledgments |
| 3492 | @cindex Thanks | 3636 | @cindex Thanks |
| 3493 | @cindex Bug reports | 3637 | @cindex Bug reports |
| 3494 | @cindex @code{http}, @b{Ref@TeX{}} home page | 3638 | @cindex @code{http}, @RefTeX{} home page |
| 3495 | @cindex @code{ftp}, @b{Ref@TeX{}} site | 3639 | @cindex @code{ftp}, @RefTeX{} site |
| 3496 | 3640 | ||
| 3497 | Ref@TeX{} was written by @i{Carsten Dominik} | 3641 | @RefTeX{} was written by @i{Carsten Dominik} |
| 3498 | @email{dominik@@science.uva.nl}, with contributions by @i{Stephen | 3642 | @email{dominik@@science.uva.nl}, with contributions by @i{Stephen |
| 3499 | Eglen}. Ref@TeX{} is currently maintained by @value{MAINTAINER}, see | 3643 | Eglen}. @RefTeX{} is currently maintained by @value{MAINTAINER}, see |
| 3500 | the @value{MAINTAINERSITE} for detailed information. | 3644 | the @value{MAINTAINERSITE} for detailed information. |
| 3501 | 3645 | ||
| 3502 | If you have questions about Ref@TeX{}, you can send email to the | 3646 | If you have questions about @RefTeX{}, you can send email to the |
| 3503 | @value{SUPPORTADDRESS}. If you want to contribute code or ideas, write | 3647 | @value{SUPPORTADDRESS}. If you want to contribute code or ideas, write |
| 3504 | to the @value{DEVELADDRESS}. And in the rare case of finding a bug, | 3648 | to the @value{DEVELADDRESS}. And in the rare case of finding a bug, |
| 3505 | please use @kbd{M-x reftex-report-bug @key{RET}} which will prepare a | 3649 | please use @kbd{M-x reftex-report-bug @key{RET}} which will prepare a |
| @@ -3512,42 +3656,31 @@ There are also several Usenet groups which have competent readers who | |||
| 3512 | might be able to help: @code{comp.emacs}, @code{gnu.emacs.help}, | 3656 | might be able to help: @code{comp.emacs}, @code{gnu.emacs.help}, |
| 3513 | @code{comp.emacs.xemacs}, and @code{comp.text.tex}. | 3657 | @code{comp.emacs.xemacs}, and @code{comp.text.tex}. |
| 3514 | 3658 | ||
| 3515 | @b{Ref@TeX{}} is bundled and pre-installed with Emacs since version 20.2. | 3659 | Thanks to the people on the Net who have used @RefTeX{} and helped |
| 3516 | It was also bundled and pre-installed with XEmacs 19.16--20.x. XEmacs | ||
| 3517 | 21.x users want to install the corresponding plugin package which is | ||
| 3518 | available from the @value{XEMACSFTP}. See the XEmacs 21.x | ||
| 3519 | documentation on package installation for details. | ||
| 3520 | |||
| 3521 | Users of earlier Emacs distributions (including Emacs 19) can get a | ||
| 3522 | @b{Ref@TeX{}} distribution from the @value{MAINTAINERSITE}. Note that | ||
| 3523 | the Emacs 19 version supports many but not all features described in | ||
| 3524 | this manual. | ||
| 3525 | |||
| 3526 | Thanks to the people on the Net who have used @b{Ref@TeX{}} and helped | ||
| 3527 | developing it with their reports. In particular thanks to @i{Ralf | 3660 | developing it with their reports. In particular thanks to @i{Ralf |
| 3528 | Angeli, Fran Burstall, Alastair Burt, Lars Clausen, Soren Dayton, | 3661 | Angeli, Fran Burstall, Alastair Burt, Lars Clausen, Soren Dayton, |
| 3529 | Stephen Eglen, Karl Eichwalder, Erik Frisk, Peter Galbraith, Kai | 3662 | Stephen Eglen, Karl Eichwalder, Erik Frisk, Peter Galbraith, Kai |
| 3530 | Grossjohann, Frank Harrell, Till A. Heilmann, Peter Heslin, Stephan | 3663 | Grossjohann, Frank Harrell, Till A. Heilmann, Peter Heslin, Stephan |
| 3531 | Heuel, Alan Ho, Lute Kamstra, Dieter Kraft, David Kastrup, Adrian Lanz, | 3664 | Heuel, Alan Ho, Lute Kamstra, Dieter Kraft, David Kastrup, Adrian Lanz, |
| 3532 | Juri Linkov, Rory Molinari, Stefan Monnier, Laurent Mugnier, Dan | 3665 | Juri Linkov, Wolfgang Mayer, Rory Molinari, Stefan Monnier, Laurent |
| 3533 | Nicolaescu, Sudeep Kumar Palat, Daniel Polani, Alan Shutko, Robin Socha, | 3666 | Mugnier, Dan Nicolaescu, Sudeep Kumar Palat, Daniel Polani, Alan Shutko, |
| 3534 | Richard Stanton, Allan Strand, Jan Vroonhof, Christoph Wedler, Alan | 3667 | Robin Socha, Richard Stanton, Allan Strand, Jan Vroonhof, Christoph |
| 3535 | Williams, Roland Winkler, Hans-Christoph Wirth, Eli Zaretskii}. | 3668 | Wedler, Alan Williams, Roland Winkler, Hans-Christoph Wirth, Eli |
| 3536 | 3669 | Zaretskii}. | |
| 3537 | 3670 | ||
| 3538 | The @code{view-crossref} feature was inspired by @i{Peter Galbraith's} | 3671 | The @code{view-crossref} feature was inspired by @i{Peter Galbraith's} |
| 3539 | @file{bib-cite.el}. | 3672 | @file{bib-cite.el}. |
| 3540 | 3673 | ||
| 3541 | Finally thanks to @i{Uwe Bolick} who first got me interested in | 3674 | Finally thanks to @i{Uwe Bolick} who first got me interested in |
| 3542 | supporting LaTeX labels and references with an editor (which was | 3675 | supporting @LaTeX{} labels and references with an editor (which was |
| 3543 | MicroEmacs at the time). | 3676 | MicroEmacs at the time). |
| 3544 | 3677 | ||
| 3545 | @node Commands, Options, Imprint, Top | 3678 | @node Commands, Options, Imprint, Top |
| 3546 | @chapter Commands | 3679 | @chapter Commands |
| 3547 | @cindex Commands, list of | 3680 | @cindex Commands, list of |
| 3548 | 3681 | ||
| 3549 | Here is a summary of @b{Ref@TeX{}}'s commands which can be executed from | 3682 | Here is a summary of @RefTeX{}'s commands which can be executed from |
| 3550 | LaTeX files. Command which are executed from the special buffers are | 3683 | @LaTeX{} files. Command which are executed from the special buffers are |
| 3551 | not described here. All commands are available from the @code{Ref} | 3684 | not described here. All commands are available from the @code{Ref} |
| 3552 | menu. See @xref{Key Bindings}. | 3685 | menu. See @xref{Key Bindings}. |
| 3553 | 3686 | ||
| @@ -3567,8 +3700,8 @@ it. With one or two @kbd{C-u} prefixes, enforce document rescan first. | |||
| 3567 | @end deffn | 3700 | @end deffn |
| 3568 | 3701 | ||
| 3569 | @deffn Command reftex-citation | 3702 | @deffn Command reftex-citation |
| 3570 | Make a citation using BibTeX database files. After prompting for a regular | 3703 | Make a citation using @BibTeX{} database files. After prompting for a regular |
| 3571 | expression, scans the buffers with BibTeX entries (taken from the | 3704 | expression, scans the buffers with @BibTeX{} entries (taken from the |
| 3572 | @code{\bibliography} command or a @code{thebibliography} environment) | 3705 | @code{\bibliography} command or a @code{thebibliography} environment) |
| 3573 | and offers the matching entries for selection. The selected entry is | 3706 | and offers the matching entries for selection. The selected entry is |
| 3574 | formatted according to @code{reftex-cite-format} and inserted into the | 3707 | formatted according to @code{reftex-cite-format} and inserted into the |
| @@ -3588,8 +3721,8 @@ expression to match all entries in all files. | |||
| 3588 | @deffn Command reftex-index | 3721 | @deffn Command reftex-index |
| 3589 | Query for an index macro and insert it along with its arguments. The | 3722 | Query for an index macro and insert it along with its arguments. The |
| 3590 | index macros available are those defined in @code{reftex-index-macro} or | 3723 | index macros available are those defined in @code{reftex-index-macro} or |
| 3591 | by a call to @code{reftex-add-index-macros}, typically from an AUCTeX | 3724 | by a call to @code{reftex-add-index-macros}, typically from an @AUCTeX{} |
| 3592 | style file. @b{Ref@TeX{}} provides completion for the index tag and the | 3725 | style file. @RefTeX{} provides completion for the index tag and the |
| 3593 | index key, and will prompt for other arguments. | 3726 | index key, and will prompt for other arguments. |
| 3594 | @end deffn | 3727 | @end deffn |
| 3595 | 3728 | ||
| @@ -3600,8 +3733,8 @@ to make an index entry. The phrase indexed is the current selection or | |||
| 3600 | the word near point. When called with one @kbd{C-u} prefix, let the | 3733 | the word near point. When called with one @kbd{C-u} prefix, let the |
| 3601 | user have a chance to edit the index entry. When called with 2 | 3734 | user have a chance to edit the index entry. When called with 2 |
| 3602 | @kbd{C-u} as prefix, also ask for the index macro and other stuff. When | 3735 | @kbd{C-u} as prefix, also ask for the index macro and other stuff. When |
| 3603 | called inside TeX math mode as determined by the @file{texmathp.el} | 3736 | called inside @TeX{} math mode as determined by the @file{texmathp.el} |
| 3604 | library which is part of AUCTeX, the string is first processed with the | 3737 | library which is part of @AUCTeX{}, the string is first processed with the |
| 3605 | @code{reftex-index-math-format}, which see. | 3738 | @code{reftex-index-math-format}, which see. |
| 3606 | @end deffn | 3739 | @end deffn |
| 3607 | 3740 | ||
| @@ -3610,7 +3743,7 @@ Add current selection or the word at point to the phrases buffer. | |||
| 3610 | When you are in transient-mark-mode and the region is active, the | 3743 | When you are in transient-mark-mode and the region is active, the |
| 3611 | selection will be used - otherwise the word at point. | 3744 | selection will be used - otherwise the word at point. |
| 3612 | You get a chance to edit the entry in the phrases buffer - to save the | 3745 | You get a chance to edit the entry in the phrases buffer - to save the |
| 3613 | buffer and return to the LaTeX document, finish with @kbd{C-c C-c}. | 3746 | buffer and return to the @LaTeX{} document, finish with @kbd{C-c C-c}. |
| 3614 | @end deffn | 3747 | @end deffn |
| 3615 | 3748 | ||
| 3616 | @deffn Command reftex-index-visit-phrases-buffer | 3749 | @deffn Command reftex-index-visit-phrases-buffer |
| @@ -3644,9 +3777,9 @@ the command @code{reftex-view-crossref-from-bibtex}. With one or two | |||
| 3644 | @end deffn | 3777 | @end deffn |
| 3645 | 3778 | ||
| 3646 | @deffn Command reftex-view-crossref-from-bibtex | 3779 | @deffn Command reftex-view-crossref-from-bibtex |
| 3647 | View location in a LaTeX document which cites the BibTeX entry at point. | 3780 | View location in a @LaTeX{} document which cites the @BibTeX{} entry at point. |
| 3648 | Since BibTeX files can be used by many LaTeX documents, this function | 3781 | Since @BibTeX{} files can be used by many @LaTeX{} documents, this function |
| 3649 | prompts upon first use for a buffer in @b{Ref@TeX{}} mode. To reset this | 3782 | prompts upon first use for a buffer in @RefTeX{} mode. To reset this |
| 3650 | link to a document, call the function with a prefix arg. Calling | 3783 | link to a document, call the function with a prefix arg. Calling |
| 3651 | this function several times find successive citation locations. | 3784 | this function several times find successive citation locations. |
| 3652 | @end deffn | 3785 | @end deffn |
| @@ -3677,7 +3810,7 @@ active TAGS table is required. | |||
| 3677 | 3810 | ||
| 3678 | @deffn Command reftex-isearch-minor-mode | 3811 | @deffn Command reftex-isearch-minor-mode |
| 3679 | Toggle a minor mode which enables incremental search to work globally | 3812 | Toggle a minor mode which enables incremental search to work globally |
| 3680 | on the entire multifile document. Files will be searched in th | 3813 | on the entire multifile document. Files will be searched in the |
| 3681 | sequence they appear in the document. | 3814 | sequence they appear in the document. |
| 3682 | @end deffn | 3815 | @end deffn |
| 3683 | 3816 | ||
| @@ -3699,7 +3832,7 @@ Renumber all simple labels in the document to make them sequentially. | |||
| 3699 | Simple labels are the ones created by RefTeX, consisting only of the | 3832 | Simple labels are the ones created by RefTeX, consisting only of the |
| 3700 | prefix and a number. After the command completes, all these labels will | 3833 | prefix and a number. After the command completes, all these labels will |
| 3701 | have sequential numbers throughout the document. Any references to the | 3834 | have sequential numbers throughout the document. Any references to the |
| 3702 | labels will be changed as well. For this, @b{Ref@TeX{}} looks at the | 3835 | labels will be changed as well. For this, @RefTeX{} looks at the |
| 3703 | arguments of any macros which either start or end with the string | 3836 | arguments of any macros which either start or end with the string |
| 3704 | @samp{ref}. This command should be used with care, in particular in | 3837 | @samp{ref}. This command should be used with care, in particular in |
| 3705 | multifile documents. You should not use it if another document refers | 3838 | multifile documents. You should not use it if another document refers |
| @@ -3711,21 +3844,30 @@ Produce a list of all duplicate labels in the document. | |||
| 3711 | @end deffn | 3844 | @end deffn |
| 3712 | 3845 | ||
| 3713 | @deffn Command reftex-create-bibtex-file | 3846 | @deffn Command reftex-create-bibtex-file |
| 3714 | Create a new BibTeX database file with all entries referenced in document. | 3847 | @vindex reftex-create-bibtex-header |
| 3715 | The command prompts for a filename and writes the collected entries to | 3848 | @vindex reftex-create-bibtex-footer |
| 3716 | that file. Only entries referenced in the current document with | 3849 | Create a new @BibTeX{} database file with all entries referenced in |
| 3717 | any @code{\cite}-like macros are used. | 3850 | document. The command prompts for a filename and writes the collected |
| 3718 | The sequence in the new file is the same as it was in the old database. | 3851 | entries to that file. Only entries referenced in the current document |
| 3852 | with any @code{\cite}-like macros are used. The sequence in the new | ||
| 3853 | file is the same as it was in the old database. | ||
| 3854 | |||
| 3855 | Entries referenced from other entries must appear after all referencing | ||
| 3856 | entries. | ||
| 3857 | |||
| 3858 | You can define strings to be used as header or footer for the created | ||
| 3859 | files in the variables @code{reftex-create-bibtex-header} or | ||
| 3860 | @code{reftex-create-bibtex-footer} respectively. | ||
| 3719 | @end deffn | 3861 | @end deffn |
| 3720 | 3862 | ||
| 3721 | @deffn Command reftex-customize | 3863 | @deffn Command reftex-customize |
| 3722 | Run the customize browser on the @b{Ref@TeX{}} group. | 3864 | Run the customize browser on the @RefTeX{} group. |
| 3723 | @end deffn | 3865 | @end deffn |
| 3724 | @deffn Command reftex-show-commentary | 3866 | @deffn Command reftex-show-commentary |
| 3725 | Show the commentary section from @file{reftex.el}. | 3867 | Show the commentary section from @file{reftex.el}. |
| 3726 | @end deffn | 3868 | @end deffn |
| 3727 | @deffn Command reftex-info | 3869 | @deffn Command reftex-info |
| 3728 | Run info on the top @b{Ref@TeX{}} node. | 3870 | Run info on the top @RefTeX{} node. |
| 3729 | @end deffn | 3871 | @end deffn |
| 3730 | @deffn Command reftex-parse-document | 3872 | @deffn Command reftex-parse-document |
| 3731 | Parse the entire document in order to update the parsing information. | 3873 | Parse the entire document in order to update the parsing information. |
| @@ -3739,7 +3881,7 @@ removes the parse file associated with the current document. | |||
| 3739 | @chapter Options, Keymaps, Hooks | 3881 | @chapter Options, Keymaps, Hooks |
| 3740 | @cindex Options, list of | 3882 | @cindex Options, list of |
| 3741 | 3883 | ||
| 3742 | Here is a complete list of @b{Ref@TeX{}}'s configuration variables. All | 3884 | Here is a complete list of @RefTeX{}'s configuration variables. All |
| 3743 | variables have customize support - so if you are not familiar with Emacs | 3885 | variables have customize support - so if you are not familiar with Emacs |
| 3744 | Lisp (and even if you are) you might find it more comfortable to use | 3886 | Lisp (and even if you are) you might find it more comfortable to use |
| 3745 | @code{customize} to look at and change these variables. @kbd{M-x | 3887 | @code{customize} to look at and change these variables. @kbd{M-x |
| @@ -3765,14 +3907,14 @@ reftex-customize} will get you there. | |||
| 3765 | @cindex Table of contents, options | 3907 | @cindex Table of contents, options |
| 3766 | 3908 | ||
| 3767 | @defopt reftex-include-file-commands | 3909 | @defopt reftex-include-file-commands |
| 3768 | List of LaTeX commands which input another file. | 3910 | List of @LaTeX{} commands which input another file. |
| 3769 | The file name is expected after the command, either in braces or separated | 3911 | The file name is expected after the command, either in braces or separated |
| 3770 | by whitespace. | 3912 | by whitespace. |
| 3771 | @end defopt | 3913 | @end defopt |
| 3772 | 3914 | ||
| 3773 | @defopt reftex-max-section-depth | 3915 | @defopt reftex-max-section-depth |
| 3774 | Maximum depth of section levels in document structure. | 3916 | Maximum depth of section levels in document structure. |
| 3775 | Standard LaTeX needs 7, default is 12. | 3917 | Standard @LaTeX{} needs 7, default is 12. |
| 3776 | @end defopt | 3918 | @end defopt |
| 3777 | 3919 | ||
| 3778 | @defopt reftex-section-levels | 3920 | @defopt reftex-section-levels |
| @@ -3910,7 +4052,7 @@ itself and has the following structure: | |||
| 3910 | @end example | 4052 | @end example |
| 3911 | 4053 | ||
| 3912 | Each list entry describes either an environment carrying a counter for | 4054 | Each list entry describes either an environment carrying a counter for |
| 3913 | use with @code{\label} and @code{\ref}, or a LaTeX macro defining a | 4055 | use with @code{\label} and @code{\ref}, or a @LaTeX{} macro defining a |
| 3914 | label as (or inside) one of its arguments. The elements of each list | 4056 | label as (or inside) one of its arguments. The elements of each list |
| 3915 | entry are: | 4057 | entry are: |
| 3916 | 4058 | ||
| @@ -3947,7 +4089,7 @@ list, to cover cases in which different environments carry the same | |||
| 3947 | label type (like @code{equation} and @code{eqnarray}). If the type | 4089 | label type (like @code{equation} and @code{eqnarray}). If the type |
| 3948 | indicator is @code{nil} and the macro has a label argument @samp{@{*@}}, | 4090 | indicator is @code{nil} and the macro has a label argument @samp{@{*@}}, |
| 3949 | the macro defines neutral labels just like @code{\label}. In this case | 4091 | the macro defines neutral labels just like @code{\label}. In this case |
| 3950 | the reminder of this entry is ignored. | 4092 | the remainder of this entry is ignored. |
| 3951 | 4093 | ||
| 3952 | @item @var{label-prefix} | 4094 | @item @var{label-prefix} |
| 3953 | Label prefix string, like @samp{tab:}. The prefix is a short string | 4095 | Label prefix string, like @samp{tab:}. The prefix is a short string |
| @@ -3968,7 +4110,7 @@ Example: In a file @file{intro.tex}, @samp{eq:%f:} will become | |||
| 3968 | @samp{eq:intro:}. | 4110 | @samp{eq:intro:}. |
| 3969 | 4111 | ||
| 3970 | @item @var{reference-format} | 4112 | @item @var{reference-format} |
| 3971 | Format string for reference insert in buffer. @samp{%s} will be | 4113 | Format string for reference insertion in buffer. @samp{%s} will be |
| 3972 | replaced by the label. When the format starts with @samp{~}, this | 4114 | replaced by the label. When the format starts with @samp{~}, this |
| 3973 | @samp{~} will only be inserted when the character before point is | 4115 | @samp{~} will only be inserted when the character before point is |
| 3974 | @emph{not} a whitespace. | 4116 | @emph{not} a whitespace. |
| @@ -3996,7 +4138,7 @@ If an integer, use the nth argument of the macro. As a special case, | |||
| 3996 | 1000 means to get text after the last macro argument. | 4138 | 1000 means to get text after the last macro argument. |
| 3997 | @item | 4139 | @item |
| 3998 | If a string, use as regexp to search @emph{backward} from the label. | 4140 | If a string, use as regexp to search @emph{backward} from the label. |
| 3999 | Context is then the text following the end of the match. E.g. putting | 4141 | Context is then the text following the end of the match. E.g. setting |
| 4000 | this to @samp{\\caption[[@{]} will use the caption in a figure or table | 4142 | this to @samp{\\caption[[@{]} will use the caption in a figure or table |
| 4001 | environment. @samp{\\begin@{eqnarray@}\|\\\\} works for | 4143 | environment. @samp{\\begin@{eqnarray@}\|\\\\} works for |
| 4002 | eqnarrays. | 4144 | eqnarrays. |
| @@ -4021,7 +4163,7 @@ context: | |||
| 4021 | @end example | 4163 | @end example |
| 4022 | @end itemize | 4164 | @end itemize |
| 4023 | 4165 | ||
| 4024 | Label context is used in two ways by @b{Ref@TeX{}}: For display in the label | 4166 | Label context is used in two ways by @RefTeX{}: For display in the label |
| 4025 | menu, and to derive a label string. If you want to use a different | 4167 | menu, and to derive a label string. If you want to use a different |
| 4026 | method for each of these, specify them as a dotted pair. | 4168 | method for each of these, specify them as a dotted pair. |
| 4027 | E.g. @code{(nil . t)} uses the text after the label (@code{nil}) for | 4169 | E.g. @code{(nil . t)} uses the text after the label (@code{nil}) for |
| @@ -4033,7 +4175,7 @@ List of magic words which identify a reference to be of this type. If | |||
| 4033 | the word before point is equal to one of these words when calling | 4175 | the word before point is equal to one of these words when calling |
| 4034 | @code{reftex-reference}, the label list offered will be automatically | 4176 | @code{reftex-reference}, the label list offered will be automatically |
| 4035 | restricted to labels of the correct type. If the first element of this | 4177 | restricted to labels of the correct type. If the first element of this |
| 4036 | word--list is the symbol `regexp', the strings are interpreted as regular | 4178 | word list is the symbol `regexp', the strings are interpreted as regular |
| 4037 | expressions. | 4179 | expressions. |
| 4038 | 4180 | ||
| 4039 | @item @var{toc-level} | 4181 | @item @var{toc-level} |
| @@ -4047,7 +4189,7 @@ made. | |||
| 4047 | @end table | 4189 | @end table |
| 4048 | 4190 | ||
| 4049 | If the type indicator characters of two or more entries are the same, | 4191 | If the type indicator characters of two or more entries are the same, |
| 4050 | @b{Ref@TeX{}} will use | 4192 | @RefTeX{} will use |
| 4051 | @itemize @minus | 4193 | @itemize @minus |
| 4052 | @item | 4194 | @item |
| 4053 | the first non-@code{nil} format and prefix | 4195 | the first non-@code{nil} format and prefix |
| @@ -4081,7 +4223,7 @@ replaced with the environment or macro. | |||
| 4081 | @defopt reftex-trust-label-prefix | 4223 | @defopt reftex-trust-label-prefix |
| 4082 | Non-@code{nil} means, trust the label prefix when determining label type. | 4224 | Non-@code{nil} means, trust the label prefix when determining label type. |
| 4083 | It is customary to use special label prefixes to distinguish different label | 4225 | It is customary to use special label prefixes to distinguish different label |
| 4084 | types. The label prefixes have no syntactic meaning in LaTeX (unless | 4226 | types. The label prefixes have no syntactic meaning in @LaTeX{} (unless |
| 4085 | special packages like fancyref) are being used. RefTeX can and by | 4227 | special packages like fancyref) are being used. RefTeX can and by |
| 4086 | default does parse around each label to detect the correct label type, | 4228 | default does parse around each label to detect the correct label type, |
| 4087 | but this process can be slow when a document contains thousands of | 4229 | but this process can be slow when a document contains thousands of |
| @@ -4122,7 +4264,7 @@ Flags governing label insertion. The value has the form | |||
| 4122 | (@var{derive} @var{prompt}) | 4264 | (@var{derive} @var{prompt}) |
| 4123 | @end example | 4265 | @end example |
| 4124 | 4266 | ||
| 4125 | If @var{derive} is @code{t}, @b{Ref@TeX{}} will try to derive a sensible | 4267 | If @var{derive} is @code{t}, @RefTeX{} will try to derive a sensible |
| 4126 | label from context. A section label for example will be derived from | 4268 | label from context. A section label for example will be derived from |
| 4127 | the section heading. The conversion of the context to a valid label is | 4269 | the section heading. The conversion of the context to a valid label is |
| 4128 | governed by the specifications given in | 4270 | governed by the specifications given in |
| @@ -4171,7 +4313,7 @@ buffer. | |||
| 4171 | 4313 | ||
| 4172 | @deffn Hook reftex-string-to-label-function | 4314 | @deffn Hook reftex-string-to-label-function |
| 4173 | Function to turn an arbitrary string into a valid label. | 4315 | Function to turn an arbitrary string into a valid label. |
| 4174 | @b{Ref@TeX{}}'s default function uses the variable | 4316 | @RefTeX{}'s default function uses the variable |
| 4175 | @code{reftex-derive-label-parameters}. | 4317 | @code{reftex-derive-label-parameters}. |
| 4176 | @end deffn | 4318 | @end deffn |
| 4177 | 4319 | ||
| @@ -4278,35 +4420,38 @@ This is used to string together whole reference sets, like | |||
| 4278 | @code{reftex-reference}. | 4420 | @code{reftex-reference}. |
| 4279 | @end defopt | 4421 | @end defopt |
| 4280 | 4422 | ||
| 4281 | @defopt reftex-vref-is-default | 4423 | @defopt reftex-ref-style-alist |
| 4282 | Non-@code{nil} means, the varioref macro @code{\vref} is used as | 4424 | Alist of reference styles. Each element is a list of the style name, |
| 4283 | default. In the selection buffer, the @kbd{v} key toggles the reference | 4425 | the name of the @LaTeX{} package associated with the style or @code{t} |
| 4284 | macro between @code{\ref} and @code{\vref}. The value of this variable | 4426 | for any package, and an alist of macros where the first entry of each |
| 4285 | determines the default which is active when entering the selection | 4427 | item is the reference macro and the second a key for selecting the macro |
| 4286 | process. Instead of @code{nil} or @code{t}, this may also be a string | 4428 | when the macro type is being prompted for. (See also |
| 4287 | of type letters indicating the label types for which it should be | 4429 | @code{reftex-ref-macro-prompt}.) The keys, represented as characters, |
| 4288 | true. | 4430 | have to be unique. |
| 4289 | @end defopt | 4431 | @end defopt |
| 4290 | 4432 | ||
| 4291 | @defopt reftex-fref-is-default | 4433 | @defopt reftex-ref-style-default-list |
| 4292 | Non-@code{nil} means, the fancyref macro @code{\fref} is used as | 4434 | List of reference styles to be activated by default. The order is |
| 4293 | default. In the selection buffer, the @kbd{V} key toggles the reference | 4435 | significant and controls the order in which macros can be cycled in the |
| 4294 | macro between @code{\ref}, @code{\fref} and @code{\Fref}. The value of | 4436 | buffer for selecting a label. The entries in the list have to match the |
| 4295 | this variable determines the default which is active when entering the | 4437 | respective reference style names used in the variable |
| 4296 | selection process. Instead of @code{nil} or @code{t}, this may also be | 4438 | @code{reftex-ref-style-alist}. |
| 4297 | a string of type letters indicating the label types for which it should | 4439 | @end defopt |
| 4298 | be true. | 4440 | |
| 4441 | @defopt reftex-ref-macro-prompt | ||
| 4442 | Controls if @code{reftex-reference} prompts for the reference macro. | ||
| 4299 | @end defopt | 4443 | @end defopt |
| 4300 | 4444 | ||
| 4301 | @deffn Hook reftex-format-ref-function | 4445 | @deffn Hook reftex-format-ref-function |
| 4302 | If non-@code{nil}, should be a function which produces the string to | 4446 | If non-@code{nil}, should be a function which produces the string to |
| 4303 | insert as a reference. Note that the insertion format can also be | 4447 | insert as a reference. Note that the insertion format can also be |
| 4304 | changed with @code{reftex-label-alist}. This hook also is used by the | 4448 | changed with @code{reftex-label-alist}. This hook also is used by the |
| 4305 | special commands to insert @code{\vref} and @code{\fref} references, so | 4449 | special commands to insert e.g. @code{\vref} and @code{\fref} |
| 4306 | even if you set this, your setting will be ignored by the special | 4450 | references, so even if you set this, your setting will be ignored by the |
| 4307 | commands. The function will be called with two arguments, the | 4451 | special commands. The function will be called with three arguments, the |
| 4308 | @var{label} and the @var{default-format} (usually @samp{~\ref@{%s@}}). | 4452 | @var{label}, the @var{default format} which normally is |
| 4309 | It should return the string to insert into the buffer. | 4453 | @samp{~\ref@{%s@}} and the @var{reference style}. The function should |
| 4454 | return the string to insert into the buffer. | ||
| 4310 | @end deffn | 4455 | @end deffn |
| 4311 | 4456 | ||
| 4312 | @defopt reftex-level-indent | 4457 | @defopt reftex-level-indent |
| @@ -4315,11 +4460,11 @@ Number of spaces to be used for indentation per section level. | |||
| 4315 | 4460 | ||
| 4316 | @defopt reftex-guess-label-type | 4461 | @defopt reftex-guess-label-type |
| 4317 | Non-@code{nil} means, @code{reftex-reference} will try to guess the | 4462 | Non-@code{nil} means, @code{reftex-reference} will try to guess the |
| 4318 | label type. To do that, @b{Ref@TeX{}} will look at the word before the | 4463 | label type. To do that, @RefTeX{} will look at the word before the |
| 4319 | cursor and compare it with the magic words given in | 4464 | cursor and compare it with the magic words given in |
| 4320 | @code{reftex-label-alist}. When it finds a match, @b{Ref@TeX{}} will | 4465 | @code{reftex-label-alist}. When it finds a match, @RefTeX{} will |
| 4321 | immediately offer the correct label menu - otherwise it will prompt you | 4466 | immediately offer the correct label menu - otherwise it will prompt you |
| 4322 | for a label type. If you set this variable to @code{nil}, @b{Ref@TeX{}} | 4467 | for a label type. If you set this variable to @code{nil}, @RefTeX{} |
| 4323 | will always prompt for a label type. | 4468 | will always prompt for a label type. |
| 4324 | @end defopt | 4469 | @end defopt |
| 4325 | 4470 | ||
| @@ -4351,7 +4496,7 @@ The keymap which is active in the labels selection process | |||
| 4351 | @cindex Creating citations, options | 4496 | @cindex Creating citations, options |
| 4352 | 4497 | ||
| 4353 | @defopt reftex-bibliography-commands | 4498 | @defopt reftex-bibliography-commands |
| 4354 | LaTeX commands which specify the BibTeX databases to use with the document. | 4499 | @LaTeX{} commands which specify the @BibTeX{} databases to use with the document. |
| 4355 | @end defopt | 4500 | @end defopt |
| 4356 | 4501 | ||
| 4357 | @defopt reftex-bibfile-ignore-regexps | 4502 | @defopt reftex-bibfile-ignore-regexps |
| @@ -4359,20 +4504,20 @@ List of regular expressions to exclude files in | |||
| 4359 | @code{\\bibliography@{..@}}. File names matched by any of these regexps | 4504 | @code{\\bibliography@{..@}}. File names matched by any of these regexps |
| 4360 | will not be parsed. Intended for files which contain only | 4505 | will not be parsed. Intended for files which contain only |
| 4361 | @code{@@string} macro definitions and the like, which are ignored by | 4506 | @code{@@string} macro definitions and the like, which are ignored by |
| 4362 | @b{Ref@TeX{}} anyway. | 4507 | @RefTeX{} anyway. |
| 4363 | @end defopt | 4508 | @end defopt |
| 4364 | 4509 | ||
| 4365 | @defopt reftex-default-bibliography | 4510 | @defopt reftex-default-bibliography |
| 4366 | List of BibTeX database files which should be used if none are specified. | 4511 | List of @BibTeX{} database files which should be used if none are specified. |
| 4367 | When @code{reftex-citation} is called from a document with neither | 4512 | When @code{reftex-citation} is called from a document with neither |
| 4368 | a @samp{\bibliography@{...@}} statement nor a @code{thebibliography} | 4513 | a @samp{\bibliography@{...@}} statement nor a @code{thebibliography} |
| 4369 | environment, @b{Ref@TeX{}} will scan these files instead. Intended for | 4514 | environment, @RefTeX{} will scan these files instead. Intended for |
| 4370 | using @code{reftex-citation} in non-LaTeX files. The files will be | 4515 | using @code{reftex-citation} in non-@LaTeX{} files. The files will be |
| 4371 | searched along the BIBINPUTS or TEXBIB path. | 4516 | searched along the BIBINPUTS or TEXBIB path. |
| 4372 | @end defopt | 4517 | @end defopt |
| 4373 | 4518 | ||
| 4374 | @defopt reftex-sort-bibtex-matches | 4519 | @defopt reftex-sort-bibtex-matches |
| 4375 | Sorting of the entries found in BibTeX databases by reftex-citation. | 4520 | Sorting of the entries found in @BibTeX{} databases by reftex-citation. |
| 4376 | Possible values: | 4521 | Possible values: |
| 4377 | @example | 4522 | @example |
| 4378 | nil @r{Do not sort entries.} | 4523 | nil @r{Do not sort entries.} |
| @@ -4393,7 +4538,7 @@ In the format, the following percent escapes will be expanded. | |||
| 4393 | 4538 | ||
| 4394 | @table @code | 4539 | @table @code |
| 4395 | @item %l | 4540 | @item %l |
| 4396 | The BibTeX label of the citation. | 4541 | The @BibTeX{} label of the citation. |
| 4397 | @item %a | 4542 | @item %a |
| 4398 | List of author names, see also @code{reftex-cite-punctuation}. | 4543 | List of author names, see also @code{reftex-cite-punctuation}. |
| 4399 | @item %2a | 4544 | @item %2a |
| @@ -4405,7 +4550,7 @@ Works like @samp{%a}, but on list of editor names. (@samp{%2e} and | |||
| 4405 | @samp{%E} work a well). | 4550 | @samp{%E} work a well). |
| 4406 | @end table | 4551 | @end table |
| 4407 | 4552 | ||
| 4408 | It is also possible to access all other BibTeX database fields: | 4553 | It is also possible to access all other @BibTeX{} database fields: |
| 4409 | 4554 | ||
| 4410 | @example | 4555 | @example |
| 4411 | %b booktitle %c chapter %d edition %h howpublished | 4556 | %b booktitle %c chapter %d edition %h howpublished |
| @@ -4426,7 +4571,7 @@ after the string has been formatted. | |||
| 4426 | A pair of square brackets indicates an optional argument, and RefTeX | 4571 | A pair of square brackets indicates an optional argument, and RefTeX |
| 4427 | will prompt for the values of these arguments. | 4572 | will prompt for the values of these arguments. |
| 4428 | 4573 | ||
| 4429 | Beware that all this only works with BibTeX database files. When | 4574 | Beware that all this only works with @BibTeX{} database files. When |
| 4430 | citations are made from the @code{\bibitems} in an explicit | 4575 | citations are made from the @code{\bibitems} in an explicit |
| 4431 | @code{thebibliography} environment, only @samp{%l} is available. | 4576 | @code{thebibliography} environment, only @samp{%l} is available. |
| 4432 | 4577 | ||
| @@ -4505,6 +4650,24 @@ The keymap which is active in the citation-key selection process | |||
| 4505 | (@pxref{Creating Citations}). | 4650 | (@pxref{Creating Citations}). |
| 4506 | @end deffn | 4651 | @end deffn |
| 4507 | 4652 | ||
| 4653 | @defopt reftex-cite-key-separator | ||
| 4654 | String used to separate several keys in a single @samp{\\cite} macro. | ||
| 4655 | Per default this is @samp{","} but if you often have to deal with a lot | ||
| 4656 | of entries and need to break the macro across several lines you might | ||
| 4657 | want to change it to @samp{", "}. | ||
| 4658 | @end defopt | ||
| 4659 | |||
| 4660 | @defopt reftex-create-bibtex-header | ||
| 4661 | Header to insert in BibTeX files generated by | ||
| 4662 | @code{reftex-create-bibtex-file}. | ||
| 4663 | @end defopt | ||
| 4664 | |||
| 4665 | @defopt reftex-create-bibtex-footer | ||
| 4666 | Footer to insert in BibTeX files generated by | ||
| 4667 | @code{reftex-create-bibtex-file}. | ||
| 4668 | @end defopt | ||
| 4669 | |||
| 4670 | |||
| 4508 | @node Options (Index Support), Options (Viewing Cross-References), Options (Creating Citations), Options | 4671 | @node Options (Index Support), Options (Viewing Cross-References), Options (Creating Citations), Options |
| 4509 | @section Index Support | 4672 | @section Index Support |
| 4510 | @cindex Options, Index support | 4673 | @cindex Options, Index support |
| @@ -4553,7 +4716,7 @@ should be @samp{Molecules!}. | |||
| 4553 | @var{exclude} can be a function. If this function exists and returns a | 4716 | @var{exclude} can be a function. If this function exists and returns a |
| 4554 | non-@code{nil} value, the index entry at point is ignored. This was | 4717 | non-@code{nil} value, the index entry at point is ignored. This was |
| 4555 | implemented to support the (deprecated) @samp{^} and @samp{_} shortcuts | 4718 | implemented to support the (deprecated) @samp{^} and @samp{_} shortcuts |
| 4556 | in the LaTeX2e @code{index} package. | 4719 | in the @LaTeX{}2e @code{index} package. |
| 4557 | 4720 | ||
| 4558 | @var{repeat}, if non-@code{nil}, means the index macro does not typeset | 4721 | @var{repeat}, if non-@code{nil}, means the index macro does not typeset |
| 4559 | the entry in the text, so that the text has to be repeated outside the | 4722 | the entry in the text, so that the text has to be repeated outside the |
| @@ -4564,14 +4727,14 @@ The final entry may also be a symbol. It must have an association in | |||
| 4564 | the variable @code{reftex-index-macros-builtin} to specify the main | 4727 | the variable @code{reftex-index-macros-builtin} to specify the main |
| 4565 | indexing package you are using. Valid values are currently | 4728 | indexing package you are using. Valid values are currently |
| 4566 | @example | 4729 | @example |
| 4567 | default @r{The LaTeX default - unnecessary to specify this one} | 4730 | default @r{The @LaTeX{} default - unnecessary to specify this one} |
| 4568 | multind @r{The multind.sty package} | 4731 | multind @r{The multind.sty package} |
| 4569 | index @r{The index.sty package} | 4732 | index @r{The index.sty package} |
| 4570 | index-shortcut @r{The index.sty packages with the ^ and _ shortcuts.} | 4733 | index-shortcut @r{The index.sty packages with the ^ and _ shortcuts.} |
| 4571 | @r{Should not be used - only for old documents} | 4734 | @r{Should not be used - only for old documents} |
| 4572 | @end example | 4735 | @end example |
| 4573 | Note that AUCTeX sets these things internally for @b{Ref@TeX{}} as well, | 4736 | Note that @AUCTeX{} sets these things internally for @RefTeX{} as well, |
| 4574 | so with a sufficiently new version of AUCTeX, you should not set the | 4737 | so with a sufficiently new version of @AUCTeX{}, you should not set the |
| 4575 | package here. | 4738 | package here. |
| 4576 | @end defopt | 4739 | @end defopt |
| 4577 | 4740 | ||
| @@ -4584,7 +4747,7 @@ This is a list with @code{(@var{macro-key} @var{default-tag})}. | |||
| 4584 | 4747 | ||
| 4585 | @var{default-tag} is the tag to be used if the macro requires a | 4748 | @var{default-tag} is the tag to be used if the macro requires a |
| 4586 | @var{tag} argument. When this is @code{nil} and a @var{tag} is needed, | 4749 | @var{tag} argument. When this is @code{nil} and a @var{tag} is needed, |
| 4587 | @b{Ref@TeX{}} will ask for it. When this is the empty string and the | 4750 | @RefTeX{} will ask for it. When this is the empty string and the |
| 4588 | TAG argument of the index macro is optional, the TAG argument will be | 4751 | TAG argument of the index macro is optional, the TAG argument will be |
| 4589 | omitted. | 4752 | omitted. |
| 4590 | @end defopt | 4753 | @end defopt |
| @@ -4604,11 +4767,11 @@ last @r{The last used index tag will be offered as default} | |||
| 4604 | 4767 | ||
| 4605 | @defopt reftex-index-math-format | 4768 | @defopt reftex-index-math-format |
| 4606 | Format of index entries when copied from inside math mode. When | 4769 | Format of index entries when copied from inside math mode. When |
| 4607 | @code{reftex-index-selection-or-word} is executed inside TeX math mode, | 4770 | @code{reftex-index-selection-or-word} is executed inside @TeX{} math mode, |
| 4608 | the index key copied from the buffer is processed with this format | 4771 | the index key copied from the buffer is processed with this format |
| 4609 | string through the @code{format} function. This can be used to add the | 4772 | string through the @code{format} function. This can be used to add the |
| 4610 | math delimiters (e.g. @samp{$}) to the string. Requires the | 4773 | math delimiters (e.g. @samp{$}) to the string. Requires the |
| 4611 | @file{texmathp.el} library which is part of AUCTeX. | 4774 | @file{texmathp.el} library which is part of @AUCTeX{}. |
| 4612 | @end defopt | 4775 | @end defopt |
| 4613 | 4776 | ||
| 4614 | @defopt reftex-index-phrase-file-extension | 4777 | @defopt reftex-index-phrase-file-extension |
| @@ -4660,7 +4823,7 @@ When doing global indexing from the phrases buffer, searches for some | |||
| 4660 | phrases may match at places where that phrase was already indexed. In | 4823 | phrases may match at places where that phrase was already indexed. In |
| 4661 | particular when indexing an already processed document again, this | 4824 | particular when indexing an already processed document again, this |
| 4662 | will even be the norm. When this variable is non-@code{nil}, | 4825 | will even be the norm. When this variable is non-@code{nil}, |
| 4663 | @b{Ref@TeX{}} checks if the match is an index macro argument, or if an | 4826 | @RefTeX{} checks if the match is an index macro argument, or if an |
| 4664 | index macro is directly before or after the phrase. If that is the | 4827 | index macro is directly before or after the phrase. If that is the |
| 4665 | case, that match will be ignored. | 4828 | case, that match will be ignored. |
| 4666 | @end defopt | 4829 | @end defopt |
| @@ -4701,7 +4864,7 @@ Normal hook which is run when a buffer is put into | |||
| 4701 | The letters which denote sections in the index. Usually these are all | 4864 | The letters which denote sections in the index. Usually these are all |
| 4702 | capital letters. Don't use any downcase letters. Order is not | 4865 | capital letters. Don't use any downcase letters. Order is not |
| 4703 | significant, the index will be sorted by whatever the sort function | 4866 | significant, the index will be sorted by whatever the sort function |
| 4704 | thinks is correct. In addition to these letters, @b{Ref@TeX{}} will | 4867 | thinks is correct. In addition to these letters, @RefTeX{} will |
| 4705 | create a group @samp{!} which contains all entries sorted below the | 4868 | create a group @samp{!} which contains all entries sorted below the |
| 4706 | lowest specified letter. In the @file{*Index*} buffer, pressing any of | 4869 | lowest specified letter. In the @file{*Index*} buffer, pressing any of |
| 4707 | these capital letters or @kbd{!} will jump to that section. | 4870 | these capital letters or @kbd{!} will jump to that section. |
| @@ -4773,7 +4936,7 @@ escapes. | |||
| 4773 | Non-@code{nil} means, automatic citation display will revisit files if | 4936 | Non-@code{nil} means, automatic citation display will revisit files if |
| 4774 | necessary. When nil, citation display in echo area will only be active | 4937 | necessary. When nil, citation display in echo area will only be active |
| 4775 | for cached echo strings (see @code{reftex-cache-cite-echo}), or for | 4938 | for cached echo strings (see @code{reftex-cache-cite-echo}), or for |
| 4776 | BibTeX database files which are already visited by a live associated | 4939 | @BibTeX{} database files which are already visited by a live associated |
| 4777 | buffers. | 4940 | buffers. |
| 4778 | @end defopt | 4941 | @end defopt |
| 4779 | 4942 | ||
| @@ -4790,7 +4953,7 @@ scans. In order to clear it, use @kbd{M-x reftex-reset-mode}. | |||
| 4790 | @cindex Finding files, options | 4953 | @cindex Finding files, options |
| 4791 | 4954 | ||
| 4792 | @defopt reftex-texpath-environment-variables | 4955 | @defopt reftex-texpath-environment-variables |
| 4793 | List of specifications how to retrieve the search path for TeX files. | 4956 | List of specifications how to retrieve the search path for @TeX{} files. |
| 4794 | Several entries are possible. | 4957 | Several entries are possible. |
| 4795 | @itemize @minus | 4958 | @itemize @minus |
| 4796 | @item | 4959 | @item |
| @@ -4809,7 +4972,7 @@ be expanded recursively. See also @code{reftex-use-external-file-finders}. | |||
| 4809 | @end defopt | 4972 | @end defopt |
| 4810 | 4973 | ||
| 4811 | @defopt reftex-bibpath-environment-variables | 4974 | @defopt reftex-bibpath-environment-variables |
| 4812 | List of specifications how to retrieve the search path for BibTeX | 4975 | List of specifications how to retrieve the search path for @BibTeX{} |
| 4813 | files. Several entries are possible. | 4976 | files. Several entries are possible. |
| 4814 | @itemize @minus | 4977 | @itemize @minus |
| 4815 | @item | 4978 | @item |
| @@ -4847,14 +5010,14 @@ then @samp{/tex/}, and then all subdirectories of @samp{./}. If this | |||
| 4847 | option is @code{nil}, the subdirectories of @samp{./} are searched | 5010 | option is @code{nil}, the subdirectories of @samp{./} are searched |
| 4848 | before @samp{/tex/}. This is mainly for speed - most of the time the | 5011 | before @samp{/tex/}. This is mainly for speed - most of the time the |
| 4849 | recursive path is for the system files and not for the user files. Set | 5012 | recursive path is for the system files and not for the user files. Set |
| 4850 | this to @code{nil} if the default makes @b{Ref@TeX{}} finding files with | 5013 | this to @code{nil} if the default makes @RefTeX{} finding files with |
| 4851 | equal names in wrong sequence. | 5014 | equal names in wrong sequence. |
| 4852 | @end defopt | 5015 | @end defopt |
| 4853 | 5016 | ||
| 4854 | @defopt reftex-use-external-file-finders | 5017 | @defopt reftex-use-external-file-finders |
| 4855 | Non-@code{nil} means, use external programs to find files. Normally, | 5018 | Non-@code{nil} means, use external programs to find files. Normally, |
| 4856 | @b{Ref@TeX{}} searches the paths given in the environment variables | 5019 | @RefTeX{} searches the paths given in the environment variables |
| 4857 | @code{TEXINPUTS} and @code{BIBINPUTS} to find TeX files and BibTeX | 5020 | @code{TEXINPUTS} and @code{BIBINPUTS} to find @TeX{} files and @BibTeX{} |
| 4858 | database files. With this option turned on, it calls an external | 5021 | database files. With this option turned on, it calls an external |
| 4859 | program specified in the option @code{reftex-external-file-finders} | 5022 | program specified in the option @code{reftex-external-file-finders} |
| 4860 | instead. As a side effect, the variables | 5023 | instead. As a side effect, the variables |
| @@ -4881,14 +5044,14 @@ non-@code{nil}. | |||
| 4881 | 5044 | ||
| 4882 | @defopt reftex-keep-temporary-buffers | 5045 | @defopt reftex-keep-temporary-buffers |
| 4883 | Non-@code{nil} means, keep buffers created for parsing and lookup. | 5046 | Non-@code{nil} means, keep buffers created for parsing and lookup. |
| 4884 | @b{Ref@TeX{}} sometimes needs to visit files related to the current | 5047 | @RefTeX{} sometimes needs to visit files related to the current |
| 4885 | document. We distinguish files visited for | 5048 | document. We distinguish files visited for |
| 4886 | @table @asis | 5049 | @table @asis |
| 4887 | @item PARSING | 5050 | @item PARSING |
| 4888 | Parts of a multifile document loaded when (re)-parsing the | 5051 | Parts of a multifile document loaded when (re)-parsing the |
| 4889 | document. | 5052 | document. |
| 4890 | @item LOOKUP | 5053 | @item LOOKUP |
| 4891 | BibTeX database files and TeX files loaded to find a reference, to | 5054 | @BibTeX{} database files and @TeX{} files loaded to find a reference, to |
| 4892 | display label context, etc. | 5055 | display label context, etc. |
| 4893 | @end table | 5056 | @end table |
| 4894 | The created buffers can be kept for later use, or be thrown away | 5057 | The created buffers can be kept for later use, or be thrown away |
| @@ -4912,7 +5075,7 @@ away, the initialization of the buffer depends upon the variable | |||
| 4912 | 5075 | ||
| 4913 | @defopt reftex-initialize-temporary-buffers | 5076 | @defopt reftex-initialize-temporary-buffers |
| 4914 | Non-@code{nil} means do initializations even when visiting file | 5077 | Non-@code{nil} means do initializations even when visiting file |
| 4915 | temporarily. When @code{nil}, @b{Ref@TeX{}} may turn off find-file hooks and | 5078 | temporarily. When @code{nil}, @RefTeX{} may turn off find-file hooks and |
| 4916 | other stuff to briefly visit a file. When @code{t}, the full default | 5079 | other stuff to briefly visit a file. When @code{t}, the full default |
| 4917 | initializations are done (@code{find-file-hook} etc.). Instead of | 5080 | initializations are done (@code{find-file-hook} etc.). Instead of |
| 4918 | @code{t} or @code{nil}, this variable may also be a list of hook | 5081 | @code{t} or @code{nil}, this variable may also be a list of hook |
| @@ -4923,12 +5086,12 @@ functions to do a minimal initialization. | |||
| 4923 | List of regular expressions to exclude certain input files from parsing. | 5086 | List of regular expressions to exclude certain input files from parsing. |
| 4924 | If the name of a file included via @code{\include} or @code{\input} is | 5087 | If the name of a file included via @code{\include} or @code{\input} is |
| 4925 | matched by any of the regular expressions in this list, that file is not | 5088 | matched by any of the regular expressions in this list, that file is not |
| 4926 | parsed by @b{Ref@TeX{}}. | 5089 | parsed by @RefTeX{}. |
| 4927 | @end defopt | 5090 | @end defopt |
| 4928 | 5091 | ||
| 4929 | @defopt reftex-enable-partial-scans | 5092 | @defopt reftex-enable-partial-scans |
| 4930 | Non-@code{nil} means, re-parse only 1 file when asked to re-parse. | 5093 | Non-@code{nil} means, re-parse only 1 file when asked to re-parse. |
| 4931 | Re-parsing is normally requested with a @kbd{C-u} prefix to many @b{Ref@TeX{}} | 5094 | Re-parsing is normally requested with a @kbd{C-u} prefix to many @RefTeX{} |
| 4932 | commands, or with the @kbd{r} key in menus. When this option is | 5095 | commands, or with the @kbd{r} key in menus. When this option is |
| 4933 | @code{t} in a multifile document, we will only parse the current buffer, | 5096 | @code{t} in a multifile document, we will only parse the current buffer, |
| 4934 | or the file associated with the label or section heading near point in a | 5097 | or the file associated with the label or section heading near point in a |
| @@ -4958,7 +5121,7 @@ This extension is added to the base name of the master file. | |||
| 4958 | @end defopt | 5121 | @end defopt |
| 4959 | 5122 | ||
| 4960 | @defopt reftex-allow-automatic-rescan | 5123 | @defopt reftex-allow-automatic-rescan |
| 4961 | Non-@code{nil} means, @b{Ref@TeX{}} may rescan the document when this seems | 5124 | Non-@code{nil} means, @RefTeX{} may rescan the document when this seems |
| 4962 | necessary. Applies (currently) only in rare cases, when a new label | 5125 | necessary. Applies (currently) only in rare cases, when a new label |
| 4963 | cannot be placed with certainty into the internal label list. | 5126 | cannot be placed with certainty into the internal label list. |
| 4964 | @end defopt | 5127 | @end defopt |
| @@ -5092,8 +5255,8 @@ map. @xref{Key Bindings}. | |||
| 5092 | @end defopt | 5255 | @end defopt |
| 5093 | 5256 | ||
| 5094 | @defopt reftex-plug-into-AUCTeX | 5257 | @defopt reftex-plug-into-AUCTeX |
| 5095 | Plug-in flags for AUCTeX interface. This variable is a list of | 5258 | Plug-in flags for @AUCTeX{} interface. This variable is a list of |
| 5096 | 5 boolean flags. When a flag is non-@code{nil}, @b{Ref@TeX{}} | 5259 | 5 boolean flags. When a flag is non-@code{nil}, @RefTeX{} |
| 5097 | will | 5260 | will |
| 5098 | 5261 | ||
| 5099 | @example | 5262 | @example |
| @@ -5110,7 +5273,7 @@ Supplying labels in new sections and environments applies when creating | |||
| 5110 | sections with @kbd{C-c C-s} and environments with @kbd{C-c C-e}.@* | 5273 | sections with @kbd{C-c C-s} and environments with @kbd{C-c C-e}.@* |
| 5111 | Supplying macro arguments applies when you insert such a macro | 5274 | Supplying macro arguments applies when you insert such a macro |
| 5112 | interactively with @kbd{C-c @key{RET}}.@* | 5275 | interactively with @kbd{C-c @key{RET}}.@* |
| 5113 | See the AUCTeX documentation for more information. | 5276 | See the @AUCTeX{} documentation for more information. |
| 5114 | @end defopt | 5277 | @end defopt |
| 5115 | 5278 | ||
| 5116 | @defopt reftex-revisit-to-follow | 5279 | @defopt reftex-revisit-to-follow |
| @@ -5130,10 +5293,10 @@ argument. | |||
| 5130 | @section Keymaps and Hooks | 5293 | @section Keymaps and Hooks |
| 5131 | @cindex Keymaps | 5294 | @cindex Keymaps |
| 5132 | 5295 | ||
| 5133 | @b{Ref@TeX{}} has the usual general keymap and load-- and mode-hook. | 5296 | @RefTeX{} has the usual general keymap, load hook and mode hook. |
| 5134 | 5297 | ||
| 5135 | @deffn Keymap reftex-mode-map | 5298 | @deffn Keymap reftex-mode-map |
| 5136 | The keymap for @b{Ref@TeX{}} mode. | 5299 | The keymap for @RefTeX{} mode. |
| 5137 | @end deffn | 5300 | @end deffn |
| 5138 | 5301 | ||
| 5139 | @deffn {Normal Hook} reftex-load-hook | 5302 | @deffn {Normal Hook} reftex-load-hook |
| @@ -5141,20 +5304,54 @@ Normal hook which is being run when loading @file{reftex.el}. | |||
| 5141 | @end deffn | 5304 | @end deffn |
| 5142 | 5305 | ||
| 5143 | @deffn {Normal Hook} reftex-mode-hook | 5306 | @deffn {Normal Hook} reftex-mode-hook |
| 5144 | Normal hook which is being run when turning on @b{Ref@TeX{}} mode. | 5307 | Normal hook which is being run when turning on @RefTeX{} mode. |
| 5145 | @end deffn | 5308 | @end deffn |
| 5146 | 5309 | ||
| 5147 | Furthermore, the 4 modes used for referencing labels, creating | 5310 | Furthermore, the four modes used for referencing labels, creating |
| 5148 | citations, the table of contents buffer and the phrases buffer have | 5311 | citations, the table of contents buffer and the phrases buffer have |
| 5149 | their own keymaps and mode hooks. See the respective sections. There | 5312 | their own keymaps and mode hooks. See the respective sections. There |
| 5150 | are many more hooks which are described in the relevant sections about | 5313 | are many more hooks which are described in the relevant sections about |
| 5151 | options for a specific part of @b{Ref@TeX{}}. | 5314 | options for a specific part of @RefTeX{}. |
| 5152 | 5315 | ||
| 5153 | @node Changes, GNU Free Documentation License, Keymaps and Hooks, Top | 5316 | @node Changes, GNU Free Documentation License, Keymaps and Hooks, Top |
| 5154 | @chapter Changes | 5317 | @chapter Changes |
| 5155 | @cindex Changes | 5318 | @cindex Changes |
| 5156 | 5319 | ||
| 5157 | Here is a list of recent changes to @b{Ref@TeX{}}. | 5320 | Here is a list of recent changes to @RefTeX{}. |
| 5321 | |||
| 5322 | @noindent @b{Version 4.33} | ||
| 5323 | |||
| 5324 | @itemize @bullet | ||
| 5325 | @item | ||
| 5326 | Update to GPLv3. | ||
| 5327 | @item | ||
| 5328 | Parse files are created in a way that does not interfere with recentf | ||
| 5329 | mode. | ||
| 5330 | @end itemize | ||
| 5331 | |||
| 5332 | @noindent @b{Version 4.32} | ||
| 5333 | |||
| 5334 | @itemize @bullet | ||
| 5335 | @item | ||
| 5336 | First release by @AUCTeX{} project. | ||
| 5337 | @item | ||
| 5338 | Installation routine rewritten after structure of source package | ||
| 5339 | changed. | ||
| 5340 | @item | ||
| 5341 | Activation of @RefTeX{} changed, so make sure you read the installation | ||
| 5342 | instructions and remove obsolete cruft related to @RefTeX{} from your | ||
| 5343 | init file. | ||
| 5344 | @item | ||
| 5345 | Fixed bug where point would end up in the wrong buffer when jumping | ||
| 5346 | between several @LaTeX{} and phrases buffers. | ||
| 5347 | @item | ||
| 5348 | Fixed bug where @BibTeX{} keys with hyphens were parsed incorrectly. | ||
| 5349 | @item | ||
| 5350 | Some performance improvements. | ||
| 5351 | @item | ||
| 5352 | The separator used between multiple citations in a \cite macro can now | ||
| 5353 | be changed by customizing the variable @code{reftex-cite-key-separator}. | ||
| 5354 | @end itemize | ||
| 5158 | 5355 | ||
| 5159 | @noindent @b{Version 4.28} | 5356 | @noindent @b{Version 4.28} |
| 5160 | @itemize @bullet | 5357 | @itemize @bullet |
| @@ -5504,7 +5701,7 @@ Option @code{reftex-bibfile-ignore-list} renamed to @code{-regexps}. | |||
| 5504 | @item | 5701 | @item |
| 5505 | Expansion of recursive tex and bib path rewritten. | 5702 | Expansion of recursive tex and bib path rewritten. |
| 5506 | @item | 5703 | @item |
| 5507 | Fixed problem where @b{Ref@TeX{}} did not scan unsaved buffers. | 5704 | Fixed problem where @RefTeX{} did not scan unsaved buffers. |
| 5508 | @item | 5705 | @item |
| 5509 | Fixed bug with section numbering after *-red sections. | 5706 | Fixed bug with section numbering after *-red sections. |
| 5510 | @end itemize | 5707 | @end itemize |
| @@ -5571,15 +5768,15 @@ variable @code{reftex-auto-view-crossref}. | |||
| 5571 | AUCTeX interface updates: | 5768 | AUCTeX interface updates: |
| 5572 | @itemize @minus | 5769 | @itemize @minus |
| 5573 | @item | 5770 | @item |
| 5574 | AUCTeX 9.9c and later notifies @b{Ref@TeX{}} about new sections. | 5771 | AUCTeX 9.9c and later notifies @RefTeX{} about new sections. |
| 5575 | @item | 5772 | @item |
| 5576 | @b{Ref@TeX{}} notifies AUCTeX about new labels. | 5773 | @RefTeX{} notifies AUCTeX about new labels. |
| 5577 | @item | 5774 | @item |
| 5578 | @code{TeX-arg-ref} no longer used (introduction was unnecessary). | 5775 | @code{TeX-arg-ref} no longer used (introduction was unnecessary). |
| 5579 | @item | 5776 | @item |
| 5580 | @code{reftex-arg-label} and @code{reftex-arg-cite} fixed up. | 5777 | @code{reftex-arg-label} and @code{reftex-arg-cite} fixed up. |
| 5581 | @item | 5778 | @item |
| 5582 | Settings added to @b{Ref@TeX{}} via style files remain local. | 5779 | Settings added to @RefTeX{} via style files remain local. |
| 5583 | @end itemize | 5780 | @end itemize |
| 5584 | @item | 5781 | @item |
| 5585 | Fixed bug with @code{reftex-citation} in non-latex buffers. | 5782 | Fixed bug with @code{reftex-citation} in non-latex buffers. |
| @@ -5601,7 +5798,7 @@ Fixed bug with empty context strings. | |||
| 5601 | @noindent @b{Version 3.21} | 5798 | @noindent @b{Version 3.21} |
| 5602 | @itemize @bullet | 5799 | @itemize @bullet |
| 5603 | @item | 5800 | @item |
| 5604 | New options for all faces used by @b{Ref@TeX{}}. They're in the | 5801 | New options for all faces used by @RefTeX{}. They're in the |
| 5605 | customization group @code{reftex-fontification-configurations}. | 5802 | customization group @code{reftex-fontification-configurations}. |
| 5606 | @end itemize | 5803 | @end itemize |
| 5607 | 5804 | ||
| @@ -5627,7 +5824,7 @@ Fixed some problems regarding the interaction with VIPER mode. | |||
| 5627 | @item | 5824 | @item |
| 5628 | Follow-mode is now only used after point motion. | 5825 | Follow-mode is now only used after point motion. |
| 5629 | @item | 5826 | @item |
| 5630 | @b{Ref@TeX{}} now finally does not fontify temporary files anymore. | 5827 | @RefTeX{} now finally does not fontify temporary files anymore. |
| 5631 | @end itemize | 5828 | @end itemize |
| 5632 | 5829 | ||
| 5633 | @noindent @b{Version 3.17} | 5830 | @noindent @b{Version 3.17} |
| @@ -5740,7 +5937,7 @@ Search for input and @file{.bib} files with recursive path definitions. | |||
| 5740 | @noindent @b{Version 3.00} | 5937 | @noindent @b{Version 3.00} |
| 5741 | @itemize @bullet | 5938 | @itemize @bullet |
| 5742 | @item | 5939 | @item |
| 5743 | @b{Ref@TeX{}} should work better for very large projects: | 5940 | @RefTeX{} should work better for very large projects: |
| 5744 | @item | 5941 | @item |
| 5745 | The new parser works without creating a master buffer. | 5942 | The new parser works without creating a master buffer. |
| 5746 | @item | 5943 | @item |
| @@ -5748,19 +5945,19 @@ Rescanning can be limited to a part of a multifile document. | |||
| 5748 | @item | 5945 | @item |
| 5749 | Information from the parser can be stored in a file. | 5946 | Information from the parser can be stored in a file. |
| 5750 | @item | 5947 | @item |
| 5751 | @b{Ref@TeX{}} can deal with macros having a naked label as an argument. | 5948 | @RefTeX{} can deal with macros having a naked label as an argument. |
| 5752 | @item | 5949 | @item |
| 5753 | Macros may have white space and newlines between arguments. | 5950 | Macros may have white space and newlines between arguments. |
| 5754 | @item | 5951 | @item |
| 5755 | Multiple identical section headings no longer confuse | 5952 | Multiple identical section headings no longer confuse |
| 5756 | @code{reftex-toc}. | 5953 | @code{reftex-toc}. |
| 5757 | @item | 5954 | @item |
| 5758 | @b{Ref@TeX{}} should work correctly in combination with buffer-altering | 5955 | @RefTeX{} should work correctly in combination with buffer-altering |
| 5759 | packages like outline, folding, x-symbol, iso-cvt, isotex, etc. | 5956 | packages like outline, folding, x-symbol, iso-cvt, isotex, etc. |
| 5760 | @item | 5957 | @item |
| 5761 | All labeled environments discussed in @emph{The LaTeX Companion} by | 5958 | All labeled environments discussed in @emph{The LaTeX Companion} by |
| 5762 | Goossens, Mittelbach & Samarin, Addison-Wesley 1994) are part of | 5959 | Goossens, Mittelbach & Samarin, Addison-Wesley 1994) are part of |
| 5763 | @b{Ref@TeX{}}'s defaults. | 5960 | @RefTeX{}'s defaults. |
| 5764 | @end itemize | 5961 | @end itemize |
| 5765 | 5962 | ||
| 5766 | @noindent @b{Version 2.17} | 5963 | @noindent @b{Version 2.17} |
| @@ -5858,7 +6055,7 @@ MS-DOS support. | |||
| 5858 | @noindent @b{Version 1.07} | 6055 | @noindent @b{Version 1.07} |
| 5859 | @itemize @bullet | 6056 | @itemize @bullet |
| 5860 | @item | 6057 | @item |
| 5861 | @b{Ref@TeX{}} gets its own menu. | 6058 | @RefTeX{} gets its own menu. |
| 5862 | @end itemize | 6059 | @end itemize |
| 5863 | 6060 | ||
| 5864 | @noindent @b{Version 1.05} | 6061 | @noindent @b{Version 1.05} |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 38dacef1fd8..902bf63be72 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,146 @@ | |||
| 1 | 2012-09-30 Ralf Angeli <angeli@caeruleus.net> | ||
| 2 | |||
| 3 | Merge from standalone RefTeX repository. | ||
| 4 | |||
| 5 | The following ChangeLog entries are shortened versions of the | ||
| 6 | original ones with file paths adapted. A not so strongly edited | ||
| 7 | version of the original ChangeLog can be found in the commit log. | ||
| 8 | |||
| 9 | * textmodes/reftex-auc.el: Move `provide' call to bottom of file. | ||
| 10 | (reftex-arg-cite): Use `reftex-cite-key-separator'. Correctly | ||
| 11 | handle new value type returned by `reftex-citation'. | ||
| 12 | |||
| 13 | * textmodes/reftex-cite.el (reftex-create-bibtex-file): Make sure | ||
| 14 | that entries with whitespace at various places are found. Doc | ||
| 15 | fix. Include entries that are cross-referenced from cited entries. | ||
| 16 | Include @String definitions in the resulting bib file. Add header | ||
| 17 | and footer defined in `reftex-create-bibtex-header' and | ||
| 18 | `reftex-create-bibtex-footer'. | ||
| 19 | (reftex-do-citation): Make it possible again to insert | ||
| 20 | non-existent entries. Save match data when asking for optional | ||
| 21 | arguments. Return all keys, not just the first one. | ||
| 22 | (reftex-all-used-citation-keys): Fix regexp to correctly extract | ||
| 23 | all citations in the same line. | ||
| 24 | (reftex-parse-bibtex-entry): Accept additional optional argument | ||
| 25 | `raw' and keep quotes or braces if it is non-nil. Match fields | ||
| 26 | containing hyphens besides word constituents. | ||
| 27 | (reftex-get-string-refs): New function. | ||
| 28 | (reftex-extract-bib-entries): Check if BibTeX file changed on disk | ||
| 29 | and ask if it should be reread in case it did. | ||
| 30 | (reftex-pop-to-bibtex-entry) | ||
| 31 | (reftex-extract-bib-entries-from-thebibliography): Match \bibitem | ||
| 32 | entries with spaces or tabs in front of arguments. | ||
| 33 | (reftex-pop-to-bibtex-entry, reftex-extract-bib-entries) | ||
| 34 | (reftex-parse-bibtex-entry, reftex-create-bibtex-file): Match | ||
| 35 | entries containing numbers and symbol constituents. | ||
| 36 | (reftex-do-citation, reftex-figure-out-cite-format): Use | ||
| 37 | `reftex-cite-key-separator'. | ||
| 38 | |||
| 39 | * textmodes/reftex-dcr.el: Move provide statement to end of file. | ||
| 40 | (reftex-mouse-view-crossref): Explain why point is set. | ||
| 41 | |||
| 42 | * textmodes/reftex-global.el: Whitespace changes. | ||
| 43 | |||
| 44 | * textmodes/reftex-index.el: Move provide statement to end of | ||
| 45 | file. | ||
| 46 | (reftex-index-selection-or-word): Use `reftex-region-active-p'. | ||
| 47 | (reftex-index-visit-phrases-buffer): Set marker when visiting | ||
| 48 | buffer. This allows for returning from the phrases file to the | ||
| 49 | file one was just editing instead of the file where the last | ||
| 50 | phrases was added from. | ||
| 51 | (reftex-index-phrases-syntax-table): New variable. Give ?\" | ||
| 52 | punctuation syntax as it usually is not used as string quote in | ||
| 53 | TeX-related modes and may occur unmatched. The change also | ||
| 54 | prevents fontification of quoted content. | ||
| 55 | (reftex-index-phrases-mode): Use it. | ||
| 56 | |||
| 57 | * textmodes/reftex-parse.el (reftex-parse-from-file): Move | ||
| 58 | backward one char if a `\' was matched after a section macro. | ||
| 59 | (reftex-parse-from-file): Use beginning of match instead of end as | ||
| 60 | bound. | ||
| 61 | |||
| 62 | * textmodes/reftex-ref.el: Adapt creation of | ||
| 63 | `reftex-<package>-<macro>' functions to new structure of | ||
| 64 | `reftex-ref-style-alist'. | ||
| 65 | (reftex-reference): Use `reftex-ref-style-list' function. Adapt | ||
| 66 | to new structure of `reftex-ref-style-alist'. Prompt for a | ||
| 67 | reference macro if `reftex-ref-macro-prompt' is non-nil. | ||
| 68 | (reftex-reference): Pass refstyle to `reftex-format-special'. | ||
| 69 | Determine reference macro by looking at | ||
| 70 | `reftex-ref-style-default-list' and `reftex-ref-style-alist'. Use | ||
| 71 | only one special format function. | ||
| 72 | (reftex-varioref-vref, reftex-fancyref-fref) | ||
| 73 | (reftex-fancyref-Fref): Remove definitions. The functions are now | ||
| 74 | generated from `reftex-ref-style-alist'. | ||
| 75 | (reftex-format-vref, reftex-format-Fref, reftex-format-fref): | ||
| 76 | Remove. | ||
| 77 | (reftex-format-special): New function. | ||
| 78 | |||
| 79 | * textmodes/reftex-sel.el | ||
| 80 | (reftex-select-cycle-ref-style-internal): Adapt to new structure | ||
| 81 | of `reftex-ref-style-alist'. Remove code for testing macro type. | ||
| 82 | (reftex-select-toggle-varioref) | ||
| 83 | (reftex-select-toggle-fancyref): Remove. | ||
| 84 | (reftex-select-cycle-ref-style-internal) | ||
| 85 | (reftex-select-cycle-ref-style-forward) | ||
| 86 | (reftex-select-cycle-ref-style-backward): New functions. | ||
| 87 | (reftex-select-label-map): Use `v' and `V' for general cycling | ||
| 88 | through reference styles. Add `p' for switching between number | ||
| 89 | and page reference types. | ||
| 90 | |||
| 91 | * textmodes/reftex-toc.el (reftex-re-enlarge): Call | ||
| 92 | `enlarge-window' only if there is something to do because in Emacs | ||
| 93 | the horizontal version throws an error even if the parameter is 0. | ||
| 94 | |||
| 95 | * textmodes/reftex-vars.el (reftex-label-alist): Doc fix. | ||
| 96 | (reftex-plug-into-AUCTeX): Doc fix. | ||
| 97 | (reftex-vref-is-default, reftex-fref-is-default): Adapt doc | ||
| 98 | string. Adapt to new name. | ||
| 99 | (reftex-ref-style-alist): Change structure so that it is not | ||
| 100 | possible to use multiple different package names within a style. | ||
| 101 | Remove the symbols for symbols for macro type distinction. Add | ||
| 102 | characters for macro selection. | ||
| 103 | (reftex-ref-macro-prompt, reftex-create-bibtex-header) | ||
| 104 | (reftex-create-bibtex-footer): New variables. | ||
| 105 | (reftex-format-ref-function): Mention third argument of special | ||
| 106 | format function. | ||
| 107 | (reftex-ref-style-alist, reftex-ref-style-default-list): New | ||
| 108 | variables. | ||
| 109 | (reftex-vref-is-default, reftex-fref-is-default): Adapt doc string | ||
| 110 | to new implementation. Mark as obsolete. Add compatibility code | ||
| 111 | for honoring the variable values in case they are set. | ||
| 112 | (reftex-cite-format-builtin, reftex-bibliography-commands): Add | ||
| 113 | support for ConTeXt. | ||
| 114 | (reftex-format-ref-function, reftex-format-cite-function): Fix | ||
| 115 | custom type. | ||
| 116 | (reftex-cite-key-separator): New variable. | ||
| 117 | |||
| 118 | * textmodes/reftex.el (reftex-syntax-table-for-bib) | ||
| 119 | (reftex-mode): Do not derive `reftex-syntax-table-for-bib' from | ||
| 120 | `reftex-syntax-table' because parens have to retain their paren | ||
| 121 | syntax in order for parsing of BibTeX entries like @book(...) to | ||
| 122 | work. | ||
| 123 | (reftex-in-comment): Do not error out if `comment-start-skip' is | ||
| 124 | not set. Deal correctly with escaped comment characters. | ||
| 125 | (reftex-tie-multifile-symbols): Add doc string. Initialize | ||
| 126 | `reftex-ref-style-list'. | ||
| 127 | (reftex-untie-multifile-symbols): Add doc string. | ||
| 128 | (reftex-add-index-macros): Doc fix. | ||
| 129 | (reftex-ref-style-activate, reftex-ref-style-toggle) | ||
| 130 | (reftex-ref-style-list): New functions. | ||
| 131 | (reftex-mode-menu): Use them. Adapt to new structure of | ||
| 132 | `reftex-ref-style-alist'. | ||
| 133 | (reftex-select-with-char): Kill the RefTeX Select buffer when | ||
| 134 | done. | ||
| 135 | (reftex-remove-if): New function. | ||
| 136 | (reftex-erase-all-selection-and-index-buffers) | ||
| 137 | (reftex-mode-menu): Reference styles are now computed from | ||
| 138 | `reftex-ref-style-alist'. Fix typo. | ||
| 139 | (reftex-report-bug): New function. | ||
| 140 | (reftex-uniquify, reftex-uniquify-by-car): Replace O(n^2) | ||
| 141 | algorithms with O(n log n). Introduce optional argument SORT (not | ||
| 142 | yet used). | ||
| 143 | |||
| 1 | 2012-09-30 Fabián Ezequiel Gallina <fgallina@cuca> | 144 | 2012-09-30 Fabián Ezequiel Gallina <fgallina@cuca> |
| 2 | 145 | ||
| 3 | Enhancements for triple-quote string syntax. | 146 | Enhancements for triple-quote string syntax. |
diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el index 3a875f0dfa3..72013c5b241 100644 --- a/lisp/textmodes/reftex-auc.el +++ b/lisp/textmodes/reftex-auc.el | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> |
| 6 | ;; Maintainer: auctex-devel@gnu.org | 6 | ;; Maintainer: auctex-devel@gnu.org |
| 7 | ;; Version: 4.31 | ||
| 8 | ;; Package: reftex | ||
| 9 | 7 | ||
| 10 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 11 | 9 | ||
| @@ -27,21 +25,21 @@ | |||
| 27 | ;;; Code: | 25 | ;;; Code: |
| 28 | 26 | ||
| 29 | (eval-when-compile (require 'cl)) | 27 | (eval-when-compile (require 'cl)) |
| 30 | (provide 'reftex-auc) | 28 | |
| 31 | (require 'reftex) | 29 | (require 'reftex) |
| 32 | ;;; | 30 | |
| 33 | 31 | (declare-function TeX-argument-prompt "ext:tex" | |
| 34 | (declare-function TeX-argument-insert "ext:tex" (name optional &optional prefix)) | 32 | (optional prompt default &optional complete)) |
| 35 | (declare-function TeX-argument-prompt "ext:tex" (optional prompt default &optional complete)) | 33 | (declare-function TeX-argument-insert "ext:tex" |
| 36 | (declare-function multi-prompt "ext:multi-prompt" | 34 | (name optional &optional prefix)) |
| 37 | (separator | ||
| 38 | unique prompt table | ||
| 39 | &optional mp-predicate require-match initial history)) | ||
| 40 | (declare-function LaTeX-add-index-entries "ext:tex" (&rest entries) t) | ||
| 41 | (declare-function LaTeX-add-labels "ext:tex" (&rest entries) t) | 35 | (declare-function LaTeX-add-labels "ext:tex" (&rest entries) t) |
| 36 | (declare-function LaTeX-add-index-entries "ext:tex" (&rest entries) t) | ||
| 42 | (declare-function LaTeX-bibitem-list "ext:tex" () t) | 37 | (declare-function LaTeX-bibitem-list "ext:tex" () t) |
| 43 | (declare-function LaTeX-index-entry-list "ext:tex" () t) | 38 | (declare-function LaTeX-index-entry-list "ext:tex" () t) |
| 44 | (declare-function LaTeX-label-list "ext:tex" () t) | 39 | (declare-function LaTeX-label-list "ext:tex" () t) |
| 40 | (declare-function multi-prompt "ext:multi-prompt" | ||
| 41 | (separator unique prompt table &optional | ||
| 42 | mp-predicate require-match initial history)) | ||
| 45 | 43 | ||
| 46 | (defun reftex-plug-flag (which) | 44 | (defun reftex-plug-flag (which) |
| 47 | ;; Tell if a certain flag is set in reftex-plug-into-AUCTeX | 45 | ;; Tell if a certain flag is set in reftex-plug-into-AUCTeX |
| @@ -76,14 +74,15 @@ What is being used depends upon `reftex-plug-into-AUCTeX'." | |||
| 76 | (let (items) | 74 | (let (items) |
| 77 | (cond | 75 | (cond |
| 78 | ((and (not definition) (reftex-plug-flag 3)) | 76 | ((and (not definition) (reftex-plug-flag 3)) |
| 79 | (setq items (list (or (reftex-citation t) "")))) | 77 | (setq items (or (reftex-citation t) (list "")))) |
| 80 | (t | 78 | (t |
| 81 | (setq prompt (concat (if optional "(Optional) " "") | 79 | (setq prompt (concat (if optional "(Optional) " "") |
| 82 | (if prompt prompt "Add key") | 80 | (if prompt prompt "Add key") |
| 83 | " (default none): ")) | 81 | " (default none): ")) |
| 84 | (setq items (multi-prompt "," t prompt (LaTeX-bibitem-list))))) | 82 | (setq items (multi-prompt "," t prompt (LaTeX-bibitem-list))))) |
| 85 | (apply 'LaTeX-add-bibitems items) | 83 | (apply 'LaTeX-add-bibitems items) |
| 86 | (TeX-argument-insert (mapconcat 'identity items ",") optional))) | 84 | (TeX-argument-insert (mapconcat 'identity items reftex-cite-key-separator) |
| 85 | optional))) | ||
| 87 | 86 | ||
| 88 | 87 | ||
| 89 | (defun reftex-arg-index-tag (optional &optional prompt &rest args) | 88 | (defun reftex-arg-index-tag (optional &optional prompt &rest args) |
| @@ -223,4 +222,6 @@ of ENTRY-LIST is a list of cons cells (\"MACRONAME\" . LEVEL). See | |||
| 223 | (defun reftex-notice-new-section () | 222 | (defun reftex-notice-new-section () |
| 224 | (reftex-notice-new 1 'force)) | 223 | (reftex-notice-new 1 'force)) |
| 225 | 224 | ||
| 225 | (provide 'reftex-auc) | ||
| 226 | |||
| 226 | ;;; reftex-auc.el ends here | 227 | ;;; reftex-auc.el ends here |
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el index 229d12b2906..52fa6dbf9d2 100644 --- a/lisp/textmodes/reftex-cite.el +++ b/lisp/textmodes/reftex-cite.el | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> |
| 6 | ;; Maintainer: auctex-devel@gnu.org | 6 | ;; Maintainer: auctex-devel@gnu.org |
| 7 | ;; Version: 4.31 | ||
| 8 | ;; Package: reftex | ||
| 9 | 7 | ||
| 10 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 11 | 9 | ||
| @@ -129,9 +127,10 @@ | |||
| 129 | 127 | ||
| 130 | (let* ((re | 128 | (let* ((re |
| 131 | (if item | 129 | (if item |
| 132 | (concat "\\\\bibitem\\(\\[[^]]*\\]\\)?{" (regexp-quote key) "}") | 130 | (concat "\\\\bibitem[ \t]*\\(\\[[^]]*\\]\\)?[ \t]*{" |
| 133 | (concat "@[a-zA-Z]+[ \t\n\r]*[{(][ \t\n\r]*" (regexp-quote key) | 131 | (regexp-quote key) "}") |
| 134 | "[, \t\r\n}]"))) | 132 | (concat "@\\(?:\\w\\|\\s_\\)+[ \t\n\r]*[{(][ \t\n\r]*" |
| 133 | (regexp-quote key) "[, \t\r\n}]"))) | ||
| 135 | (buffer-conf (current-buffer)) | 134 | (buffer-conf (current-buffer)) |
| 136 | file buf pos oldpos) | 135 | file buf pos oldpos) |
| 137 | 136 | ||
| @@ -229,7 +228,13 @@ | |||
| 229 | buffer (not reftex-keep-temporary-buffers)))) | 228 | buffer (not reftex-keep-temporary-buffers)))) |
| 230 | (if (not buffer1) | 229 | (if (not buffer1) |
| 231 | (message "No such BibTeX file %s (ignored)" buffer) | 230 | (message "No such BibTeX file %s (ignored)" buffer) |
| 232 | (message "Scanning bibliography database %s" buffer1)) | 231 | (message "Scanning bibliography database %s" buffer1) |
| 232 | (unless (verify-visited-file-modtime buffer1) | ||
| 233 | (when (y-or-n-p | ||
| 234 | (format "File %s changed on disk. Reread from disk? " | ||
| 235 | (file-name-nondirectory | ||
| 236 | (buffer-file-name buffer1)))) | ||
| 237 | (with-current-buffer buffer1 (revert-buffer t t))))) | ||
| 233 | 238 | ||
| 234 | (set-buffer buffer1) | 239 | (set-buffer buffer1) |
| 235 | (reftex-with-special-syntax-for-bib | 240 | (reftex-with-special-syntax-for-bib |
| @@ -238,8 +243,8 @@ | |||
| 238 | (while (re-search-forward first-re nil t) | 243 | (while (re-search-forward first-re nil t) |
| 239 | (catch 'search-again | 244 | (catch 'search-again |
| 240 | (setq key-point (point)) | 245 | (setq key-point (point)) |
| 241 | (unless (re-search-backward | 246 | (unless (re-search-backward "\\(\\`\\|[\n\r]\\)[ \t]*\ |
| 242 | "\\(\\`\\|[\n\r]\\)[ \t]*@\\([a-zA-Z]+\\)[ \t\n\r]*[{(]" nil t) | 247 | @\\(\\(?:\\w\\|\\s_\\)+\\)[ \t\n\r]*[{(]" nil t) |
| 243 | (throw 'search-again nil)) | 248 | (throw 'search-again nil)) |
| 244 | (setq start-point (point)) | 249 | (setq start-point (point)) |
| 245 | (goto-char (match-end 0)) | 250 | (goto-char (match-end 0)) |
| @@ -451,7 +456,8 @@ | |||
| 451 | (setq names (replace-match " " nil t names))) | 456 | (setq names (replace-match " " nil t names))) |
| 452 | (split-string names "\n"))) | 457 | (split-string names "\n"))) |
| 453 | 458 | ||
| 454 | (defun reftex-parse-bibtex-entry (entry &optional from to) | 459 | (defun reftex-parse-bibtex-entry (entry &optional from to raw) |
| 460 | ; if RAW is non-nil, keep double quotes/curly braces delimiting fields | ||
| 455 | (let (alist key start field) | 461 | (let (alist key start field) |
| 456 | (save-excursion | 462 | (save-excursion |
| 457 | (save-restriction | 463 | (save-restriction |
| @@ -463,41 +469,56 @@ | |||
| 463 | (erase-buffer) | 469 | (erase-buffer) |
| 464 | (insert entry)) | 470 | (insert entry)) |
| 465 | (widen) | 471 | (widen) |
| 466 | (narrow-to-region from to)) | 472 | (if (and from to) (narrow-to-region from to))) |
| 467 | (goto-char (point-min)) | 473 | (goto-char (point-min)) |
| 468 | 474 | ||
| 469 | (if (re-search-forward | 475 | (if (re-search-forward "@\\(\\(?:\\w\\|\\s_\\)+\\)[ \t\n\r]*\ |
| 470 | "@\\(\\w+\\)[ \t\n\r]*[{(][ \t\n\r]*\\([^ \t\n\r,]+\\)" nil t) | 476 | \[{(][ \t\n\r]*\\([^ \t\n\r,]+\\)" nil t) |
| 471 | (setq alist | 477 | (setq alist |
| 472 | (list | 478 | (list |
| 473 | (cons "&type" (downcase (reftex-match-string 1))) | 479 | (cons "&type" (downcase (reftex-match-string 1))) |
| 474 | (cons "&key" (reftex-match-string 2))))) | 480 | (cons "&key" (reftex-match-string 2))))) |
| 475 | (while (re-search-forward "\\(\\w+\\)[ \t\n\r]*=[ \t\n\r]*" nil t) | 481 | (while (re-search-forward "\\(\\(?:\\w\\|-\\)+\\)[ \t\n\r]*=[ \t\n\r]*" |
| 482 | nil t) | ||
| 476 | (setq key (downcase (reftex-match-string 1))) | 483 | (setq key (downcase (reftex-match-string 1))) |
| 477 | (cond | 484 | (cond |
| 478 | ((= (following-char) ?{) | 485 | ((= (following-char) ?{) |
| 479 | (forward-char 1) | 486 | (cond |
| 480 | (setq start (point)) | 487 | (raw |
| 481 | (condition-case nil | 488 | (setq start (point)) |
| 482 | (up-list 1) | 489 | (forward-char 1)) |
| 483 | (error nil))) | 490 | (t |
| 491 | (forward-char 1) | ||
| 492 | (setq start (point)) | ||
| 493 | (condition-case nil | ||
| 494 | (up-list 1) | ||
| 495 | (error nil))))) | ||
| 484 | ((= (following-char) ?\") | 496 | ((= (following-char) ?\") |
| 485 | (forward-char 1) | 497 | (cond |
| 486 | (setq start (point)) | 498 | (raw |
| 499 | (setq start (point)) | ||
| 500 | (forward-char 1)) | ||
| 501 | (t | ||
| 502 | (forward-char 1) | ||
| 503 | (setq start (point)))) | ||
| 487 | (while (and (search-forward "\"" nil t) | 504 | (while (and (search-forward "\"" nil t) |
| 488 | (= ?\\ (char-after (- (point) 2)))))) | 505 | (= ?\\ (char-after (- (point) 2)))))) |
| 489 | (t | 506 | (t |
| 490 | (setq start (point)) | 507 | (setq start (point)) |
| 491 | (re-search-forward "[ \t]*[\n\r,}]" nil 1))) | 508 | (re-search-forward "[ \t]*[\n\r,}]" nil 1))) |
| 492 | (setq field (buffer-substring-no-properties start (1- (point)))) | 509 | ;; extract field value, ignore trailing comma if in RAW mode |
| 510 | (let ((stop (if (and raw (not (= (char-after (1- (point))) ?,))) | ||
| 511 | (point) | ||
| 512 | (1- (point))) )) | ||
| 513 | (setq field (buffer-substring-no-properties start stop))) | ||
| 493 | ;; remove extra whitespace | 514 | ;; remove extra whitespace |
| 494 | (while (string-match "[\n\t\r]\\|[ \t][ \t]+" field) | 515 | (while (string-match "[\n\t\r]\\|[ \t][ \t]+" field) |
| 495 | (setq field (replace-match " " nil t field))) | 516 | (setq field (replace-match " " nil t field))) |
| 496 | ;; remove leading garbage | 517 | ;; remove leading garbage |
| 497 | (if (string-match "^[ \t{]+" field) | 518 | (if (string-match (if raw "^[ \t]+" "^[ \t{]+") field) |
| 498 | (setq field (replace-match "" nil t field))) | 519 | (setq field (replace-match "" nil t field))) |
| 499 | ;; remove trailing garbage | 520 | ;; remove trailing garbage |
| 500 | (if (string-match "[ \t}]+$" field) | 521 | (if (string-match (if raw "[ \t]+$" "[ \t}]+$") field) |
| 501 | (setq field (replace-match "" nil t field))) | 522 | (setq field (replace-match "" nil t field))) |
| 502 | (push (cons key field) alist)))) | 523 | (push (cons key field) alist)))) |
| 503 | alist)) | 524 | alist)) |
| @@ -638,15 +659,13 @@ While entering the regexp, completion on knows citation keys is possible. | |||
| 638 | (insert-entries selected-entries) | 659 | (insert-entries selected-entries) |
| 639 | entry string cite-view) | 660 | entry string cite-view) |
| 640 | 661 | ||
| 641 | (when (stringp selected-entries) | ||
| 642 | (error selected-entries)) | ||
| 643 | (unless selected-entries (error "Quit")) | 662 | (unless selected-entries (error "Quit")) |
| 644 | 663 | ||
| 645 | (if (stringp selected-entries) | 664 | (if (stringp selected-entries) |
| 646 | ;; Nonexistent entry | 665 | ;; Nonexistent entry |
| 647 | (setq selected-entries nil | 666 | (setq insert-entries (list (list selected-entries |
| 648 | insert-entries (list (list selected-entries | 667 | (cons "&key" selected-entries))) |
| 649 | (cons "&key" selected-entries)))) | 668 | selected-entries nil) |
| 650 | ;; It makes sense to compute the cite-view strings. | 669 | ;; It makes sense to compute the cite-view strings. |
| 651 | (setq cite-view t)) | 670 | (setq cite-view t)) |
| 652 | 671 | ||
| @@ -654,7 +673,8 @@ While entering the regexp, completion on knows citation keys is possible. | |||
| 654 | ;; All keys go into a single command - we need to trick a little | 673 | ;; All keys go into a single command - we need to trick a little |
| 655 | ;; FIXME: Unfortunately, this means that commenting does not work right. | 674 | ;; FIXME: Unfortunately, this means that commenting does not work right. |
| 656 | (pop selected-entries) | 675 | (pop selected-entries) |
| 657 | (let ((concat-keys (mapconcat 'car selected-entries ","))) | 676 | (let ((concat-keys (mapconcat 'car selected-entries |
| 677 | reftex-cite-key-separator))) | ||
| 658 | (setq insert-entries | 678 | (setq insert-entries |
| 659 | (list (list concat-keys (cons "&key" concat-keys)))))) | 679 | (list (list concat-keys (cons "&key" concat-keys)))))) |
| 660 | 680 | ||
| @@ -675,8 +695,9 @@ While entering the regexp, completion on knows citation keys is possible. | |||
| 675 | (equal arg '(4)))) | 695 | (equal arg '(4)))) |
| 676 | (let ((start 0) (nth 0) value) | 696 | (let ((start 0) (nth 0) value) |
| 677 | (while (setq start (string-match "\\[\\]" string start)) | 697 | (while (setq start (string-match "\\[\\]" string start)) |
| 678 | (setq value (read-string (format "Optional argument %d: " | 698 | (setq value (save-match-data |
| 679 | (setq nth (1+ nth))))) | 699 | (read-string (format "Optional argument %d: " |
| 700 | (setq nth (1+ nth)))))) | ||
| 680 | (setq string (replace-match (concat "[" value "]") t t string)) | 701 | (setq string (replace-match (concat "[" value "]") t t string)) |
| 681 | (setq start (1+ start))))) | 702 | (setq start (1+ start))))) |
| 682 | ;; Should we cleanup empty optional arguments? | 703 | ;; Should we cleanup empty optional arguments? |
| @@ -725,7 +746,7 @@ While entering the regexp, completion on knows citation keys is possible. | |||
| 725 | (forward-char 1))) | 746 | (forward-char 1))) |
| 726 | 747 | ||
| 727 | ;; Return the citation key | 748 | ;; Return the citation key |
| 728 | (car (car selected-entries)))) | 749 | (mapcar 'car selected-entries))) |
| 729 | 750 | ||
| 730 | (defun reftex-figure-out-cite-format (arg &optional no-insert format-key) | 751 | (defun reftex-figure-out-cite-format (arg &optional no-insert format-key) |
| 731 | ;; Check if there is already a cite command at point and change cite format | 752 | ;; Check if there is already a cite command at point and change cite format |
| @@ -744,9 +765,13 @@ While entering the regexp, completion on knows citation keys is possible. | |||
| 744 | (if (or (not arg) (not (listp arg))) | 765 | (if (or (not arg) (not (listp arg))) |
| 745 | (setq format | 766 | (setq format |
| 746 | (concat | 767 | (concat |
| 747 | (if (member (preceding-char) '(?\{ ?,)) "" ",") | 768 | (if (member (preceding-char) '(?\{ ?,)) |
| 769 | "" | ||
| 770 | reftex-cite-key-separator) | ||
| 748 | "%l" | 771 | "%l" |
| 749 | (if (member (following-char) '(?\} ?,)) "" ","))) | 772 | (if (member (following-char) '(?\} ?,)) |
| 773 | "" | ||
| 774 | reftex-cite-key-separator))) | ||
| 750 | (setq format "%l"))) | 775 | (setq format "%l"))) |
| 751 | (t | 776 | (t |
| 752 | ;; Figure out the correct format | 777 | ;; Figure out the correct format |
| @@ -1114,7 +1139,7 @@ While entering the regexp, completion on knows citation keys is possible. | |||
| 1114 | (save-restriction | 1139 | (save-restriction |
| 1115 | (widen) | 1140 | (widen) |
| 1116 | (goto-char (point-min)) | 1141 | (goto-char (point-min)) |
| 1117 | (while (re-search-forward "^[^%\n\r]*\\\\\\(bibentry\\|[a-zA-Z]*cite[a-zA-Z]*\\)\\(\\[[^\\]]*\\]\\)?{\\([^}]+\\)}" nil t) | 1142 | (while (re-search-forward "\\(?:^\\|\\=\\)[^%\n\r]*?\\\\\\(bibentry\\|[a-zA-Z]*cite[a-zA-Z]*\\)\\(\\[[^\\]]*\\]\\)?{\\([^}]+\\)}" nil t) |
| 1118 | (setq kk (match-string-no-properties 3)) | 1143 | (setq kk (match-string-no-properties 3)) |
| 1119 | (while (string-match "%.*\n?" kk) | 1144 | (while (string-match "%.*\n?" kk) |
| 1120 | (setq kk (replace-match "" t t kk))) | 1145 | (setq kk (replace-match "" t t kk))) |
| @@ -1125,18 +1150,35 @@ While entering the regexp, completion on knows citation keys is possible. | |||
| 1125 | (reftex-kill-temporary-buffers) | 1150 | (reftex-kill-temporary-buffers) |
| 1126 | keys)) | 1151 | keys)) |
| 1127 | 1152 | ||
| 1153 | (defun reftex-get-string-refs (alist) | ||
| 1154 | "Return a list of BibTeX @string references that appear as values in ALIST." | ||
| 1155 | (reftex-remove-if (lambda (x) (string-match "^\\([\"{]\\|[0-9]+$\\)" x)) | ||
| 1156 | ;; get list of values, discard keys | ||
| 1157 | (mapcar 'cdr | ||
| 1158 | ;; remove &key and &type entries | ||
| 1159 | (reftex-remove-if (lambda (pair) | ||
| 1160 | (string-match "^&" (car pair))) | ||
| 1161 | alist)))) | ||
| 1162 | |||
| 1128 | (defun reftex-create-bibtex-file (bibfile) | 1163 | (defun reftex-create-bibtex-file (bibfile) |
| 1129 | "Create a new BibTeX database file with all entries referenced in document. | 1164 | "Create a new BibTeX database file with all entries referenced in document. |
| 1130 | The command prompts for a filename and writes the collected entries to | 1165 | The command prompts for a filename and writes the collected |
| 1131 | that file. Only entries referenced in the current document with | 1166 | entries to that file. Only entries referenced in the current |
| 1132 | any \\cite-like macros are used. | 1167 | document with any \\cite-like macros are used. The sequence in |
| 1133 | The sequence in the new file is the same as it was in the old database." | 1168 | the new file is the same as it was in the old database. |
| 1169 | |||
| 1170 | Entries referenced from other entries must appear after all | ||
| 1171 | referencing entries. | ||
| 1172 | |||
| 1173 | You can define strings to be used as header or footer for the | ||
| 1174 | created files in the variables `reftex-create-bibtex-header' or | ||
| 1175 | `reftex-create-bibtex-footer' respectively." | ||
| 1134 | (interactive "FNew BibTeX file: ") | 1176 | (interactive "FNew BibTeX file: ") |
| 1135 | (let ((keys (reftex-all-used-citation-keys)) | 1177 | (let ((keys (reftex-all-used-citation-keys)) |
| 1136 | (files (reftex-get-bibfile-list)) | 1178 | (files (reftex-get-bibfile-list)) |
| 1137 | file key entries beg end entry) | 1179 | file key entries beg end entry string-keys string-entries) |
| 1138 | (save-current-buffer | 1180 | (save-current-buffer |
| 1139 | (while (setq file (pop files)) | 1181 | (dolist (file files) |
| 1140 | (set-buffer (reftex-get-file-buffer-force file 'mark)) | 1182 | (set-buffer (reftex-get-file-buffer-force file 'mark)) |
| 1141 | (reftex-with-special-syntax-for-bib | 1183 | (reftex-with-special-syntax-for-bib |
| 1142 | (save-excursion | 1184 | (save-excursion |
| @@ -1156,14 +1198,54 @@ The sequence in the new file is the same as it was in the old database." | |||
| 1156 | (when (member key keys) | 1198 | (when (member key keys) |
| 1157 | (setq entry (buffer-substring beg end) | 1199 | (setq entry (buffer-substring beg end) |
| 1158 | entries (cons entry entries) | 1200 | entries (cons entry entries) |
| 1159 | keys (delete key keys))))))))) | 1201 | keys (delete key keys)) |
| 1202 | |||
| 1203 | ;; check for crossref entries | ||
| 1204 | (let* ((attr-list (reftex-parse-bibtex-entry nil beg end)) | ||
| 1205 | (xref-key (cdr (assoc "crossref" attr-list)))) | ||
| 1206 | (if xref-key (pushnew xref-key keys))) | ||
| 1207 | ;; check for string references | ||
| 1208 | (let* ((raw-fields (reftex-parse-bibtex-entry nil beg end t)) | ||
| 1209 | (string-fields (reftex-get-string-refs raw-fields))) | ||
| 1210 | (dolist (skey string-fields) | ||
| 1211 | (unless (member skey string-keys) | ||
| 1212 | (push skey string-keys))))))))))) | ||
| 1213 | ;; second pass: grab @string references | ||
| 1214 | (if string-keys | ||
| 1215 | (save-current-buffer | ||
| 1216 | (dolist (file files) | ||
| 1217 | (set-buffer (reftex-get-file-buffer-force file 'mark)) | ||
| 1218 | (reftex-with-special-syntax-for-bib | ||
| 1219 | (save-excursion | ||
| 1220 | (save-restriction | ||
| 1221 | (widen) | ||
| 1222 | (goto-char (point-min)) | ||
| 1223 | (while (re-search-forward | ||
| 1224 | "^[ \t]*@[Ss][Tt][Rr][Ii][Nn][Gg][ \t]*{[ \t]*\\([^ \t\r\n]+\\)" | ||
| 1225 | nil t) | ||
| 1226 | (setq key (match-string 1) | ||
| 1227 | beg (match-beginning 0) | ||
| 1228 | end (progn | ||
| 1229 | (goto-char (match-beginning 1)) | ||
| 1230 | (condition-case nil | ||
| 1231 | (up-list 1) | ||
| 1232 | (error (goto-char (match-end 0)))) | ||
| 1233 | (point))) | ||
| 1234 | (when (member key string-keys) | ||
| 1235 | (setq entry (buffer-substring beg end) | ||
| 1236 | string-entries (cons entry string-entries) | ||
| 1237 | string-keys (delete key string-keys)))))))))) | ||
| 1160 | (find-file-other-window bibfile) | 1238 | (find-file-other-window bibfile) |
| 1161 | (if (> (buffer-size) 0) | 1239 | (if (> (buffer-size) 0) |
| 1162 | (unless (yes-or-no-p | 1240 | (unless (yes-or-no-p |
| 1163 | (format "Overwrite non-empty file %s? " bibfile)) | 1241 | (format "Overwrite non-empty file %s? " bibfile)) |
| 1164 | (error "Abort"))) | 1242 | (error "Abort"))) |
| 1165 | (erase-buffer) | 1243 | (erase-buffer) |
| 1244 | (if reftex-create-bibtex-header (insert reftex-create-bibtex-header "\n\n")) | ||
| 1245 | (insert (mapconcat 'identity (reverse string-entries) "\n\n")) | ||
| 1246 | (if string-entries (insert "\n\n\n")) | ||
| 1166 | (insert (mapconcat 'identity (reverse entries) "\n\n")) | 1247 | (insert (mapconcat 'identity (reverse entries) "\n\n")) |
| 1248 | (if reftex-create-bibtex-footer (insert "\n\n" reftex-create-bibtex-footer)) | ||
| 1167 | (goto-char (point-min)) | 1249 | (goto-char (point-min)) |
| 1168 | (save-buffer) | 1250 | (save-buffer) |
| 1169 | (message "%d entries extracted and copied to new database" | 1251 | (message "%d entries extracted and copied to new database" |
diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el index b1e426c5566..7d102e5a802 100644 --- a/lisp/textmodes/reftex-dcr.el +++ b/lisp/textmodes/reftex-dcr.el | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> |
| 6 | ;; Maintainer: auctex-devel@gnu.org | 6 | ;; Maintainer: auctex-devel@gnu.org |
| 7 | ;; Version: 4.31 | ||
| 8 | ;; Package: reftex | ||
| 9 | 7 | ||
| 10 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 11 | 9 | ||
| @@ -27,10 +25,10 @@ | |||
| 27 | ;;; Code: | 25 | ;;; Code: |
| 28 | 26 | ||
| 29 | (eval-when-compile (require 'cl)) | 27 | (eval-when-compile (require 'cl)) |
| 30 | (provide 'reftex-dcr) | 28 | |
| 31 | (provide 'reftex-vcr) | 29 | (declare-function bibtex-beginning-of-entry "bibtex" ()) |
| 30 | |||
| 32 | (require 'reftex) | 31 | (require 'reftex) |
| 33 | ;;; | ||
| 34 | 32 | ||
| 35 | (defun reftex-view-crossref (&optional arg auto-how fail-quietly) | 33 | (defun reftex-view-crossref (&optional arg auto-how fail-quietly) |
| 36 | "View cross reference of macro at point. Point must be on the KEY | 34 | "View cross reference of macro at point. Point must be on the KEY |
| @@ -229,6 +227,7 @@ If it is a \\cite, show the BibTeX database entry. | |||
| 229 | If there is no such macro at point, search forward to find one. | 227 | If there is no such macro at point, search forward to find one. |
| 230 | With argument, actually select the window showing the cross reference." | 228 | With argument, actually select the window showing the cross reference." |
| 231 | (interactive "e") | 229 | (interactive "e") |
| 230 | ;; Make sure the referencing macro stays visible in the original window. | ||
| 232 | (mouse-set-point ev) | 231 | (mouse-set-point ev) |
| 233 | (reftex-view-crossref current-prefix-arg)) | 232 | (reftex-view-crossref current-prefix-arg)) |
| 234 | 233 | ||
| @@ -348,15 +347,14 @@ will display info in the echo area." | |||
| 348 | (message "Automatic display of crossref information was turned on"))) | 347 | (message "Automatic display of crossref information was turned on"))) |
| 349 | 348 | ||
| 350 | (defun reftex-start-itimer-once () | 349 | (defun reftex-start-itimer-once () |
| 351 | (and (featurep 'xemacs) reftex-mode | 350 | (and (featurep 'xemacs) |
| 351 | reftex-mode | ||
| 352 | (not (itimer-live-p reftex-auto-view-crossref-timer)) | 352 | (not (itimer-live-p reftex-auto-view-crossref-timer)) |
| 353 | (setq reftex-auto-view-crossref-timer | 353 | (setq reftex-auto-view-crossref-timer |
| 354 | (start-itimer "RefTeX Idle Timer" | 354 | (start-itimer "RefTeX Idle Timer" |
| 355 | 'reftex-view-crossref-when-idle | 355 | 'reftex-view-crossref-when-idle |
| 356 | reftex-idle-time nil t)))) | 356 | reftex-idle-time nil t)))) |
| 357 | 357 | ||
| 358 | (declare-function bibtex-beginning-of-entry "bibtex" ()) | ||
| 359 | |||
| 360 | (defun reftex-view-crossref-from-bibtex (&optional arg) | 358 | (defun reftex-view-crossref-from-bibtex (&optional arg) |
| 361 | "View location in a LaTeX document which cites the BibTeX entry at point. | 359 | "View location in a LaTeX document which cites the BibTeX entry at point. |
| 362 | Since BibTeX files can be used by many LaTeX documents, this function | 360 | Since BibTeX files can be used by many LaTeX documents, this function |
| @@ -481,4 +479,6 @@ Calling this function several times find successive citation locations." | |||
| 481 | (move-marker reftex-global-search-marker nil) | 479 | (move-marker reftex-global-search-marker nil) |
| 482 | (error "All files processed")))) | 480 | (error "All files processed")))) |
| 483 | 481 | ||
| 482 | (provide 'reftex-dcr) | ||
| 483 | |||
| 484 | ;;; reftex-dcr.el ends here | 484 | ;;; reftex-dcr.el ends here |
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el index d836bbb6cb8..ebe0aae73f8 100644 --- a/lisp/textmodes/reftex-global.el +++ b/lisp/textmodes/reftex-global.el | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> |
| 6 | ;; Maintainer: auctex-devel@gnu.org | 6 | ;; Maintainer: auctex-devel@gnu.org |
| 7 | ;; Version: 4.31 | ||
| 8 | ;; Package: reftex | ||
| 9 | 7 | ||
| 10 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 11 | 9 | ||
| @@ -407,7 +405,7 @@ Also checks if buffers visiting the files are in read-only mode." | |||
| 407 | (when flist | 405 | (when flist |
| 408 | (if wrapp | 406 | (if wrapp |
| 409 | (unless isearch-forward | 407 | (unless isearch-forward |
| 410 | (setq flist (last flist))) | 408 | (setq flist (last flist))) |
| 411 | (unless isearch-forward | 409 | (unless isearch-forward |
| 412 | (setq flist (reverse flist))) | 410 | (setq flist (reverse flist))) |
| 413 | (while (not (string= (car flist) cb)) | 411 | (while (not (string= (car flist) cb)) |
| @@ -437,7 +435,8 @@ With no argument, this command toggles | |||
| 437 | (with-current-buffer crt-buf | 435 | (with-current-buffer crt-buf |
| 438 | (when reftex-mode | 436 | (when reftex-mode |
| 439 | (if (boundp 'multi-isearch-next-buffer-function) | 437 | (if (boundp 'multi-isearch-next-buffer-function) |
| 440 | (set (make-local-variable 'multi-isearch-next-buffer-function) | 438 | (set (make-local-variable |
| 439 | 'multi-isearch-next-buffer-function) | ||
| 441 | 'reftex-isearch-switch-to-next-file) | 440 | 'reftex-isearch-switch-to-next-file) |
| 442 | (set (make-local-variable 'isearch-wrap-function) | 441 | (set (make-local-variable 'isearch-wrap-function) |
| 443 | 'reftex-isearch-wrap-function) | 442 | 'reftex-isearch-wrap-function) |
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el index 1d15dfbed7e..5b884dd8480 100644 --- a/lisp/textmodes/reftex-index.el +++ b/lisp/textmodes/reftex-index.el | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> |
| 6 | ;; Maintainer: auctex-devel@gnu.org | 6 | ;; Maintainer: auctex-devel@gnu.org |
| 7 | ;; Version: 4.31 | ||
| 8 | ;; Package: reftex | ||
| 9 | 7 | ||
| 10 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 11 | 9 | ||
| @@ -27,9 +25,9 @@ | |||
| 27 | ;;; Code: | 25 | ;;; Code: |
| 28 | 26 | ||
| 29 | (eval-when-compile (require 'cl)) | 27 | (eval-when-compile (require 'cl)) |
| 30 | (provide 'reftex-index) | 28 | (declare-function texmathp "ext:texmathp" ()) |
| 29 | |||
| 31 | (require 'reftex) | 30 | (require 'reftex) |
| 32 | ;;; | ||
| 33 | 31 | ||
| 34 | ;; START remove for XEmacs release | 32 | ;; START remove for XEmacs release |
| 35 | (defvar mark-active) | 33 | (defvar mark-active) |
| @@ -37,8 +35,6 @@ | |||
| 37 | (defvar TeX-master) | 35 | (defvar TeX-master) |
| 38 | ;; END remove for XEmacs release | 36 | ;; END remove for XEmacs release |
| 39 | 37 | ||
| 40 | (declare-function texmathp "ext:texmathp" ()) | ||
| 41 | |||
| 42 | (defun reftex-index-selection-or-word (&optional arg phrase) | 38 | (defun reftex-index-selection-or-word (&optional arg phrase) |
| 43 | "Put selection or the word near point into the default index macro. | 39 | "Put selection or the word near point into the default index macro. |
| 44 | This uses the information in `reftex-index-default-macro' to make an index | 40 | This uses the information in `reftex-index-default-macro' to make an index |
| @@ -52,9 +48,7 @@ which is part of AUCTeX, the string is first processed with the | |||
| 52 | (interactive "P") | 48 | (interactive "P") |
| 53 | (let* ((use-default (not (equal arg '(16)))) ; check for double prefix | 49 | (let* ((use-default (not (equal arg '(16)))) ; check for double prefix |
| 54 | ;; check if we have an active selection | 50 | ;; check if we have an active selection |
| 55 | (active (if (featurep 'xemacs) | 51 | (active (reftex-region-active-p)) |
| 56 | (and zmacs-regions (region-exists-p)) ; XEmacs | ||
| 57 | (and transient-mark-mode mark-active))) ; Emacs | ||
| 58 | (beg (if active | 52 | (beg (if active |
| 59 | (region-beginning) | 53 | (region-beginning) |
| 60 | (save-excursion | 54 | (save-excursion |
| @@ -1244,7 +1238,11 @@ This gets refreshed in every phrases command.") | |||
| 1244 | 1238 | ||
| 1245 | map) | 1239 | map) |
| 1246 | "Keymap used for *toc* buffer.") | 1240 | "Keymap used for *toc* buffer.") |
| 1247 | 1241 | (defvar reftex-index-phrases-syntax-table | |
| 1242 | (let ((table (make-syntax-table))) | ||
| 1243 | (modify-syntax-entry ?\" "." table) | ||
| 1244 | table) | ||
| 1245 | "Syntax table for RefTeX Index Phrases mode.") | ||
| 1248 | 1246 | ||
| 1249 | (defun reftex-index-phrase-selection-or-word (arg) | 1247 | (defun reftex-index-phrase-selection-or-word (arg) |
| 1250 | "Add current selection or word at point to the phrases buffer. | 1248 | "Add current selection or word at point to the phrases buffer. |
| @@ -1264,6 +1262,7 @@ You get a chance to edit the entry in the phrases buffer - finish with | |||
| 1264 | "Switch to the phrases buffer, initialize if empty." | 1262 | "Switch to the phrases buffer, initialize if empty." |
| 1265 | (interactive) | 1263 | (interactive) |
| 1266 | (reftex-access-scan-info) | 1264 | (reftex-access-scan-info) |
| 1265 | (set-marker reftex-index-return-marker (point)) | ||
| 1267 | (let* ((master (reftex-TeX-master-file)) | 1266 | (let* ((master (reftex-TeX-master-file)) |
| 1268 | (name (concat (file-name-sans-extension master) | 1267 | (name (concat (file-name-sans-extension master) |
| 1269 | reftex-index-phrase-file-extension))) | 1268 | reftex-index-phrase-file-extension))) |
| @@ -1371,6 +1370,7 @@ For more information see the RefTeX User Manual. | |||
| 1371 | Here are all local bindings. | 1370 | Here are all local bindings. |
| 1372 | 1371 | ||
| 1373 | \\{reftex-index-phrases-mode-map}" | 1372 | \\{reftex-index-phrases-mode-map}" |
| 1373 | :syntax-table reftex-index-phrases-syntax-table | ||
| 1374 | (set (make-local-variable 'font-lock-defaults) | 1374 | (set (make-local-variable 'font-lock-defaults) |
| 1375 | reftex-index-phrases-font-lock-defaults) | 1375 | reftex-index-phrases-font-lock-defaults) |
| 1376 | (easy-menu-add reftex-index-phrases-menu reftex-index-phrases-mode-map) | 1376 | (easy-menu-add reftex-index-phrases-menu reftex-index-phrases-mode-map) |
| @@ -2093,5 +2093,6 @@ Does not do a save-excursion." | |||
| 2093 | reftex-index-phrases-macro-data "\n")))) | 2093 | reftex-index-phrases-macro-data "\n")))) |
| 2094 | (reftex-select-with-char prompt help delay))) | 2094 | (reftex-select-with-char prompt help delay))) |
| 2095 | 2095 | ||
| 2096 | (provide 'reftex-index) | ||
| 2096 | 2097 | ||
| 2097 | ;;; reftex-index.el ends here | 2098 | ;;; reftex-index.el ends here |
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el index c6526d1b6ce..791b5d7b945 100644 --- a/lisp/textmodes/reftex-parse.el +++ b/lisp/textmodes/reftex-parse.el | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> |
| 6 | ;; Maintainer: auctex-devel@gnu.org | 6 | ;; Maintainer: auctex-devel@gnu.org |
| 7 | ;; Version: 4.31 | ||
| 8 | ;; Package: reftex | ||
| 9 | 7 | ||
| 10 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 11 | 9 | ||
| @@ -27,7 +25,7 @@ | |||
| 27 | ;;; Code: | 25 | ;;; Code: |
| 28 | 26 | ||
| 29 | (eval-when-compile (require 'cl)) | 27 | (eval-when-compile (require 'cl)) |
| 30 | (provide 'reftex-parse) | 28 | |
| 31 | (require 'reftex) | 29 | (require 'reftex) |
| 32 | 30 | ||
| 33 | (defmacro reftex-with-special-syntax (&rest body) | 31 | (defmacro reftex-with-special-syntax (&rest body) |
| @@ -241,8 +239,17 @@ of master file." | |||
| 241 | 239 | ||
| 242 | ((match-end 3) | 240 | ((match-end 3) |
| 243 | ;; It is a section | 241 | ;; It is a section |
| 244 | (setq bound (point)) | ||
| 245 | 242 | ||
| 243 | ;; Use the beginning as bound and not the end | ||
| 244 | ;; (i.e. (point)) because the section command might | ||
| 245 | ;; be the start of the current environment to be | ||
| 246 | ;; found by `reftex-label-info'. | ||
| 247 | (setq bound (match-beginning 0)) | ||
| 248 | ;; The section regexp matches a character at the end | ||
| 249 | ;; we are not interested in. Especially if it is the | ||
| 250 | ;; backslash of a following macro we want to find in | ||
| 251 | ;; the next parsing iteration. | ||
| 252 | (when (eq (char-before) ?\\) (backward-char)) | ||
| 246 | ;; Insert in List | 253 | ;; Insert in List |
| 247 | (setq toc-entry (reftex-section-info file)) | 254 | (setq toc-entry (reftex-section-info file)) |
| 248 | (when toc-entry | 255 | (when toc-entry |
| @@ -1072,4 +1079,6 @@ of master file." | |||
| 1072 | nrest (- nrest i)))) | 1079 | nrest (- nrest i)))) |
| 1073 | string)) | 1080 | string)) |
| 1074 | 1081 | ||
| 1082 | (provide 'reftex-parse) | ||
| 1083 | |||
| 1075 | ;;; reftex-parse.el ends here | 1084 | ;;; reftex-parse.el ends here |
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el index 1882e7dde56..9b9f1a0f68f 100644 --- a/lisp/textmodes/reftex-ref.el +++ b/lisp/textmodes/reftex-ref.el | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> |
| 6 | ;; Maintainer: auctex-devel@gnu.org | 6 | ;; Maintainer: auctex-devel@gnu.org |
| 7 | ;; Version: 4.31 | ||
| 8 | ;; Package: reftex | ||
| 9 | 7 | ||
| 10 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 11 | 9 | ||
| @@ -27,10 +25,9 @@ | |||
| 27 | ;;; Code: | 25 | ;;; Code: |
| 28 | 26 | ||
| 29 | (eval-when-compile (require 'cl)) | 27 | (eval-when-compile (require 'cl)) |
| 30 | (provide 'reftex-ref) | 28 | |
| 31 | (require 'reftex) | 29 | (require 'reftex) |
| 32 | (require 'reftex-parse) | 30 | (require 'reftex-parse) |
| 33 | ;;; | ||
| 34 | 31 | ||
| 35 | (defun reftex-label-location (&optional bound) | 32 | (defun reftex-label-location (&optional bound) |
| 36 | "Return the environment or macro which determines the label type at point. | 33 | "Return the environment or macro which determines the label type at point. |
| @@ -413,27 +410,54 @@ When called with 2 C-u prefix args, disable magic word recognition." | |||
| 413 | 410 | ||
| 414 | (interactive) | 411 | (interactive) |
| 415 | 412 | ||
| 416 | ;; check for active recursive edits | 413 | ;; Check for active recursive edits |
| 417 | (reftex-check-recursive-edit) | 414 | (reftex-check-recursive-edit) |
| 418 | 415 | ||
| 419 | ;; Ensure access to scanning info and rescan buffer if prefix are is '(4) | 416 | ;; Ensure access to scanning info and rescan buffer if prefix is '(4) |
| 420 | (reftex-access-scan-info current-prefix-arg) | 417 | (reftex-access-scan-info current-prefix-arg) |
| 421 | 418 | ||
| 422 | (unless type | 419 | (let ((reftex-refstyle (when (and (boundp 'reftex-refstyle) reftex-refstyle) |
| 423 | ;; guess type from context | 420 | reftex-refstyle)) |
| 424 | (if (and reftex-guess-label-type | 421 | (reftex-format-ref-function reftex-format-ref-function) |
| 425 | (setq type (reftex-guess-label-type))) | 422 | (form "\\ref{%s}") |
| 426 | (setq cut (cdr type) | 423 | label labels sep sep1 style-alist) |
| 427 | type (car type)) | 424 | |
| 428 | (setq type (reftex-query-label-type)))) | 425 | (unless reftex-refstyle |
| 429 | 426 | (if reftex-ref-macro-prompt | |
| 430 | (let* ((reftex-refstyle | 427 | (progn |
| 431 | (cond ((reftex-typekey-check type reftex-vref-is-default) "\\vref") | 428 | ;; Build a temporary list which handles more easily. |
| 432 | ((reftex-typekey-check type reftex-fref-is-default) "\\fref") | 429 | (dolist (elt reftex-ref-style-alist) |
| 433 | (t "\\ref"))) | 430 | (when (member (car elt) (reftex-ref-style-list)) |
| 434 | (reftex-format-ref-function reftex-format-ref-function) | 431 | (mapc (lambda (x) |
| 435 | (form "\\ref{%s}") | 432 | (add-to-list 'style-alist (cons (cadr x) (car x)) t)) |
| 436 | label labels sep sep1) | 433 | (nth 2 elt)))) |
| 434 | ;; Prompt the user for the macro. | ||
| 435 | (let ((key (reftex-select-with-char | ||
| 436 | "" (concat "SELECT A REFERENCE FORMAT\n\n" | ||
| 437 | (mapconcat | ||
| 438 | (lambda (x) | ||
| 439 | (format "[%c] %s %s" (car x) | ||
| 440 | (if (> (car x) 31) " " "") | ||
| 441 | (cdr x))) | ||
| 442 | style-alist "\n"))))) | ||
| 443 | (setq reftex-refstyle (cdr (assoc key style-alist))) | ||
| 444 | (unless reftex-refstyle | ||
| 445 | (error "No reference macro associated with key `%c'" key)))) | ||
| 446 | ;; Get the first macro from `reftex-ref-style-alist' which | ||
| 447 | ;; matches the first entry in the list of active styles. | ||
| 448 | (setq reftex-refstyle | ||
| 449 | (or (caar (nth 2 (assoc (car (reftex-ref-style-list)) | ||
| 450 | reftex-ref-style-alist))) | ||
| 451 | ;; Use the first entry in r-r-s-a as a last resort. | ||
| 452 | (caar (nth 2 (car reftex-ref-style-alist))))))) | ||
| 453 | |||
| 454 | (unless type | ||
| 455 | ;; Guess type from context | ||
| 456 | (if (and reftex-guess-label-type | ||
| 457 | (setq type (reftex-guess-label-type))) | ||
| 458 | (setq cut (cdr type) | ||
| 459 | type (car type)) | ||
| 460 | (setq type (reftex-query-label-type)))) | ||
| 437 | 461 | ||
| 438 | ;; Have the user select a label | 462 | ;; Have the user select a label |
| 439 | (set-marker reftex-select-return-marker (point)) | 463 | (set-marker reftex-select-return-marker (point)) |
| @@ -472,17 +496,13 @@ When called with 2 C-u prefix args, disable magic word recognition." | |||
| 472 | (member (preceding-char) '(?\ ?\t ?\n ?~))) | 496 | (member (preceding-char) '(?\ ?\t ?\n ?~))) |
| 473 | (setq form (substring form 1))) | 497 | (setq form (substring form 1))) |
| 474 | ;; do we have a special format? | 498 | ;; do we have a special format? |
| 475 | (setq reftex-format-ref-function | 499 | (unless (string= reftex-refstyle "\\ref") |
| 476 | (cond | 500 | (setq reftex-format-ref-function 'reftex-format-special)) |
| 477 | ((string= reftex-refstyle "\\vref") 'reftex-format-vref) | ||
| 478 | ((string= reftex-refstyle "\\fref") 'reftex-format-fref) | ||
| 479 | ((string= reftex-refstyle "\\Fref") 'reftex-format-Fref) | ||
| 480 | (t reftex-format-ref-function))) | ||
| 481 | ;; ok, insert the reference | 501 | ;; ok, insert the reference |
| 482 | (if sep1 (insert sep1)) | 502 | (if sep1 (insert sep1)) |
| 483 | (insert | 503 | (insert |
| 484 | (if reftex-format-ref-function | 504 | (if reftex-format-ref-function |
| 485 | (funcall reftex-format-ref-function label form) | 505 | (funcall reftex-format-ref-function label form reftex-refstyle) |
| 486 | (format form label label))) | 506 | (format form label label))) |
| 487 | ;; take out the initial ~ for good | 507 | ;; take out the initial ~ for good |
| 488 | (and (= ?~ (string-to-char form)) | 508 | (and (= ?~ (string-to-char form)) |
| @@ -791,34 +811,31 @@ When called with 2 C-u prefix args, disable magic word recognition." | |||
| 791 | (run-hooks 'reftex-display-copied-context-hook) | 811 | (run-hooks 'reftex-display-copied-context-hook) |
| 792 | (setq buffer-read-only t)))))) | 812 | (setq buffer-read-only t)))))) |
| 793 | 813 | ||
| 794 | (defun reftex-varioref-vref () | 814 | ;; Generate functions for direct insertion of specific referencing |
| 795 | "Insert a reference using the `\\vref' macro from the varioref package." | 815 | ;; macros. The functions are named `reftex-<package>-<macro>', |
| 796 | (interactive) | 816 | ;; e.g. `reftex-varioref-vref'. |
| 797 | (let ((reftex-format-ref-function 'reftex-format-vref)) | 817 | (dolist (elt reftex-ref-style-alist) |
| 798 | (reftex-reference))) | 818 | (when (stringp (nth 1 elt)) |
| 799 | (defun reftex-fancyref-fref () | 819 | (dolist (item (nth 2 elt)) |
| 800 | "Insert a reference using the `\\fref' macro from the fancyref package." | 820 | (let ((macro (car item)) |
| 801 | (interactive) | 821 | (package (nth 1 elt))) |
| 802 | (let ((reftex-format-ref-function 'reftex-format-fref) | 822 | (eval `(defun ,(intern (format "reftex-%s-%s" package |
| 803 | ;;(reftex-guess-label-type nil) ;FIXME do we want this???? | 823 | (substring macro 1 (length macro)))) () |
| 804 | ) | 824 | ,(format "Insert a reference using the `%s' macro from the %s \ |
| 805 | (reftex-reference))) | 825 | package.\n\nThis is a generated function." |
| 806 | (defun reftex-fancyref-Fref () | 826 | macro package) |
| 807 | "Insert a reference using the `\\Fref' macro from the fancyref package." | 827 | (interactive) |
| 808 | (interactive) | 828 | (let ((reftex-refstyle ,macro)) |
| 809 | (let ((reftex-format-ref-function 'reftex-format-Fref) | 829 | (reftex-reference)))))))) |
| 810 | ;;(reftex-guess-label-type nil) ;FIXME do we want this???? | 830 | |
| 811 | ) | 831 | (defun reftex-format-special (label fmt refstyle) |
| 812 | (reftex-reference))) | 832 | "Apply selected reference style to format FMT and add LABEL. |
| 813 | 833 | Replace any occurrences of \"\\ref\" with REFSTYLE." | |
| 814 | (defun reftex-format-vref (label fmt) | 834 | ;; Replace instances of \ref in `fmt' with the special reference |
| 815 | (while (string-match "\\\\ref{" fmt) | 835 | ;; style selected by the user. |
| 816 | (setq fmt (replace-match "\\vref{" t t fmt))) | 836 | (while (string-match "\\(\\\\ref\\)[ \t]*{" fmt) |
| 817 | (format fmt label label)) | 837 | (setq fmt (replace-match refstyle t t fmt 1))) |
| 818 | (defun reftex-format-Fref (label def-fmt) | 838 | (format fmt label)) |
| 819 | (format "\\Fref{%s}" label)) | ||
| 820 | (defun reftex-format-fref (label def-fmt) | ||
| 821 | (format "\\fref{%s}" label)) | ||
| 822 | 839 | ||
| 823 | (defun reftex-goto-label (&optional other-window) | 840 | (defun reftex-goto-label (&optional other-window) |
| 824 | "Prompt for a label (with completion) and jump to the location of this label. | 841 | "Prompt for a label (with completion) and jump to the location of this label. |
| @@ -847,5 +864,6 @@ Optional prefix argument OTHER-WINDOW goes to the label in another window." | |||
| 847 | (goto-char where)) | 864 | (goto-char where)) |
| 848 | (reftex-unhighlight 0))) | 865 | (reftex-unhighlight 0))) |
| 849 | 866 | ||
| 867 | (provide 'reftex-ref) | ||
| 850 | 868 | ||
| 851 | ;;; reftex-ref.el ends here | 869 | ;;; reftex-ref.el ends here |
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el index 1a400436311..68355f9b16f 100644 --- a/lisp/textmodes/reftex-sel.el +++ b/lisp/textmodes/reftex-sel.el | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> |
| 6 | ;; Maintainer: auctex-devel@gnu.org | 6 | ;; Maintainer: auctex-devel@gnu.org |
| 7 | ;; Version: 4.31 | ||
| 8 | ;; Package: reftex | ||
| 9 | 7 | ||
| 10 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 11 | 9 | ||
| @@ -27,9 +25,8 @@ | |||
| 27 | ;;; Code: | 25 | ;;; Code: |
| 28 | 26 | ||
| 29 | (eval-when-compile (require 'cl)) | 27 | (eval-when-compile (require 'cl)) |
| 30 | (provide 'reftex-sel) | 28 | |
| 31 | (require 'reftex) | 29 | (require 'reftex) |
| 32 | ;;; | ||
| 33 | 30 | ||
| 34 | ;; Common bindings in reftex-select-label-mode-map | 31 | ;; Common bindings in reftex-select-label-mode-map |
| 35 | ;; and reftex-select-bib-mode-map. | 32 | ;; and reftex-select-bib-mode-map. |
| @@ -86,8 +83,8 @@ | |||
| 86 | (loop for x in | 83 | (loop for x in |
| 87 | '(("b" . reftex-select-jump-to-previous) | 84 | '(("b" . reftex-select-jump-to-previous) |
| 88 | ("z" . reftex-select-jump) | 85 | ("z" . reftex-select-jump) |
| 89 | ("v" . reftex-select-toggle-varioref) | 86 | ("v" . reftex-select-cycle-ref-style-forward) |
| 90 | ("V" . reftex-select-toggle-fancyref) | 87 | ("V" . reftex-select-cycle-ref-style-backward) |
| 91 | ("m" . reftex-select-mark) | 88 | ("m" . reftex-select-mark) |
| 92 | ("u" . reftex-select-unmark) | 89 | ("u" . reftex-select-unmark) |
| 93 | ("," . reftex-select-mark-comma) | 90 | ("," . reftex-select-mark-comma) |
| @@ -511,6 +508,7 @@ During a selection process, these are the local bindings. | |||
| 511 | (defvar last-data) | 508 | (defvar last-data) |
| 512 | (defvar call-back) | 509 | (defvar call-back) |
| 513 | (defvar help-string) | 510 | (defvar help-string) |
| 511 | (defvar reftex-refstyle) | ||
| 514 | 512 | ||
| 515 | ;; The selection commands | 513 | ;; The selection commands |
| 516 | 514 | ||
| @@ -604,23 +602,28 @@ Useful for large TOC's." | |||
| 604 | (setq reftex-last-follow-point -1) | 602 | (setq reftex-last-follow-point -1) |
| 605 | (setq cb-flag (not cb-flag))) | 603 | (setq cb-flag (not cb-flag))) |
| 606 | 604 | ||
| 607 | (defvar reftex-refstyle) ; from reftex-reference | 605 | (defun reftex-select-cycle-ref-style-internal (&optional reverse) |
| 606 | "Cycle through macros used for referencing. | ||
| 607 | Cycle in reverse order if optional argument REVERSE is non-nil." | ||
| 608 | (let (list) | ||
| 609 | (dolist (style (reftex-ref-style-list)) | ||
| 610 | (mapc (lambda (x) (add-to-list 'list (car x) t)) | ||
| 611 | (nth 2 (assoc style reftex-ref-style-alist)))) | ||
| 612 | (when reverse | ||
| 613 | (setq list (reverse list))) | ||
| 614 | (setq reftex-refstyle (or (cadr (member reftex-refstyle list)) (car list)))) | ||
| 615 | (force-mode-line-update)) | ||
| 608 | 616 | ||
| 609 | (defun reftex-select-toggle-varioref () | 617 | (defun reftex-select-cycle-ref-style-forward () |
| 610 | "Toggle the macro used for referencing the label between \\ref and \\vref." | 618 | "Cycle forward through macros used for referencing." |
| 611 | (interactive) | 619 | (interactive) |
| 612 | (if (string= reftex-refstyle "\\ref") | 620 | (reftex-select-cycle-ref-style-internal)) |
| 613 | (setq reftex-refstyle "\\vref") | 621 | |
| 614 | (setq reftex-refstyle "\\ref")) | 622 | (defun reftex-select-cycle-ref-style-backward () |
| 615 | (force-mode-line-update)) | 623 | "Cycle backward through macros used for referencing." |
| 616 | (defun reftex-select-toggle-fancyref () | ||
| 617 | "Toggle the macro used for referencing the label between \\ref and \\vref." | ||
| 618 | (interactive) | 624 | (interactive) |
| 619 | (setq reftex-refstyle | 625 | (reftex-select-cycle-ref-style-internal t)) |
| 620 | (cond ((string= reftex-refstyle "\\ref") "\\fref") | 626 | |
| 621 | ((string= reftex-refstyle "\\fref") "\\Fref") | ||
| 622 | (t "\\ref"))) | ||
| 623 | (force-mode-line-update)) | ||
| 624 | (defun reftex-select-show-insertion-point () | 627 | (defun reftex-select-show-insertion-point () |
| 625 | "Show the point from where selection was started in another window." | 628 | "Show the point from where selection was started in another window." |
| 626 | (interactive) | 629 | (interactive) |
| @@ -721,7 +724,7 @@ Useful for large TOC's." | |||
| 721 | (if sep | 724 | (if sep |
| 722 | (format "*%c%d* " sep (decf cnt)) | 725 | (format "*%c%d* " sep (decf cnt)) |
| 723 | (format "*%d* " (decf cnt))))) | 726 | (format "*%d* " (decf cnt))))) |
| 724 | reftex-select-marked) | 727 | reftex-select-marked) |
| 725 | (message "Entry no longer marked"))) | 728 | (message "Entry no longer marked"))) |
| 726 | 729 | ||
| 727 | (defun reftex-select-help () | 730 | (defun reftex-select-help () |
| @@ -731,4 +734,6 @@ Useful for large TOC's." | |||
| 731 | (princ help-string)) | 734 | (princ help-string)) |
| 732 | (reftex-enlarge-to-fit "*RefTeX Help*" t)) | 735 | (reftex-enlarge-to-fit "*RefTeX Help*" t)) |
| 733 | 736 | ||
| 737 | (provide 'reftex-sel) | ||
| 738 | |||
| 734 | ;;; reftex-sel.el ends here | 739 | ;;; reftex-sel.el ends here |
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el index 519236a3621..4f73322d3f5 100644 --- a/lisp/textmodes/reftex-toc.el +++ b/lisp/textmodes/reftex-toc.el | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> |
| 6 | ;; Maintainer: auctex-devel@gnu.org | 6 | ;; Maintainer: auctex-devel@gnu.org |
| 7 | ;; Version: 4.31 | ||
| 8 | ;; Package: reftex | ||
| 9 | 7 | ||
| 10 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 11 | 9 | ||
| @@ -372,14 +370,14 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help | |||
| 372 | (error t))))) | 370 | (error t))))) |
| 373 | 371 | ||
| 374 | (defun reftex-re-enlarge () | 372 | (defun reftex-re-enlarge () |
| 375 | ;; Enlarge window to a remembered size. | 373 | "Enlarge window to a remembered size." |
| 376 | (if reftex-toc-split-windows-horizontally | 374 | (let ((count (if reftex-toc-split-windows-horizontally |
| 377 | (enlarge-window-horizontally | 375 | (- (or reftex-last-window-width (window-width)) |
| 378 | (max 0 (- (or reftex-last-window-width (window-width)) | 376 | (window-width)) |
| 379 | (window-width)))) | 377 | (- (or reftex-last-window-height (window-height)) |
| 380 | (enlarge-window | 378 | (window-height))))) |
| 381 | (max 0 (- (or reftex-last-window-height (window-height)) | 379 | (when (> count 0) |
| 382 | (window-height)))))) | 380 | (enlarge-window count reftex-toc-split-windows-horizontally)))) |
| 383 | 381 | ||
| 384 | (defun reftex-toc-dframe-p (&optional frame error) | 382 | (defun reftex-toc-dframe-p (&optional frame error) |
| 385 | ;; Check if FRAME is the dedicated TOC frame. | 383 | ;; Check if FRAME is the dedicated TOC frame. |
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index 3470ef9f3c1..df3d729adca 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> |
| 6 | ;; Maintainer: auctex-devel@gnu.org | 6 | ;; Maintainer: auctex-devel@gnu.org |
| 7 | ;; Version: 4.31 | ||
| 8 | ;; Package: reftex | ||
| 9 | 7 | ||
| 10 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 11 | 9 | ||
| @@ -207,6 +205,11 @@ distribution. Mixed-case symbols are convenience aliases.") | |||
| 207 | (?p . "(%2a %y\\nocite{%l})"))) | 205 | (?p . "(%2a %y\\nocite{%l})"))) |
| 208 | (locally "Full info in parenthesis" | 206 | (locally "Full info in parenthesis" |
| 209 | "(%2a %y, %j %v, %P, %e: %b, %u, %s %<)") | 207 | "(%2a %y, %j %v, %P, %e: %b, %u, %s %<)") |
| 208 | (context | ||
| 209 | "ConTeXt bib module" | ||
| 210 | ((?\C-m . "\\cite[%l]") | ||
| 211 | (?s . "\\cite[][%l]") | ||
| 212 | (?n . "\\nocite[%l]"))) | ||
| 210 | ) | 213 | ) |
| 211 | "Builtin versions of the citation format. | 214 | "Builtin versions of the citation format. |
| 212 | The following conventions are valid for all alist entries: | 215 | The following conventions are valid for all alist entries: |
| @@ -239,7 +242,7 @@ distribution. Mixed-case symbols are convenience aliases.") | |||
| 239 | "LaTeX label and citation support." | 242 | "LaTeX label and citation support." |
| 240 | :tag "RefTeX" | 243 | :tag "RefTeX" |
| 241 | :link '(url-link :tag "Home Page" | 244 | :link '(url-link :tag "Home Page" |
| 242 | "http://staff.science.uva.nl/~dominik/Tools/reftex/") | 245 | "http://www.gnu.org/software/auctex/reftex.html") |
| 243 | :link '(emacs-commentary-link :tag "Commentary in reftex.el" "reftex.el") | 246 | :link '(emacs-commentary-link :tag "Commentary in reftex.el" "reftex.el") |
| 244 | :link '(custom-manual "(reftex)Top") | 247 | :link '(custom-manual "(reftex)Top") |
| 245 | :prefix "reftex-" | 248 | :prefix "reftex-" |
| @@ -261,8 +264,8 @@ by whitespace." | |||
| 261 | 264 | ||
| 262 | (defcustom reftex-max-section-depth 12 | 265 | (defcustom reftex-max-section-depth 12 |
| 263 | "Maximum depth of section levels in document structure. | 266 | "Maximum depth of section levels in document structure. |
| 264 | Standard LaTeX needs default is 7, but there are packages for which this | 267 | The default in standard LaTeX is 7, but there are packages for |
| 265 | needs to be larger." | 268 | which this needs to be larger." |
| 266 | :group 'reftex-table-of-contents-browser | 269 | :group 'reftex-table-of-contents-browser |
| 267 | :type 'integer) | 270 | :type 'integer) |
| 268 | 271 | ||
| @@ -329,7 +332,7 @@ recentering will work for any TOC window created during the session. | |||
| 329 | 332 | ||
| 330 | Value 'frame (the default) means, turn automatic recentering on only while the | 333 | Value 'frame (the default) means, turn automatic recentering on only while the |
| 331 | dedicated TOC frame does exist, and do the recentering only in that frame. So | 334 | dedicated TOC frame does exist, and do the recentering only in that frame. So |
| 332 | when creating that frame (with \"d\" key in an ordinary TOC window), the | 335 | when creating that frame (with `d' key in an ordinary TOC window), the |
| 333 | automatic recentering is turned on. When the frame gets destroyed, automatic | 336 | automatic recentering is turned on. When the frame gets destroyed, automatic |
| 334 | recentering is turned off again. | 337 | recentering is turned off again. |
| 335 | 338 | ||
| @@ -383,8 +386,8 @@ This flag can be toggled from within the *toc* buffer with the `i' key." | |||
| 383 | 386 | ||
| 384 | (defcustom reftex-toc-confirm-promotion 2 | 387 | (defcustom reftex-toc-confirm-promotion 2 |
| 385 | "Non-nil means, promotion/demotion commands first prompt for confirmation. | 388 | "Non-nil means, promotion/demotion commands first prompt for confirmation. |
| 386 | When nil, the command is executed immediately. When this is an integer | 389 | If nil, the command is executed immediately. If this is an integer N, |
| 387 | N, ask for confirmation only if N or more section commands are going to be | 390 | ask for confirmation only if N or more section commands are going to be |
| 388 | changed." | 391 | changed." |
| 389 | :group 'reftex-table-of-contents-browser | 392 | :group 'reftex-table-of-contents-browser |
| 390 | :type '(choice | 393 | :type '(choice |
| @@ -408,7 +411,7 @@ This flag can be toggled from within the *toc* buffer with the `f' key." | |||
| 408 | 411 | ||
| 409 | (defcustom reftex-revisit-to-follow nil | 412 | (defcustom reftex-revisit-to-follow nil |
| 410 | "Non-nil means, follow-mode will revisit files if necessary. | 413 | "Non-nil means, follow-mode will revisit files if necessary. |
| 411 | When nil, follow-mode will be suspended for stuff in unvisited files." | 414 | If nil, follow-mode will be suspended for stuff in unvisited files." |
| 412 | :group 'reftex-table-of-contents-browser | 415 | :group 'reftex-table-of-contents-browser |
| 413 | :group 'reftex-referencing-labels | 416 | :group 'reftex-referencing-labels |
| 414 | :type 'boolean) | 417 | :type 'boolean) |
| @@ -452,8 +455,8 @@ of options." | |||
| 452 | (defcustom reftex-label-alist nil | 455 | (defcustom reftex-label-alist nil |
| 453 | "Alist with information on environments for \\label-\\ref use. | 456 | "Alist with information on environments for \\label-\\ref use. |
| 454 | 457 | ||
| 455 | This docstring is easier to understand after reading the configuration | 458 | This doc string is easier to understand after reading the configuration |
| 456 | examples in `reftex.el'. Looking at the builtin defaults in the constant | 459 | examples in the manual. Looking at the builtin defaults in the constant |
| 457 | `reftex-label-alist-builtin' may also be instructive. | 460 | `reftex-label-alist-builtin' may also be instructive. |
| 458 | 461 | ||
| 459 | Set this variable to define additions and changes to the default. The only | 462 | Set this variable to define additions and changes to the default. The only |
| @@ -481,12 +484,11 @@ ENV-OR-MACRO | |||
| 481 | Special names: `section' for section labels, `any' to define a group | 484 | Special names: `section' for section labels, `any' to define a group |
| 482 | which contains all labels. | 485 | which contains all labels. |
| 483 | 486 | ||
| 484 | This may also be a function to do local parsing and identify point | 487 | This may also be a function to do local parsing and identify point to |
| 485 | to be in a non-standard label environment. The function must take | 488 | be in a non-standard label environment. The function must take an |
| 486 | an argument BOUND and limit backward searches to this value. It | 489 | argument BOUND and limit backward searches to this value. It should |
| 487 | should return either nil or a cons cell (FUNCTION . POSITION) with | 490 | return either nil or the position where the special environment starts. |
| 488 | the function symbol and the position where the special environment | 491 | See the Info documentation for an example. |
| 489 | starts. See the Info documentation for an example. | ||
| 490 | 492 | ||
| 491 | Finally this may also be nil if the entry is only meant to change | 493 | Finally this may also be nil if the entry is only meant to change |
| 492 | some settings associated with the type indicator character (see below). | 494 | some settings associated with the type indicator character (see below). |
| @@ -500,7 +502,7 @@ TYPE-KEY | |||
| 500 | `equation' and `eqnarray'). | 502 | `equation' and `eqnarray'). |
| 501 | If the type indicator is nil and the macro has a label argument {*}, | 503 | If the type indicator is nil and the macro has a label argument {*}, |
| 502 | the macro defines neutral labels just like \\label. In this case | 504 | the macro defines neutral labels just like \\label. In this case |
| 503 | the reminder of this entry is ignored. | 505 | the remainder of this entry is ignored. |
| 504 | 506 | ||
| 505 | LABEL-PREFIX | 507 | LABEL-PREFIX |
| 506 | Label prefix string, like \"tab:\". | 508 | Label prefix string, like \"tab:\". |
| @@ -516,8 +518,8 @@ LABEL-PREFIX | |||
| 516 | Example: In a file `intro.tex', \"eq:%f:\" will become \"eq:intro:\"). | 518 | Example: In a file `intro.tex', \"eq:%f:\" will become \"eq:intro:\"). |
| 517 | 519 | ||
| 518 | REFERENCE-FORMAT | 520 | REFERENCE-FORMAT |
| 519 | Format string for reference insert in buffer. `%s' will be replaced by | 521 | Format string for reference insertion in buffer. `%s' will be replaced |
| 520 | the label. | 522 | by the label. |
| 521 | When the format starts with `~', the `~' will only be inserted if | 523 | When the format starts with `~', the `~' will only be inserted if |
| 522 | there is not already a whitespace before point. | 524 | there is not already a whitespace before point. |
| 523 | 525 | ||
| @@ -533,7 +535,7 @@ CONTEXT-METHOD | |||
| 533 | - If an integer, use the nth argument of the macro. As a special case, | 535 | - If an integer, use the nth argument of the macro. As a special case, |
| 534 | 1000 means to get text after the last macro argument. | 536 | 1000 means to get text after the last macro argument. |
| 535 | - If a string, use as regexp to search *backward* from the label. Context | 537 | - If a string, use as regexp to search *backward* from the label. Context |
| 536 | is then the text following the end of the match. E.g. putting this to | 538 | is then the text following the end of the match. E.g. setting this to |
| 537 | \"\\\\\\\\caption[[{]\" will use the caption in a figure or table | 539 | \"\\\\\\\\caption[[{]\" will use the caption in a figure or table |
| 538 | environment. | 540 | environment. |
| 539 | \"\\\\\\\\begin{eqnarray}\\\\|\\\\\\\\\\\\\\\\\" works for eqnarrays. | 541 | \"\\\\\\\\begin{eqnarray}\\\\|\\\\\\\\\\\\\\\\\" works for eqnarrays. |
| @@ -755,8 +757,7 @@ And here is the setup for RefTeX: | |||
| 755 | 757 | ||
| 756 | 3. Tell RefTeX to use this function | 758 | 3. Tell RefTeX to use this function |
| 757 | 759 | ||
| 758 | (setq reftex-special-environment-functions '(my-detect-linguex-list)) | 760 | (setq reftex-special-environment-functions '(my-detect-linguex-list))" |
| 759 | " | ||
| 760 | :group 'reftex-defining-label-environments | 761 | :group 'reftex-defining-label-environments |
| 761 | :type 'hook) | 762 | :type 'hook) |
| 762 | 763 | ||
| @@ -820,11 +821,13 @@ RefTeX's default function uses the variable `reftex-derive-label-parameters'." | |||
| 820 | :type 'symbol) | 821 | :type 'symbol) |
| 821 | 822 | ||
| 822 | (defcustom reftex-translate-to-ascii-function 'reftex-latin1-to-ascii | 823 | (defcustom reftex-translate-to-ascii-function 'reftex-latin1-to-ascii |
| 823 | "Filter function which will process a context string before it is used | 824 | "Filter function to convert a string to ASCII. |
| 824 | to derive a label from it. The intended application is to convert ISO or | 825 | The function is used to process a context string before it is |
| 825 | Mule characters into something valid in labels. The default function | 826 | used to derive a label from it. The intended application is to |
| 826 | removes the accents from Latin-1 characters. X-Symbol (>=2.6) sets this | 827 | convert ISO or Mule characters into something valid in labels. |
| 827 | variable to the much more general `x-symbol-translate-to-ascii'." | 828 | The default function removes the accents from Latin-1 characters. |
| 829 | X-Symbol (>=2.6) sets this variable to the much more general | ||
| 830 | `x-symbol-translate-to-ascii'." | ||
| 828 | :group 'reftex-making-and-inserting-labels | 831 | :group 'reftex-making-and-inserting-labels |
| 829 | :type 'symbol) | 832 | :type 'symbol) |
| 830 | 833 | ||
| @@ -947,28 +950,79 @@ This is used to string together whole reference sets, like | |||
| 947 | :group 'reftex-referencing-labels | 950 | :group 'reftex-referencing-labels |
| 948 | :type '(repeat (cons (character) (string)))) | 951 | :type '(repeat (cons (character) (string)))) |
| 949 | 952 | ||
| 953 | (defcustom reftex-ref-style-alist | ||
| 954 | '(("Default" t | ||
| 955 | (("\\ref" ?\C-m) ("\\pageref" ?p))) | ||
| 956 | ("Varioref" "varioref" | ||
| 957 | (("\\vref" ?v) ("\\vpageref" ?g) ("\\Vref" ?V) ("\\Ref" ?R))) | ||
| 958 | ("Fancyref" "fancyref" | ||
| 959 | (("\\fref" ?f) ("\\Fref" ?F))) | ||
| 960 | ("Hyperref" "hyperref" | ||
| 961 | (("\\autoref" ?a) ("\\autopageref" ?u)))) | ||
| 962 | "Alist of reference styles. | ||
| 963 | Each element is a list of the style name, the name of the LaTeX | ||
| 964 | package associated with the style or t for any package, and an | ||
| 965 | alist of macros where the first entry of each item is the | ||
| 966 | reference macro and the second a key for selecting the macro when | ||
| 967 | the macro type is being prompted for. (See also | ||
| 968 | `reftex-ref-macro-prompt'.) The keys, represented as characters, | ||
| 969 | have to be unique." | ||
| 970 | :group 'reftex-referencing-labels | ||
| 971 | :type '(alist :key-type (string :tag "Style name") | ||
| 972 | :value-type (group (choice :tag "Package" | ||
| 973 | (const :tag "Any package" t) | ||
| 974 | (string :tag "Name")) | ||
| 975 | (repeat :tag "Macros" | ||
| 976 | (group (string :tag "Macro") | ||
| 977 | (character :tag "Key")))))) | ||
| 978 | |||
| 979 | (defcustom reftex-ref-macro-prompt t | ||
| 980 | "If non-nil, `reftex-reference' prompts for the reference macro." | ||
| 981 | :group 'reftex-referencing-labels | ||
| 982 | :type 'boolean) | ||
| 983 | |||
| 950 | (defcustom reftex-vref-is-default nil | 984 | (defcustom reftex-vref-is-default nil |
| 951 | "Non-nil means, the varioref macro \\vref is used as default. | 985 | "Non-nil means, the varioref reference style is used as default. |
| 952 | In the selection buffer, the `v' key toggles the reference macro between | 986 | The value of this variable determines the default which is active |
| 953 | `\\ref' and `\\vref'. The value of this variable determines the default | 987 | when entering the selection process. Instead of nil or t, this |
| 954 | which is active when entering the selection process. | 988 | may also be a string of type letters indicating the label types |
| 955 | Instead of nil or t, this may also be a string of type letters indicating | 989 | for which it should be true. |
| 956 | the label types for which it should be true." | 990 | |
| 991 | This variable is obsolete, use `reftex-ref-style-default-list' | ||
| 992 | instead." | ||
| 957 | :group 'reftex-referencing-labels | 993 | :group 'reftex-referencing-labels |
| 958 | :type `(choice :tag "\\vref is default macro" ,@reftex-tmp)) | 994 | :type `(choice :tag "\\vref is default macro" ,@reftex-tmp)) |
| 959 | ;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x)))) | 995 | ;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x)))) |
| 960 | 996 | ||
| 961 | (defcustom reftex-fref-is-default nil | 997 | (defcustom reftex-fref-is-default nil |
| 962 | "Non-nil means, the fancyref macro \\fref is used as default. | 998 | "Non-nil means, the fancyref reference style is used as default. |
| 963 | In the selection buffer, the `V' key toggles the reference macro between | 999 | The value of this variable determines the default which is active |
| 964 | `\\ref', `\\fref' and `\\Fref'. The value of this variable determines | 1000 | when entering the selection process. Instead of nil or t, this |
| 965 | the default which is active when entering the selection process. | 1001 | may also be a string of type letters indicating the label types |
| 966 | Instead of nil or t, this may also be a string of type letters indicating | 1002 | for which it should be true. |
| 967 | the label types for which it should be true." | 1003 | |
| 1004 | This variable is obsolete, use `reftex-ref-style-default-list' | ||
| 1005 | instead." | ||
| 968 | :group 'reftex-referencing-labels | 1006 | :group 'reftex-referencing-labels |
| 969 | :type `(choice :tag "\\fref is default macro" ,@reftex-tmp)) | 1007 | :type `(choice :tag "\\fref is default macro" ,@reftex-tmp)) |
| 970 | ;;;###autoload(put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x)))) | 1008 | ;;;###autoload(put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x)))) |
| 971 | 1009 | ||
| 1010 | (defcustom reftex-ref-style-default-list '("Default") | ||
| 1011 | "List of reference styles to be activated by default. | ||
| 1012 | The order is significant and controls the order in which macros | ||
| 1013 | can be cycled in the buffer for selecting a label. The entries | ||
| 1014 | in the list have to match the respective reference style names | ||
| 1015 | used in the variable `reftex-ref-style-alist'." | ||
| 1016 | :group 'reftex-referencing-labels | ||
| 1017 | :type `(set ,@(mapcar (lambda (x) (list 'const (car x))) | ||
| 1018 | reftex-ref-style-alist))) | ||
| 1019 | |||
| 1020 | ;; Compatibility with obsolete variables. | ||
| 1021 | (when reftex-vref-is-default | ||
| 1022 | (add-to-list 'reftex-ref-style-default-list "Varioref")) | ||
| 1023 | (when reftex-fref-is-default | ||
| 1024 | (add-to-list 'reftex-ref-style-default-list "Fancyref")) | ||
| 1025 | |||
| 972 | (defcustom reftex-level-indent 2 | 1026 | (defcustom reftex-level-indent 2 |
| 973 | "Number of spaces to be used for indentation per section level." | 1027 | "Number of spaces to be used for indentation per section level." |
| 974 | :group 'reftex-referencing-labels | 1028 | :group 'reftex-referencing-labels |
| @@ -987,19 +1041,22 @@ a label type. If you set this variable to nil, RefTeX will always prompt." | |||
| 987 | 1041 | ||
| 988 | (defcustom reftex-format-ref-function nil | 1042 | (defcustom reftex-format-ref-function nil |
| 989 | "Function which produces the string to insert as a reference. | 1043 | "Function which produces the string to insert as a reference. |
| 990 | Normally should be nil, because the format to insert a reference can | 1044 | Normally should be nil, because the format to insert a reference |
| 991 | already be specified in `reftex-label-alist'. | 1045 | can already be specified in `reftex-label-alist'. |
| 992 | This hook also is used by the special commands to insert `\\vref' and `\\fref' | 1046 | |
| 993 | references, so even if you set this, your setting will be ignored by | 1047 | This hook also is used by the special commands to insert |
| 994 | the special commands. | 1048 | e.g. `\\vref' and `\\fref' references, so even if you set this, |
| 995 | The function will be called with two arguments, the LABEL and the DEFAULT | 1049 | your setting will be ignored by the special commands. |
| 996 | FORMAT, which normally is `~\\ref{%s}'. The function should return the | 1050 | |
| 997 | string to insert into the buffer." | 1051 | The function will be called with three arguments, the LABEL, the |
| 1052 | DEFAULT FORMAT, which normally is `~\\ref{%s}' and the REFERENCE | ||
| 1053 | STYLE. The function should return the string to insert into the | ||
| 1054 | buffer." | ||
| 998 | :group 'reftex-referencing-labels | 1055 | :group 'reftex-referencing-labels |
| 999 | :type 'function) | 1056 | :type '(choice (const nil) function)) |
| 1000 | 1057 | ||
| 1001 | (defcustom reftex-select-label-mode-hook nil | 1058 | (defcustom reftex-select-label-mode-hook nil |
| 1002 | "Mode hook for reftex-select-label-mode." | 1059 | "Mode hook for `reftex-select-label-mode'." |
| 1003 | :group 'reftex-referencing-labels | 1060 | :group 'reftex-referencing-labels |
| 1004 | :type 'hook) | 1061 | :type 'hook) |
| 1005 | 1062 | ||
| @@ -1009,7 +1066,8 @@ string to insert into the buffer." | |||
| 1009 | "Support for referencing bibliographic data with BibTeX." | 1066 | "Support for referencing bibliographic data with BibTeX." |
| 1010 | :group 'reftex) | 1067 | :group 'reftex) |
| 1011 | 1068 | ||
| 1012 | (defcustom reftex-bibliography-commands '("bibliography" "nobibliography") | 1069 | (defcustom reftex-bibliography-commands |
| 1070 | '("bibliography" "nobibliography" "setupbibtex\\[.*?database=") | ||
| 1013 | "LaTeX commands which specify the BibTeX databases to use with the document." | 1071 | "LaTeX commands which specify the BibTeX databases to use with the document." |
| 1014 | :group 'reftex-citation-support | 1072 | :group 'reftex-citation-support |
| 1015 | :type '(repeat string)) | 1073 | :type '(repeat string)) |
| @@ -1114,7 +1172,7 @@ E.g.: (setq reftex-cite-format 'natbib)" | |||
| 1114 | 1172 | ||
| 1115 | (defcustom reftex-cite-prompt-optional-args 'maybe | 1173 | (defcustom reftex-cite-prompt-optional-args 'maybe |
| 1116 | "Non-nil means, prompt for empty optional arguments in cite macros. | 1174 | "Non-nil means, prompt for empty optional arguments in cite macros. |
| 1117 | When an entry in `reftex-cite-format' ist given with square brackets to | 1175 | When an entry in `reftex-cite-format' is given with square brackets to |
| 1118 | indicate optional arguments (for example \\cite[][]{%l}), RefTeX can | 1176 | indicate optional arguments (for example \\cite[][]{%l}), RefTeX can |
| 1119 | prompt for values. Possible values are: | 1177 | prompt for values. Possible values are: |
| 1120 | 1178 | ||
| @@ -1189,13 +1247,28 @@ The function will be called with two arguments, the CITATION KEY and the | |||
| 1189 | DEFAULT FORMAT, which is taken from `reftex-cite-format'. The function | 1247 | DEFAULT FORMAT, which is taken from `reftex-cite-format'. The function |
| 1190 | should return the string to insert into the buffer." | 1248 | should return the string to insert into the buffer." |
| 1191 | :group 'reftex-citation-support | 1249 | :group 'reftex-citation-support |
| 1192 | :type 'function) | 1250 | :type '(choice (const nil) function)) |
| 1193 | 1251 | ||
| 1194 | (defcustom reftex-select-bib-mode-hook nil | 1252 | (defcustom reftex-select-bib-mode-hook nil |
| 1195 | "Mode hook for reftex-select-bib-mode." | 1253 | "Mode hook for reftex-select-bib-mode." |
| 1196 | :group 'reftex-citation-support | 1254 | :group 'reftex-citation-support |
| 1197 | :type 'hook) | 1255 | :type 'hook) |
| 1198 | 1256 | ||
| 1257 | (defcustom reftex-cite-key-separator "," | ||
| 1258 | "String to be used for separating several keys in a \\cite macro." | ||
| 1259 | :group 'reftex-citation-support | ||
| 1260 | :type 'string) | ||
| 1261 | |||
| 1262 | (defcustom reftex-create-bibtex-header nil | ||
| 1263 | "Header to insert in BibTeX files generated by RefTeX." | ||
| 1264 | :group 'reftex-citation-support | ||
| 1265 | :type 'string) | ||
| 1266 | |||
| 1267 | (defcustom reftex-create-bibtex-footer nil | ||
| 1268 | "Footer to insert in BibTeX files generated by RefTeX." | ||
| 1269 | :group 'reftex-citation-support | ||
| 1270 | :type 'string) | ||
| 1271 | |||
| 1199 | ;; Index Support Configuration | 1272 | ;; Index Support Configuration |
| 1200 | 1273 | ||
| 1201 | (defgroup reftex-index-support nil | 1274 | (defgroup reftex-index-support nil |
| @@ -1223,7 +1296,9 @@ These correspond to the makeindex keywords LEVEL ENCAP ACTUAL QUOTE ESCAPE." | |||
| 1223 | (string :tag "ESCAPE char "))) | 1296 | (string :tag "ESCAPE char "))) |
| 1224 | 1297 | ||
| 1225 | (defcustom reftex-index-macros nil | 1298 | (defcustom reftex-index-macros nil |
| 1226 | "Macros which define index entries. The structure is | 1299 | "Macros which define index entries. |
| 1300 | |||
| 1301 | The structure is | ||
| 1227 | 1302 | ||
| 1228 | \(MACRO INDEX-TAG KEY PREFIX EXCLUDE REPEAT) | 1303 | \(MACRO INDEX-TAG KEY PREFIX EXCLUDE REPEAT) |
| 1229 | 1304 | ||
| @@ -1456,7 +1531,7 @@ This flag can be toggled from within the *Index* buffer with the `f' key." | |||
| 1456 | This is used when `reftex-view-crossref' is called with point in an | 1531 | This is used when `reftex-view-crossref' is called with point in an |
| 1457 | argument of a macro. Note that crossref viewing for citations, | 1532 | argument of a macro. Note that crossref viewing for citations, |
| 1458 | references (both ways) and index entries is hard-coded. This variable | 1533 | references (both ways) and index entries is hard-coded. This variable |
| 1459 | is only to configure additional structures for which crossreference | 1534 | is only to configure additional structures for which cross-reference |
| 1460 | viewing can be useful. Each entry has the structure | 1535 | viewing can be useful. Each entry has the structure |
| 1461 | 1536 | ||
| 1462 | \(MACRO-RE SEARCH-RE HIGHLIGHT). | 1537 | \(MACRO-RE SEARCH-RE HIGHLIGHT). |
| @@ -1499,15 +1574,17 @@ entries and for BibTeX database files with live associated buffers." | |||
| 1499 | :type 'boolean) | 1574 | :type 'boolean) |
| 1500 | 1575 | ||
| 1501 | (defcustom reftex-cache-cite-echo t | 1576 | (defcustom reftex-cache-cite-echo t |
| 1502 | "Non-nil means, the information displayed in the echo area for cite macros | 1577 | "Non-nil means, echoed information for cite macros is cached. |
| 1503 | is cached and even saved along with the parsing information. The cache | 1578 | The information displayed in the echo area for cite macros is |
| 1504 | survives document scans. In order to clear it, use M-x reftex-reset-mode." | 1579 | cached and even saved along with the parsing information. The |
| 1580 | cache survives document scans. In order to clear it, use M-x | ||
| 1581 | reftex-reset-mode <RET>." | ||
| 1505 | :group 'reftex-viewing-cross-references | 1582 | :group 'reftex-viewing-cross-references |
| 1506 | :type 'boolean) | 1583 | :type 'boolean) |
| 1507 | 1584 | ||
| 1508 | (defcustom reftex-display-copied-context-hook nil | 1585 | (defcustom reftex-display-copied-context-hook nil |
| 1509 | "Normal Hook which is run before context is displayed anywhere. Designed | 1586 | "Normal hook which is run before context is displayed anywhere. |
| 1510 | for X-Symbol, but may have other uses as well." | 1587 | Designed for X-Symbol, but may have other uses as well." |
| 1511 | :group 'reftex-viewing-cross-references | 1588 | :group 'reftex-viewing-cross-references |
| 1512 | :group 'reftex-referencing-labels | 1589 | :group 'reftex-referencing-labels |
| 1513 | :type 'hook) | 1590 | :type 'hook) |
| @@ -1690,7 +1767,7 @@ The file MASTER.rel in the same directory as MASTER.tex is used to save the | |||
| 1690 | information. When this variable is t, | 1767 | information. When this variable is t, |
| 1691 | - accessing the parsing information for the first time in an editing session | 1768 | - accessing the parsing information for the first time in an editing session |
| 1692 | will read that file (if available) instead of parsing the document. | 1769 | will read that file (if available) instead of parsing the document. |
| 1693 | - exiting Emacs or killing a buffer in reftex-mode will cause a new version | 1770 | - exiting Emacs or killing a buffer in `reftex-mode' will cause a new version |
| 1694 | of the file to be written." | 1771 | of the file to be written." |
| 1695 | :group 'reftex-optimizations-for-large-documents | 1772 | :group 'reftex-optimizations-for-large-documents |
| 1696 | :type 'boolean) | 1773 | :type 'boolean) |
| @@ -1855,22 +1932,13 @@ symbol indicating in what context the hook is called." | |||
| 1855 | 1932 | ||
| 1856 | (defcustom reftex-extra-bindings nil | 1933 | (defcustom reftex-extra-bindings nil |
| 1857 | "Non-nil means, make additional key bindings on startup. | 1934 | "Non-nil means, make additional key bindings on startup. |
| 1858 | These extra bindings are located in the | 1935 | These extra bindings are located in the users `C-c letter' map." |
| 1859 | `reftex-extra-bindings-map' map, bound to | ||
| 1860 | `reftex-extra-bindings-prefix'." | ||
| 1861 | :group 'reftex-miscellaneous-configurations | ||
| 1862 | :type 'boolean) | ||
| 1863 | |||
| 1864 | ;; below, default is C-c C-y because it is free in LaTeX mode. | ||
| 1865 | (defcustom reftex-extra-bindings-prefix "\C-c\C-y" | ||
| 1866 | "When `reftex-extra-bindings' is set to non-nil, use extra | ||
| 1867 | bindings with this prefix bound to `reftex-extra-bindings-map'." | ||
| 1868 | :group 'reftex-miscellaneous-configurations | 1936 | :group 'reftex-miscellaneous-configurations |
| 1869 | :type 'boolean) | 1937 | :type 'boolean) |
| 1870 | 1938 | ||
| 1871 | (defcustom reftex-plug-into-AUCTeX nil | 1939 | (defcustom reftex-plug-into-AUCTeX nil |
| 1872 | "Plug-in flags for AUCTeX interface. | 1940 | "Plug-in flags for AUCTeX interface. |
| 1873 | This variable is a list of 4 boolean flags. When a flag is non-nil, | 1941 | This variable is a list of 5 boolean flags. When a flag is non-nil, |
| 1874 | RefTeX will | 1942 | RefTeX will |
| 1875 | 1943 | ||
| 1876 | - supply labels in new sections and environments (flag 1) | 1944 | - supply labels in new sections and environments (flag 1) |
| @@ -1900,8 +1968,7 @@ may require a restart of Emacs in order to become effective." | |||
| 1900 | (boolean :tag "supply argument for macros like `\\label' ") | 1968 | (boolean :tag "supply argument for macros like `\\label' ") |
| 1901 | (boolean :tag "supply argument for macros like `\\ref' ") | 1969 | (boolean :tag "supply argument for macros like `\\ref' ") |
| 1902 | (boolean :tag "supply argument for macros like `\\cite' ") | 1970 | (boolean :tag "supply argument for macros like `\\cite' ") |
| 1903 | (boolean :tag "supply argument for macros like `\\index' ") | 1971 | (boolean :tag "supply argument for macros like `\\index' ")))) |
| 1904 | ))) | ||
| 1905 | 1972 | ||
| 1906 | (defcustom reftex-allow-detached-macro-args nil | 1973 | (defcustom reftex-allow-detached-macro-args nil |
| 1907 | "Non-nil means, allow arguments of macros to be detached by whitespace. | 1974 | "Non-nil means, allow arguments of macros to be detached by whitespace. |
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index 8318dc0d5f3..7052dcf473e 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | ;; Author: Carsten Dominik <dominik@science.uva.nl> | 4 | ;; Author: Carsten Dominik <dominik@science.uva.nl> |
| 5 | ;; Maintainer: auctex-devel@gnu.org | 5 | ;; Maintainer: auctex-devel@gnu.org |
| 6 | ;; Version: 4.31 | ||
| 7 | ;; Keywords: tex | 6 | ;; Keywords: tex |
| 8 | 7 | ||
| 9 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| @@ -21,10 +20,8 @@ | |||
| 21 | ;; You should have received a copy of the GNU General Public License | 20 | ;; You should have received a copy of the GNU General Public License |
| 22 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | 21 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 23 | 22 | ||
| 24 | ;;--------------------------------------------------------------------------- | ||
| 25 | ;; | ||
| 26 | ;;; Commentary: | 23 | ;;; Commentary: |
| 27 | ;; | 24 | |
| 28 | ;; RefTeX is a minor mode with distinct support for \ref, \label, \cite, | 25 | ;; RefTeX is a minor mode with distinct support for \ref, \label, \cite, |
| 29 | ;; and \index commands in (multi-file) LaTeX documents. | 26 | ;; and \index commands in (multi-file) LaTeX documents. |
| 30 | ;; - A table of contents provides easy access to any part of a document. | 27 | ;; - A table of contents provides easy access to any part of a document. |
| @@ -34,243 +31,23 @@ | |||
| 34 | ;; - Text phrases can be collected in a file, for later global indexing. | 31 | ;; - Text phrases can be collected in a file, for later global indexing. |
| 35 | ;; - The index preview buffer helps to check and edit index entries. | 32 | ;; - The index preview buffer helps to check and edit index entries. |
| 36 | ;; | 33 | ;; |
| 37 | ;; | 34 | ;; There is an extensive Texinfo document describing RefTeX in detail. |
| 38 | ;; INSTALLATION | ||
| 39 | ;; ------------ | ||
| 40 | ;; | ||
| 41 | ;; - If this file is part of an X/Emacs distribution, it is installed. | ||
| 42 | ;; - For XEmacs 21.x, you need to install the RefTeX plug-in package | ||
| 43 | ;; available from the XEmacs distribution sites. | ||
| 44 | ;; - If you have downloaded this file from the maintainers webpage, follow | ||
| 45 | ;; the instructions in the INSTALL file of the distribution. | ||
| 46 | ;; | ||
| 47 | ;; To turn RefTeX Mode on and off in a buffer, use `M-x reftex-mode'. | ||
| 48 | ;; | ||
| 49 | ;; To turn on RefTeX Mode for all LaTeX files, add the following lines | ||
| 50 | ;; to your init file: | ||
| 51 | ;; | ||
| 52 | ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; AUCTeX LaTeX mode | ||
| 53 | ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; Emacs latex mode | ||
| 54 | ;; | ||
| 55 | ;; | ||
| 56 | ;; DOCUMENTATION | ||
| 57 | ;; ------------- | ||
| 58 | ;; | ||
| 59 | ;; See below for a short summary of how to use RefTeX. | ||
| 60 | ;; | ||
| 61 | ;; There is an extensive texinfo document describing RefTeX in detail. | ||
| 62 | ;; One way to view this documentation is `M-x reftex-info RET'. | 35 | ;; One way to view this documentation is `M-x reftex-info RET'. |
| 63 | ;; | 36 | ;; |
| 64 | ;; The documentation in various formats is also available at | 37 | ;; The documentation in various formats is also available at |
| 65 | ;; | 38 | ;; |
| 66 | ;; http://zon.astro.uva.nl/~dominik/Tools/ | 39 | ;; http://www.gnu.org/software/auctex/manual/reftex.index.html |
| 67 | ;; | ||
| 68 | ;;--------------------------------------------------------------------------- | ||
| 69 | ;; | ||
| 70 | ;; Introduction | ||
| 71 | ;; ************ | ||
| 72 | ;; | ||
| 73 | ;; RefTeX is a specialized package for support of labels, references, | ||
| 74 | ;; citations, and the index in LaTeX. RefTeX wraps itself round 4 LaTeX | ||
| 75 | ;; macros: `\label', `\ref', `\cite', and `\index'. Using these macros | ||
| 76 | ;; usually requires looking up different parts of the document and | ||
| 77 | ;; searching through BibTeX database files. RefTeX automates these | ||
| 78 | ;; time-consuming tasks almost entirely. It also provides functions to | ||
| 79 | ;; display the structure of a document and to move around in this | ||
| 80 | ;; structure quickly. | ||
| 81 | ;; | ||
| 82 | ;; *Note Imprint::, for information about who to contact for help, bug | ||
| 83 | ;; reports or suggestions. | ||
| 84 | ;; | ||
| 85 | ;; Environment | ||
| 86 | ;; =========== | ||
| 87 | ;; | ||
| 88 | ;; RefTeX needs to access all files which are part of a multifile | ||
| 89 | ;; document, and the BibTeX database files requested by the | ||
| 90 | ;; `\bibliography' command. To find these files, RefTeX will require a | ||
| 91 | ;; search path, i.e. a list of directories to check. Normally this list | ||
| 92 | ;; is stored in the environment variables `TEXINPUTS' and `BIBINPUTS' | ||
| 93 | ;; which are also used by RefTeX. However, on some systems these | ||
| 94 | ;; variables do not contain the full search path. If RefTeX does not work | ||
| 95 | ;; for you because it cannot find some files, read *Note Finding Files::. | ||
| 96 | ;; | ||
| 97 | ;; Entering RefTeX Mode | ||
| 98 | ;; ==================== | ||
| 99 | ;; | ||
| 100 | ;; To turn RefTeX Mode on and off in a particular buffer, use `M-x | ||
| 101 | ;; reftex-mode'. To turn on RefTeX Mode for all LaTeX files, add the | ||
| 102 | ;; following lines to your init file: | ||
| 103 | ;; | ||
| 104 | ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode | ||
| 105 | ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode | ||
| 106 | ;; | ||
| 107 | ;; RefTeX in a Nutshell | ||
| 108 | ;; ==================== | ||
| 109 | ;; | ||
| 110 | ;; 1. Table of Contents | ||
| 111 | ;; Typing `C-c =' (`reftex-toc') will show a table of contents of the | ||
| 112 | ;; document. This buffer can display sections, labels and index | ||
| 113 | ;; entries defined in the document. From the buffer, you can jump | ||
| 114 | ;; quickly to every part of your document. Press `?' to get help. | ||
| 115 | ;; | ||
| 116 | ;; 2. Labels and References | ||
| 117 | ;; RefTeX helps to create unique labels and to find the correct key | ||
| 118 | ;; for references quickly. It distinguishes labels for different | ||
| 119 | ;; environments, knows about all standard environments (and many | ||
| 120 | ;; others), and can be configured to recognize any additional labeled | ||
| 121 | ;; environments you have defined yourself (variable | ||
| 122 | ;; `reftex-label-alist'). | ||
| 123 | ;; | ||
| 124 | ;; * Creating Labels | ||
| 125 | ;; Type `C-c (' (`reftex-label') to insert a label at point. | ||
| 126 | ;; RefTeX will either | ||
| 127 | ;; - derive a label from context (default for section labels) | ||
| 128 | ;; - prompt for a label string (default for figures and | ||
| 129 | ;; tables) or | ||
| 130 | ;; - insert a simple label made of a prefix and a number (all | ||
| 131 | ;; other environments) | ||
| 132 | ;; | ||
| 133 | ;; Which labels are created how is configurable with the variable | ||
| 134 | ;; `reftex-insert-label-flags'. | ||
| 135 | ;; | ||
| 136 | ;; * Referencing Labels | ||
| 137 | ;; To make a reference, type `C-c )' (`reftex-reference'). This | ||
| 138 | ;; shows an outline of the document with all labels of a certain | ||
| 139 | ;; type (figure, equation,...) and some label context. | ||
| 140 | ;; Selecting a label inserts a `\ref{LABEL}' macro into the | ||
| 141 | ;; original buffer. | ||
| 142 | ;; | ||
| 143 | ;; 3. Citations | ||
| 144 | ;; Typing `C-c [' (`reftex-citation') will let you specify a regular | ||
| 145 | ;; expression to search in current BibTeX database files (as | ||
| 146 | ;; specified in the `\bibliography' command) and pull out a list of | ||
| 147 | ;; matches for you to choose from. The list is _formatted_ and | ||
| 148 | ;; sorted. The selected article is referenced as `\cite{KEY}' (see | ||
| 149 | ;; the variable `reftex-cite-format' if you want to insert different | ||
| 150 | ;; macros). | ||
| 151 | ;; | ||
| 152 | ;; 4. Index Support | ||
| 153 | ;; RefTeX helps to enter index entries. It also compiles all entries | ||
| 154 | ;; into an alphabetically sorted `*Index*' buffer which you can use | ||
| 155 | ;; to check and edit the entries. RefTeX knows about the standard | ||
| 156 | ;; index macros and can be configured to recognize any additional | ||
| 157 | ;; macros you have defined (`reftex-index-macros'). Multiple indices | ||
| 158 | ;; are supported. | ||
| 159 | ;; | ||
| 160 | ;; * Creating Index Entries | ||
| 161 | ;; To index the current selection or the word at point, type | ||
| 162 | ;; `C-c /' (`reftex-index-selection-or-word'). The default macro | ||
| 163 | ;; `reftex-index-default-macro' will be used. For a more | ||
| 164 | ;; complex entry type `C-c <' (`reftex-index'), select any of | ||
| 165 | ;; the index macros and enter the arguments with completion. | ||
| 166 | ;; | ||
| 167 | ;; * The Index Phrases File (Delayed Indexing) | ||
| 168 | ;; Type `C-c \' (`reftex-index-phrase-selection-or-word') to add | ||
| 169 | ;; the current word or selection to a special _index phrase | ||
| 170 | ;; file_. RefTeX can later search the document for occurrences | ||
| 171 | ;; of these phrases and let you interactively index the matches. | ||
| 172 | ;; | ||
| 173 | ;; * Displaying and Editing the Index | ||
| 174 | ;; To display the compiled index in a special buffer, type `C-c | ||
| 175 | ;; >' (`reftex-display-index'). From that buffer you can check | ||
| 176 | ;; and edit all entries. | ||
| 177 | ;; | ||
| 178 | ;; 5. Viewing Cross-References | ||
| 179 | ;; When point is on the KEY argument of a cross-referencing macro | ||
| 180 | ;; (`\label', `\ref', `\cite', `\bibitem', `\index', and variations) | ||
| 181 | ;; or inside a BibTeX database entry, you can press `C-c &' | ||
| 182 | ;; (`reftex-view-crossref') to display corresponding locations in the | ||
| 183 | ;; document and associated BibTeX database files. | ||
| 184 | ;; When the enclosing macro is `\cite' or `\ref' and no other message | ||
| 185 | ;; occupies the echo area, information about the citation or label | ||
| 186 | ;; will automatically be displayed in the echo area. | ||
| 187 | ;; | ||
| 188 | ;; 6. Multifile Documents | ||
| 189 | ;; Multifile Documents are fully supported. The included files must | ||
| 190 | ;; have a file variable `TeX-master' or `tex-main-file' pointing to | ||
| 191 | ;; the master file. RefTeX provides cross-referencing information | ||
| 192 | ;; from all parts of the document, and across document borders | ||
| 193 | ;; (`xr.sty'). | ||
| 194 | ;; | ||
| 195 | ;; 7. Document Parsing | ||
| 196 | ;; RefTeX needs to parse the document in order to find labels and | ||
| 197 | ;; other information. It does it automatically once and updates its | ||
| 198 | ;; list internally when `reftex-label' and `reftex-index' are used. | ||
| 199 | ;; To enforce reparsing, call any of the commands described above | ||
| 200 | ;; with a raw `C-u' prefix, or press the `r' key in the label | ||
| 201 | ;; selection buffer, the table of contents buffer, or the index | ||
| 202 | ;; buffer. | ||
| 203 | ;; | ||
| 204 | ;; 8. AUCTeX | ||
| 205 | ;; If your major LaTeX mode is AUCTeX, RefTeX can cooperate with it | ||
| 206 | ;; (see variable `reftex-plug-into-AUCTeX'). AUCTeX contains style | ||
| 207 | ;; files which trigger appropriate settings in RefTeX, so that for | ||
| 208 | ;; many of the popular LaTeX packages no additional customizations | ||
| 209 | ;; will be necessary. | ||
| 210 | ;; | ||
| 211 | ;; 9. Useful Settings | ||
| 212 | ;; To make RefTeX faster for large documents, try these: | ||
| 213 | ;; (setq reftex-enable-partial-scans t) | ||
| 214 | ;; (setq reftex-save-parse-info t) | ||
| 215 | ;; (setq reftex-use-multiple-selection-buffers t) | ||
| 216 | ;; | ||
| 217 | ;; To integrate with AUCTeX, use | ||
| 218 | ;; (setq reftex-plug-into-AUCTeX t) | ||
| 219 | ;; | ||
| 220 | ;; To make your own LaTeX macro definitions known to RefTeX, | ||
| 221 | ;; customize the variables | ||
| 222 | ;; `reftex-label-alist' (for label macros/environments) | ||
| 223 | ;; `reftex-section-levels' (for sectioning commands) | ||
| 224 | ;; `reftex-cite-format' (for `\cite'-like macros) | ||
| 225 | ;; `reftex-index-macros' (for `\index'-like macros) | ||
| 226 | ;; `reftex-index-default-macro' (to set the default macro) | ||
| 227 | ;; If you have a large number of macros defined, you may want to write | ||
| 228 | ;; an AUCTeX style file to support them with both AUCTeX and RefTeX. | ||
| 229 | ;; | ||
| 230 | ;; 10. Where Next? | ||
| 231 | ;; Go ahead and use RefTeX. Use its menus until you have picked up | ||
| 232 | ;; the key bindings. For an overview of what you can do in each of | ||
| 233 | ;; the different special buffers, press `?'. Read the manual if you | ||
| 234 | ;; get stuck, of if you are curious what else might be available. | ||
| 235 | ;; The first part of the manual explains in a tutorial way how to use | ||
| 236 | ;; and customize RefTeX. The second part is a command and variable | ||
| 237 | ;; reference. | ||
| 238 | ;; | ||
| 239 | ;;--------------------------------------------------------------------------- | ||
| 240 | ;; | ||
| 241 | ;; AUTHOR | ||
| 242 | ;; ====== | ||
| 243 | ;; | ||
| 244 | ;; Carsten Dominik <dominik@science.uva.nl> | ||
| 245 | ;; | ||
| 246 | ;; with contributions from Stephen Eglen | ||
| 247 | ;; | 40 | ;; |
| 248 | ;; RefTeX is bundled with Emacs and available as a plug-in package for | 41 | ;; RefTeX is bundled with Emacs and available as a plug-in package for |
| 249 | ;; XEmacs 21.x. If you need to install it yourself, you can find a | 42 | ;; XEmacs 21.x. If you need to install it yourself, you can find a |
| 250 | ;; distribution at | 43 | ;; distribution at |
| 251 | ;; | 44 | ;; |
| 252 | ;; http://zon.astro.uva.nl/~dominik/Tools/ | 45 | ;; http://www.gnu.org/software/auctex/reftex.html |
| 253 | ;; | 46 | ;; |
| 254 | ;; THANKS TO: | 47 | ;; RefTeX was written by Carsten Dominik <dominik@science.uva.nl> with |
| 255 | ;; --------- | 48 | ;; contributions from Stephen Eglen. It is currently maintained by |
| 256 | ;; Thanks to the people on the Net who have used RefTeX and helped | 49 | ;; the AUCTeX project. |
| 257 | ;; developing it with their reports. In particular thanks to | 50 | |
| 258 | ;; | ||
| 259 | ;; Fran Burstall, Alastair Burt, Soren Dayton, Stephen Eglen, | ||
| 260 | ;; Karl Eichwalder, Peter Galbraith, Dieter Kraft, Kai Grossjohann, | ||
| 261 | ;; Frank Harrell, Adrian Lanz, Rory Molinari, Stefan Monnier, | ||
| 262 | ;; Laurent Mugnier, Sudeep Kumar Palat, Daniel Polani, Robin Socha, | ||
| 263 | ;; Richard Stanton, Allan Strand, Jan Vroonhof, Christoph Wedler, | ||
| 264 | ;; Alan Williams. | ||
| 265 | ;; | ||
| 266 | ;; Finally thanks to Uwe Bolick who first got me (some years ago) into | ||
| 267 | ;; supporting LaTeX labels and references with an editor (which was | ||
| 268 | ;; MicroEmacs at the time). | ||
| 269 | ;; | ||
| 270 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
| 271 | ;; | ||
| 272 | ;;;;;; | ||
| 273 | |||
| 274 | ;;; Code: | 51 | ;;; Code: |
| 275 | 52 | ||
| 276 | (eval-when-compile (require 'cl)) | 53 | (eval-when-compile (require 'cl)) |
| @@ -289,52 +66,13 @@ | |||
| 289 | (set symbol value))) | 66 | (set symbol value))) |
| 290 | 67 | ||
| 291 | 68 | ||
| 292 | ;;; ========================================================================= | 69 | ;; Configuration variables |
| 293 | ;;; | ||
| 294 | ;;; Configuration variables | ||
| 295 | |||
| 296 | (require 'reftex-vars) | 70 | (require 'reftex-vars) |
| 297 | 71 | ||
| 298 | 72 | ||
| 299 | ;;; ========================================================================= | 73 | ;;; Autoloads |
| 300 | ;;; | ||
| 301 | ;;; Define the formal stuff for a minor mode named RefTeX. | ||
| 302 | ;;; | ||
| 303 | |||
| 304 | (defconst reftex-version "RefTeX version 4.31" | ||
| 305 | "Version string for RefTeX.") | ||
| 306 | |||
| 307 | (defvar reftex-mode-map (make-sparse-keymap) | ||
| 308 | "Keymap for RefTeX mode.") | ||
| 309 | |||
| 310 | (defvar reftex-mode-menu nil) | ||
| 311 | (defvar reftex-syntax-table nil) | ||
| 312 | (defvar reftex-syntax-table-for-bib nil) | ||
| 313 | |||
| 314 | (unless reftex-syntax-table | ||
| 315 | (setq reftex-syntax-table (copy-syntax-table)) | ||
| 316 | (modify-syntax-entry ?\( "." reftex-syntax-table) | ||
| 317 | (modify-syntax-entry ?\) "." reftex-syntax-table)) | ||
| 318 | |||
| 319 | (unless reftex-syntax-table-for-bib | ||
| 320 | (setq reftex-syntax-table-for-bib | ||
| 321 | (copy-syntax-table reftex-syntax-table)) | ||
| 322 | (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib) | ||
| 323 | (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib) | ||
| 324 | (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib) | ||
| 325 | (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib)) | ||
| 326 | |||
| 327 | ;; The following definitions are out of place, but I need them here | ||
| 328 | ;; to make the compilation of reftex-mode not complain. | ||
| 329 | (defvar reftex-auto-view-crossref-timer nil | ||
| 330 | "The timer used for auto-view-crossref.") | ||
| 331 | (defvar reftex-toc-auto-recenter-timer nil | ||
| 332 | "The idle timer used to recenter the toc window.") | ||
| 333 | |||
| 334 | ;;; ========================================================================= | ||
| 335 | ;;; | ||
| 336 | ;;; Parser functions | ||
| 337 | 74 | ||
| 75 | ;; Parser functions | ||
| 338 | (autoload 'reftex-parse-one "reftex-parse" | 76 | (autoload 'reftex-parse-one "reftex-parse" |
| 339 | "Re-parse this file." t) | 77 | "Re-parse this file." t) |
| 340 | (autoload 'reftex-parse-all "reftex-parse" | 78 | (autoload 'reftex-parse-all "reftex-parse" |
| @@ -358,11 +96,7 @@ | |||
| 358 | (autoload 'reftex-ensure-index-support "reftex-parse") | 96 | (autoload 'reftex-ensure-index-support "reftex-parse") |
| 359 | (autoload 'reftex-everything-regexp "reftex-parse") | 97 | (autoload 'reftex-everything-regexp "reftex-parse") |
| 360 | 98 | ||
| 361 | 99 | ;; Labels and References | |
| 362 | ;;; ========================================================================= | ||
| 363 | ;;; | ||
| 364 | ;;; Labels and References | ||
| 365 | |||
| 366 | (autoload 'reftex-label-location "reftex-ref") | 100 | (autoload 'reftex-label-location "reftex-ref") |
| 367 | (autoload 'reftex-label-info-update "reftex-ref") | 101 | (autoload 'reftex-label-info-update "reftex-ref") |
| 368 | (autoload 'reftex-label-info "reftex-ref") | 102 | (autoload 'reftex-label-info "reftex-ref") |
| @@ -381,10 +115,7 @@ | |||
| 381 | (autoload 'reftex-goto-label "reftex-ref" | 115 | (autoload 'reftex-goto-label "reftex-ref" |
| 382 | "Prompt for label name and go to that location." t) | 116 | "Prompt for label name and go to that location." t) |
| 383 | 117 | ||
| 384 | ;;; ========================================================================= | 118 | ;; Table of contents |
| 385 | ;;; | ||
| 386 | ;;; Table of contents | ||
| 387 | |||
| 388 | (autoload 'reftex-toc "reftex-toc" | 119 | (autoload 'reftex-toc "reftex-toc" |
| 389 | "Show the table of contents for the current document." t) | 120 | "Show the table of contents for the current document." t) |
| 390 | (autoload 'reftex-toc-recenter "reftex-toc" | 121 | (autoload 'reftex-toc-recenter "reftex-toc" |
| @@ -392,10 +123,7 @@ | |||
| 392 | (autoload 'reftex-toggle-auto-toc-recenter "reftex-toc" | 123 | (autoload 'reftex-toggle-auto-toc-recenter "reftex-toc" |
| 393 | "Toggle automatic recentering of TOC window." t) | 124 | "Toggle automatic recentering of TOC window." t) |
| 394 | 125 | ||
| 395 | ;;; ========================================================================= | 126 | ;; BibTeX citations. |
| 396 | ;;; | ||
| 397 | ;;; BibTeX citations. | ||
| 398 | |||
| 399 | (autoload 'reftex-citep "reftex-cite") | 127 | (autoload 'reftex-citep "reftex-cite") |
| 400 | (autoload 'reftex-citet "reftex-cite") | 128 | (autoload 'reftex-citet "reftex-cite") |
| 401 | (autoload 'reftex-make-cite-echo-string "reftex-cite") | 129 | (autoload 'reftex-make-cite-echo-string "reftex-cite") |
| @@ -409,10 +137,7 @@ | |||
| 409 | (autoload 'reftex-bib-or-thebib "reftex-cite") | 137 | (autoload 'reftex-bib-or-thebib "reftex-cite") |
| 410 | (autoload 'reftex-create-bibtex-file "reftex-cite") | 138 | (autoload 'reftex-create-bibtex-file "reftex-cite") |
| 411 | 139 | ||
| 412 | ;;; ========================================================================= | 140 | ;; Selection |
| 413 | ;;; | ||
| 414 | ;;; Selection | ||
| 415 | |||
| 416 | (autoload 'reftex-select-label-mode "reftex-sel") | 141 | (autoload 'reftex-select-label-mode "reftex-sel") |
| 417 | (autoload 'reftex-select-bib-mode "reftex-sel") | 142 | (autoload 'reftex-select-bib-mode "reftex-sel") |
| 418 | (autoload 'reftex-find-start-point "reftex-sel") | 143 | (autoload 'reftex-find-start-point "reftex-sel") |
| @@ -420,11 +145,7 @@ | |||
| 420 | (autoload 'reftex-get-offset "reftex-sel") | 145 | (autoload 'reftex-get-offset "reftex-sel") |
| 421 | (autoload 'reftex-select-item "reftex-sel") | 146 | (autoload 'reftex-select-item "reftex-sel") |
| 422 | 147 | ||
| 423 | 148 | ;; Index support | |
| 424 | ;;; ========================================================================= | ||
| 425 | ;;; | ||
| 426 | ;;; Index support | ||
| 427 | |||
| 428 | (autoload 'reftex-index "reftex-index" | 149 | (autoload 'reftex-index "reftex-index" |
| 429 | "Query for an index macro and insert it along with its arguments." t) | 150 | "Query for an index macro and insert it along with its arguments." t) |
| 430 | (autoload 'reftex-index-selection-or-word "reftex-index" | 151 | (autoload 'reftex-index-selection-or-word "reftex-index" |
| @@ -442,11 +163,7 @@ | |||
| 442 | (autoload 'reftex-index-show-entry "reftex-index") | 163 | (autoload 'reftex-index-show-entry "reftex-index") |
| 443 | (autoload 'reftex-index-select-tag "reftex-index") | 164 | (autoload 'reftex-index-select-tag "reftex-index") |
| 444 | 165 | ||
| 445 | 166 | ;; View cross references | |
| 446 | ;;; ========================================================================= | ||
| 447 | ;;; | ||
| 448 | ;;; View cross references | ||
| 449 | |||
| 450 | (autoload 'reftex-view-crossref "reftex-dcr" | 167 | (autoload 'reftex-view-crossref "reftex-dcr" |
| 451 | "View cross reference of \\ref or \\cite macro at point." t) | 168 | "View cross reference of \\ref or \\cite macro at point." t) |
| 452 | (autoload 'reftex-mouse-view-crossref "reftex-dcr" | 169 | (autoload 'reftex-mouse-view-crossref "reftex-dcr" |
| @@ -455,11 +172,7 @@ | |||
| 455 | (autoload 'reftex-view-crossref-from-bibtex "reftex-dcr" | 172 | (autoload 'reftex-view-crossref-from-bibtex "reftex-dcr" |
| 456 | "View location in a LaTeX document which cites the BibTeX entry at point." t) | 173 | "View location in a LaTeX document which cites the BibTeX entry at point." t) |
| 457 | 174 | ||
| 458 | 175 | ;; Operations on entire Multifile documents | |
| 459 | ;;; ========================================================================= | ||
| 460 | ;;; | ||
| 461 | ;;; Operations on entire Multifile documents | ||
| 462 | |||
| 463 | (autoload 'reftex-create-tags-file "reftex-global" | 176 | (autoload 'reftex-create-tags-file "reftex-global" |
| 464 | "Create TAGS file by running `etags' on the current document." t) | 177 | "Create TAGS file by running `etags' on the current document." t) |
| 465 | (autoload 'reftex-grep-document "reftex-global" | 178 | (autoload 'reftex-grep-document "reftex-global" |
| @@ -477,11 +190,7 @@ | |||
| 477 | (autoload 'reftex-save-all-document-buffers "reftex-global" | 190 | (autoload 'reftex-save-all-document-buffers "reftex-global" |
| 478 | "Save all documents associated with the current document." t) | 191 | "Save all documents associated with the current document." t) |
| 479 | 192 | ||
| 480 | 193 | ;; AUCTeX Interface | |
| 481 | ;;; ========================================================================= | ||
| 482 | ;;; | ||
| 483 | ;;; AUCTeX Interface | ||
| 484 | |||
| 485 | (autoload 'reftex-arg-label "reftex-auc") | 194 | (autoload 'reftex-arg-label "reftex-auc") |
| 486 | (autoload 'reftex-arg-cite "reftex-auc") | 195 | (autoload 'reftex-arg-cite "reftex-auc") |
| 487 | (autoload 'reftex-arg-index-tag "reftex-auc") | 196 | (autoload 'reftex-arg-index-tag "reftex-auc") |
| @@ -494,6 +203,41 @@ | |||
| 494 | (autoload 'reftex-add-section-levels "reftex-auc") | 203 | (autoload 'reftex-add-section-levels "reftex-auc") |
| 495 | (autoload 'reftex-notice-new-section "reftex-auc") | 204 | (autoload 'reftex-notice-new-section "reftex-auc") |
| 496 | 205 | ||
| 206 | |||
| 207 | ;;; ========================================================================= | ||
| 208 | ;;; | ||
| 209 | ;;; Define the formal stuff for a minor mode named RefTeX. | ||
| 210 | ;;; | ||
| 211 | |||
| 212 | (defconst reftex-version emacs-version | ||
| 213 | "Version string for RefTeX.") | ||
| 214 | |||
| 215 | (defvar reftex-mode-map (make-sparse-keymap) | ||
| 216 | "Keymap for RefTeX mode.") | ||
| 217 | |||
| 218 | (defvar reftex-mode-menu nil) | ||
| 219 | (defvar reftex-syntax-table nil) | ||
| 220 | (defvar reftex-syntax-table-for-bib nil) | ||
| 221 | |||
| 222 | (unless reftex-syntax-table | ||
| 223 | (setq reftex-syntax-table (copy-syntax-table)) | ||
| 224 | (modify-syntax-entry ?\( "." reftex-syntax-table) | ||
| 225 | (modify-syntax-entry ?\) "." reftex-syntax-table)) | ||
| 226 | |||
| 227 | (unless reftex-syntax-table-for-bib | ||
| 228 | (setq reftex-syntax-table-for-bib (copy-syntax-table)) | ||
| 229 | (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib) | ||
| 230 | (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib) | ||
| 231 | (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib) | ||
| 232 | (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib)) | ||
| 233 | |||
| 234 | ;; The following definitions are out of place, but I need them here | ||
| 235 | ;; to make the compilation of reftex-mode not complain. | ||
| 236 | (defvar reftex-auto-view-crossref-timer nil | ||
| 237 | "The timer used for auto-view-crossref.") | ||
| 238 | (defvar reftex-toc-auto-recenter-timer nil | ||
| 239 | "The idle timer used to recenter the toc window.") | ||
| 240 | |||
| 497 | ;;;###autoload | 241 | ;;;###autoload |
| 498 | (defun turn-on-reftex () | 242 | (defun turn-on-reftex () |
| 499 | "Turn on RefTeX mode." | 243 | "Turn on RefTeX mode." |
| @@ -503,13 +247,7 @@ | |||
| 503 | (put 'reftex-mode :menu-tag "RefTeX Mode") | 247 | (put 'reftex-mode :menu-tag "RefTeX Mode") |
| 504 | ;;;###autoload | 248 | ;;;###autoload |
| 505 | (define-minor-mode reftex-mode | 249 | (define-minor-mode reftex-mode |
| 506 | "Toggle RefTeX mode. | 250 | "Minor mode with distinct support for \\label, \\ref and \\cite in LaTeX. |
| 507 | With a prefix argument ARG, enable RefTeX mode if ARG is | ||
| 508 | positive, and disable it otherwise. If called from Lisp, enable | ||
| 509 | the mode if ARG is omitted or nil. | ||
| 510 | |||
| 511 | RefTeX mode is a buffer-local minor mode with distinct support | ||
| 512 | for \\label, \\ref and \\cite in LaTeX. | ||
| 513 | 251 | ||
| 514 | \\<reftex-mode-map>A Table of Contents of the entire (multifile) document with browsing | 252 | \\<reftex-mode-map>A Table of Contents of the entire (multifile) document with browsing |
| 515 | capabilities is available with `\\[reftex-toc]'. | 253 | capabilities is available with `\\[reftex-toc]'. |
| @@ -559,8 +297,7 @@ on the menu bar. | |||
| 559 | (modify-syntax-entry ?\( "." reftex-syntax-table) | 297 | (modify-syntax-entry ?\( "." reftex-syntax-table) |
| 560 | (modify-syntax-entry ?\) "." reftex-syntax-table) | 298 | (modify-syntax-entry ?\) "." reftex-syntax-table) |
| 561 | 299 | ||
| 562 | (setq reftex-syntax-table-for-bib | 300 | (setq reftex-syntax-table-for-bib (copy-syntax-table)) |
| 563 | (copy-syntax-table reftex-syntax-table)) | ||
| 564 | (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib) | 301 | (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib) |
| 565 | (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib) | 302 | (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib) |
| 566 | (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib) | 303 | (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib) |
| @@ -635,16 +372,15 @@ on the menu bar. | |||
| 635 | (incf reftex-multifile-index)) | 372 | (incf reftex-multifile-index)) |
| 636 | 373 | ||
| 637 | (defun reftex-tie-multifile-symbols () | 374 | (defun reftex-tie-multifile-symbols () |
| 638 | ;; Tie the buffer-local symbols to globals connected with the master file. | 375 | "Tie the buffer-local symbols to globals connected with the master file. |
| 639 | ;; If the symbols for the current master file do not exist, they are created. | 376 | If the symbols for the current master file do not exist, they are created." |
| 640 | |||
| 641 | (let* ((master (file-truename (reftex-TeX-master-file))) | 377 | (let* ((master (file-truename (reftex-TeX-master-file))) |
| 642 | (index (assoc master reftex-master-index-list)) | 378 | (index (assoc master reftex-master-index-list)) |
| 643 | (symlist reftex-multifile-symbols) | 379 | (symlist reftex-multifile-symbols) |
| 644 | symbol symname newflag) | 380 | symbol symname newflag) |
| 645 | ;; Find the correct index. | 381 | ;; Find the correct index. |
| 646 | (if index | 382 | (if index |
| 647 | ;; symbols do exist | 383 | ;; Symbols do exist |
| 648 | (setq index (cdr index)) | 384 | (setq index (cdr index)) |
| 649 | ;; Get a new index and add info to the alist. | 385 | ;; Get a new index and add info to the alist. |
| 650 | (setq index (reftex-next-multifile-index) | 386 | (setq index (reftex-next-multifile-index) |
| @@ -661,13 +397,15 @@ on the menu bar. | |||
| 661 | ;; Initialize if new symbols. | 397 | ;; Initialize if new symbols. |
| 662 | (when newflag | 398 | (when newflag |
| 663 | (set (symbol-value symbol) nil) | 399 | (set (symbol-value symbol) nil) |
| 664 | (put (symbol-value symbol) 'reftex-index-macros-style '(default)))) | 400 | (put (symbol-value symbol) 'reftex-index-macros-style '(default)) |
| 401 | (put (symbol-value symbol) 'reftex-ref-style-list | ||
| 402 | reftex-ref-style-default-list))) | ||
| 665 | 403 | ||
| 666 | ;; Return t if the symbols did already exist, nil when we've made them. | 404 | ;; Return t if the symbols did already exist, nil when we've made them. |
| 667 | (not newflag))) | 405 | (not newflag))) |
| 668 | 406 | ||
| 669 | (defun reftex-untie-multifile-symbols () | 407 | (defun reftex-untie-multifile-symbols () |
| 670 | ;; Remove ties from multifile symbols, so that next use makes new ones. | 408 | "Remove ties from multifile symbols, so that next use makes new ones." |
| 671 | (let ((symlist reftex-multifile-symbols) | 409 | (let ((symlist reftex-multifile-symbols) |
| 672 | (symbol nil)) | 410 | (symbol nil)) |
| 673 | (while symlist | 411 | (while symlist |
| @@ -761,7 +499,7 @@ for details. | |||
| 761 | This function makes it possible to support RefTeX from AUCTeX style files. | 499 | This function makes it possible to support RefTeX from AUCTeX style files. |
| 762 | The entries in ENTRY-LIST will be processed after the user settings in | 500 | The entries in ENTRY-LIST will be processed after the user settings in |
| 763 | `reftex-index-entries', and before the defaults. Any changes made to | 501 | `reftex-index-entries', and before the defaults. Any changes made to |
| 764 | `reftex-label-alist-style' will raise a flag to the effect that | 502 | `reftex-index-macros-style' will raise a flag to the effect that |
| 765 | the label information is recompiled on next use." | 503 | the label information is recompiled on next use." |
| 766 | (unless reftex-docstruct-symbol | 504 | (unless reftex-docstruct-symbol |
| 767 | (reftex-tie-multifile-symbols)) | 505 | (reftex-tie-multifile-symbols)) |
| @@ -783,6 +521,52 @@ the label information is recompiled on next use." | |||
| 783 | (when changed | 521 | (when changed |
| 784 | (put reftex-docstruct-symbol 'reftex-index-macros-style list))))) | 522 | (put reftex-docstruct-symbol 'reftex-index-macros-style list))))) |
| 785 | 523 | ||
| 524 | (defun reftex-ref-style-activate (style) | ||
| 525 | "Activate the referencing style STYLE." | ||
| 526 | (reftex-ref-style-toggle style 'activate)) | ||
| 527 | |||
| 528 | (defun reftex-ref-style-toggle (style &optional action) | ||
| 529 | "Activate or deactivate the referencing style STYLE. | ||
| 530 | With the optional argument ACTION a certain action can be forced. | ||
| 531 | The symbol `activate' will activate the style and `deactivate' | ||
| 532 | will deactivate it." | ||
| 533 | (unless reftex-docstruct-symbol | ||
| 534 | (reftex-tie-multifile-symbols)) | ||
| 535 | (when (and reftex-docstruct-symbol | ||
| 536 | (symbolp reftex-docstruct-symbol)) | ||
| 537 | (let ((list (get reftex-docstruct-symbol 'reftex-ref-style-list)) | ||
| 538 | changed) | ||
| 539 | (cond ((eq action 'activate) | ||
| 540 | (unless (member style list) | ||
| 541 | (setq reftex-tables-dirty t | ||
| 542 | changed t) | ||
| 543 | (add-to-list 'list style t))) | ||
| 544 | ((eq action 'deactivate) | ||
| 545 | (when (member style list) | ||
| 546 | (setq reftex-tables-dirty t | ||
| 547 | changed t) | ||
| 548 | (delete style list))) | ||
| 549 | (t | ||
| 550 | (if (member style list) | ||
| 551 | (delete style list) | ||
| 552 | (add-to-list 'list style t)) | ||
| 553 | (setq reftex-tables-dirty t | ||
| 554 | changed t))) | ||
| 555 | (when changed | ||
| 556 | (put reftex-docstruct-symbol 'reftex-ref-style-list list))))) | ||
| 557 | |||
| 558 | (defun reftex-ref-style-list () | ||
| 559 | "Return the list of referencing styles to be active at the moment." | ||
| 560 | ;; Initialize the value of `reftex-ref-style-list' and tie it to the | ||
| 561 | ;; docstruct symbol if necessary. | ||
| 562 | (unless reftex-docstruct-symbol | ||
| 563 | (reftex-tie-multifile-symbols)) | ||
| 564 | (if (and reftex-docstruct-symbol | ||
| 565 | (symbolp reftex-docstruct-symbol) | ||
| 566 | (get reftex-docstruct-symbol 'reftex-ref-style-list)) | ||
| 567 | (get reftex-docstruct-symbol 'reftex-ref-style-list) | ||
| 568 | reftex-ref-style-default-list)) | ||
| 569 | |||
| 786 | ;;; ========================================================================= | 570 | ;;; ========================================================================= |
| 787 | ;;; | 571 | ;;; |
| 788 | ;;; Functions to compile the tables, reset the mode etc. | 572 | ;;; Functions to compile the tables, reset the mode etc. |
| @@ -1282,8 +1066,8 @@ This enforces rescanning the buffer on next use." | |||
| 1282 | ;; Calculate the regular expressions | 1066 | ;; Calculate the regular expressions |
| 1283 | (let* ( | 1067 | (let* ( |
| 1284 | ; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*") | 1068 | ; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*") |
| 1285 | (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because | 1069 | (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because |
| 1286 | ;;; because match number are hard coded | 1070 | ; match numbers are hard coded |
| 1287 | (label-re (concat "\\(?:" | 1071 | (label-re (concat "\\(?:" |
| 1288 | ;; Normal \label{...} | 1072 | ;; Normal \label{...} |
| 1289 | "\\\\label{\\([^}]*\\)}" | 1073 | "\\\\label{\\([^}]*\\)}" |
| @@ -1299,10 +1083,16 @@ This enforces rescanning the buffer on next use." | |||
| 1299 | reftex-include-file-commands "\\|") | 1083 | reftex-include-file-commands "\\|") |
| 1300 | "\\)[{ \t]+\\([^} \t\n\r]+\\)")) | 1084 | "\\)[{ \t]+\\([^} \t\n\r]+\\)")) |
| 1301 | (section-re | 1085 | (section-re |
| 1086 | ;; Including `\' as a character to be matched at the end | ||
| 1087 | ;; of the regexp will allow stuff like | ||
| 1088 | ;; \begin{foo}\label{bar} to be matched. This will make | ||
| 1089 | ;; the parser to advance one char too much. Therefore | ||
| 1090 | ;; `reftex-parse-from-file' will step one char back if a | ||
| 1091 | ;; section is found. | ||
| 1302 | (concat wbol "\\\\\\(" | 1092 | (concat wbol "\\\\\\(" |
| 1303 | (mapconcat (lambda (x) (regexp-quote (car x))) | 1093 | (mapconcat (lambda (x) (regexp-quote (car x))) |
| 1304 | reftex-section-levels-all "\\|") | 1094 | reftex-section-levels-all "\\|") |
| 1305 | "\\)\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n]")) | 1095 | "\\)\\*?\\(\\[[^]]*\\]\\)?[[{ \t\r\n\\]")) |
| 1306 | (appendix-re (concat wbol "\\(\\\\appendix\\)")) | 1096 | (appendix-re (concat wbol "\\(\\\\appendix\\)")) |
| 1307 | (macro-re | 1097 | (macro-re |
| 1308 | (if macros-with-labels | 1098 | (if macros-with-labels |
| @@ -1780,9 +1570,18 @@ When DIE is non-nil, throw an error if file not found." | |||
| 1780 | "In unfinished selection process. Finish, or abort with \\[abort-recursive-edit]")))) | 1570 | "In unfinished selection process. Finish, or abort with \\[abort-recursive-edit]")))) |
| 1781 | 1571 | ||
| 1782 | (defun reftex-in-comment () | 1572 | (defun reftex-in-comment () |
| 1573 | "Return non-nil if point is in a comment." | ||
| 1783 | (save-excursion | 1574 | (save-excursion |
| 1784 | (skip-chars-backward "^%\n\r") | 1575 | (save-match-data |
| 1785 | (eq (preceding-char) ?%))) | 1576 | (let ((pos (point))) |
| 1577 | (beginning-of-line) | ||
| 1578 | (re-search-forward | ||
| 1579 | (or comment-start-skip | ||
| 1580 | ;; The parser may open files in fundamental mode if | ||
| 1581 | ;; `reftex-initialize-temporary-buffers' is nil, so here | ||
| 1582 | ;; is a default suitable for plain TeX and LaTeX. | ||
| 1583 | "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(%+[ \t]*\\)") | ||
| 1584 | pos t))))) | ||
| 1786 | 1585 | ||
| 1787 | (defun reftex-no-props (string) | 1586 | (defun reftex-no-props (string) |
| 1788 | ;; Return STRING with all text properties removed | 1587 | ;; Return STRING with all text properties removed |
| @@ -1996,6 +1795,7 @@ When DIE is non-nil, throw an error if file not found." | |||
| 1996 | (condition-case nil (scroll-down) (error nil)) | 1795 | (condition-case nil (scroll-down) (error nil)) |
| 1997 | (message "%s" prompt)) | 1796 | (message "%s" prompt)) |
| 1998 | (t (message "") | 1797 | (t (message "") |
| 1798 | (reftex-kill-buffer "*RefTeX Select*") | ||
| 1999 | (throw 'exit char))) | 1799 | (throw 'exit char))) |
| 2000 | (setq char (read-char-exclusive))))))) | 1800 | (setq char (read-char-exclusive))))))) |
| 2001 | 1801 | ||
| @@ -2123,25 +1923,95 @@ When DIE is non-nil, throw an error if file not found." | |||
| 2123 | (setq list (cdr list))) | 1923 | (setq list (cdr list))) |
| 2124 | (nreverse rtn))) | 1924 | (nreverse rtn))) |
| 2125 | 1925 | ||
| 2126 | (defun reftex-uniquify (list) | 1926 | (defun reftex-uniquify (list &optional sort) |
| 2127 | ;; Return a list of all elements in LIST, but each only once, keeping order | 1927 | ;; Return a list of all strings in LIST, but each only once, keeping order |
| 2128 | (let (new elm) | 1928 | ;; unless SORT is set (faster!). |
| 2129 | (while list | 1929 | (setq list (copy-sequence list)) |
| 2130 | (setq elm (pop list)) | 1930 | (if sort |
| 2131 | (unless (member elm new) | 1931 | (progn |
| 2132 | (push elm new))) | 1932 | (setq list (sort list 'string<)) |
| 2133 | (nreverse new))) | 1933 | (let ((p list)) |
| 2134 | 1934 | (while (cdr p) | |
| 2135 | (defun reftex-uniquify-by-car (alist &optional keep-list) | 1935 | (if (string= (car p) (car (cdr p))) |
| 1936 | (setcdr p (cdr (cdr p))) | ||
| 1937 | (setq p (cdr p))))) | ||
| 1938 | list) | ||
| 1939 | (let ((p list) lst elt) | ||
| 1940 | ;; push all sublists into lst in reverse(!) order | ||
| 1941 | (while p | ||
| 1942 | (push p lst) | ||
| 1943 | (setq p (cdr p))) | ||
| 1944 | ;; sort all sublists | ||
| 1945 | (setq lst (sort lst (lambda (x1 x2) (string< (car x1) (car x2))))) | ||
| 1946 | (while (cdr lst) | ||
| 1947 | (setq elt (car (car lst))) | ||
| 1948 | ;; for equal elements in the sorted sublist, replace the | ||
| 1949 | ;; last(!) original list member with nil | ||
| 1950 | (when (string= elt (car (cadr lst))) | ||
| 1951 | (setcar (pop lst) nil) | ||
| 1952 | (while (and (cdr lst) (string= elt (car (cadr lst)))) | ||
| 1953 | (setcar (pop lst) nil))) | ||
| 1954 | (pop lst))) | ||
| 1955 | ;; weed out all nils and return. | ||
| 1956 | (delq nil list))) | ||
| 1957 | |||
| 1958 | (defun reftex-uniquify-by-car (alist &optional keep-list sort) | ||
| 2136 | ;; Return a list of all elements in ALIST, but each car only once. | 1959 | ;; Return a list of all elements in ALIST, but each car only once. |
| 2137 | ;; Elements of KEEP-LIST are not removed even if duplicate. | 1960 | ;; Elements of KEEP-LIST are not removed even if duplicate. |
| 2138 | (let (new elm) | 1961 | ;; The order is kept unless SORT is set (faster!). |
| 2139 | (while alist | 1962 | (setq keep-list (sort (copy-sequence keep-list) #'string<) |
| 2140 | (setq elm (pop alist)) | 1963 | alist (copy-sequence alist)) |
| 2141 | (if (or (member (car elm) keep-list) | 1964 | (if sort |
| 2142 | (not (assoc (car elm) new))) | 1965 | (let (lst elt) |
| 2143 | (push elm new))) | 1966 | (setq alist (sort alist (lambda(a b) (string< (car a) (car b))))) |
| 2144 | (nreverse new))) | 1967 | (setq lst alist) |
| 1968 | (while (cdr lst) | ||
| 1969 | (setq elt (car (car lst))) | ||
| 1970 | (when (string= elt (car (cadr lst))) | ||
| 1971 | (while (and keep-list (string< (car keep-list) elt)) | ||
| 1972 | (pop keep-list)) | ||
| 1973 | (if (and keep-list (string= elt (car keep-list))) | ||
| 1974 | (progn | ||
| 1975 | (pop lst) | ||
| 1976 | (while (and (cdr lst) | ||
| 1977 | (string= elt (car (cadr lst)))) | ||
| 1978 | (pop lst))) | ||
| 1979 | (setcdr lst (cdr (cdr lst))) | ||
| 1980 | (while (and (cdr lst) | ||
| 1981 | (string= elt (car (cadr lst)))) | ||
| 1982 | (setcdr lst (cdr (cdr lst)))))) | ||
| 1983 | (pop lst)) | ||
| 1984 | alist) | ||
| 1985 | (let ((p alist) lst elt) | ||
| 1986 | (while p | ||
| 1987 | (push p lst) | ||
| 1988 | (setq p (cdr p))) | ||
| 1989 | (setq lst (sort lst (lambda(a b) (string< (car (car a)) | ||
| 1990 | (car (car b)))))) | ||
| 1991 | (while (cdr lst) | ||
| 1992 | (setq elt (car (car (car lst)))) | ||
| 1993 | (when (string= elt (car (car (cadr lst)))) | ||
| 1994 | (while (and keep-list (string< (car keep-list) elt)) | ||
| 1995 | (pop keep-list)) | ||
| 1996 | (if (and keep-list (string= elt (car keep-list))) | ||
| 1997 | (progn | ||
| 1998 | (pop lst) | ||
| 1999 | (while (and (cdr lst) | ||
| 2000 | (string= elt (car (car (cadr lst))))) | ||
| 2001 | (pop lst))) | ||
| 2002 | (setcar (pop lst) nil) | ||
| 2003 | (while (and (cdr lst) | ||
| 2004 | (string= elt (car (car (cadr lst))))) | ||
| 2005 | (setcar (pop lst) nil)))) | ||
| 2006 | (pop lst))) | ||
| 2007 | (delq nil alist))) | ||
| 2008 | |||
| 2009 | (defun reftex-remove-if (predicate list) | ||
| 2010 | "Nondestructively remove all items from LIST which satisfy PREDICATE." | ||
| 2011 | (let (result) | ||
| 2012 | (dolist (elt list (nreverse result)) | ||
| 2013 | (unless (funcall predicate elt) | ||
| 2014 | (push elt result))))) | ||
| 2145 | 2015 | ||
| 2146 | (defun reftex-abbreviate-title (string) | 2016 | (defun reftex-abbreviate-title (string) |
| 2147 | (reftex-convert-string string "[-~ \t\n\r,;]" nil t t | 2017 | (reftex-convert-string string "[-~ \t\n\r,;]" nil t t |
| @@ -2243,6 +2113,7 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2243 | ((= (length text) 0) (make-string 1 ?\ )) | 2113 | ((= (length text) 0) (make-string 1 ?\ )) |
| 2244 | (t text))) | 2114 | (t text))) |
| 2245 | 2115 | ||
| 2116 | |||
| 2246 | ;;; ========================================================================= | 2117 | ;;; ========================================================================= |
| 2247 | ;;; | 2118 | ;;; |
| 2248 | ;;; Fontification and Highlighting | 2119 | ;;; Fontification and Highlighting |
| @@ -2390,28 +2261,20 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2390 | "bibtex" | 2261 | "bibtex" |
| 2391 | '(define-key bibtex-mode-map "\C-c&" 'reftex-view-crossref-from-bibtex)) | 2262 | '(define-key bibtex-mode-map "\C-c&" 'reftex-view-crossref-from-bibtex)) |
| 2392 | 2263 | ||
| 2393 | ;; If the user requests so, she can have a few more bindings: | ||
| 2394 | ;; For most of these commands there are already bindings in place. | 2264 | ;; For most of these commands there are already bindings in place. |
| 2395 | ;; Setting `reftex-extra-bindings' really is only there to spare users | 2265 | ;; Setting `reftex-extra-bindings' really is only there to spare users |
| 2396 | ;; the hassle of defining bindings in the user space themselves. This | 2266 | ;; the hassle of defining bindings in the user space themselves. This |
| 2397 | ;; is why they violate the key binding recommendations. | 2267 | ;; is why they violate the key binding recommendations. |
| 2398 | (defvar reftex-extra-bindings-map | ||
| 2399 | (let ((map (make-sparse-keymap))) | ||
| 2400 | (define-key map "t" 'reftex-toc) | ||
| 2401 | (define-key map "l" 'reftex-label) | ||
| 2402 | (define-key map "r" 'reftex-reference) | ||
| 2403 | (define-key map "c" 'reftex-citation) | ||
| 2404 | (define-key map "v" 'reftex-view-crossref) | ||
| 2405 | (define-key map "g" 'reftex-grep-document) | ||
| 2406 | (define-key map "s" 'reftex-search-document) | ||
| 2407 | map) | ||
| 2408 | "Reftex extra bindings map") | ||
| 2409 | |||
| 2410 | (when reftex-extra-bindings | 2268 | (when reftex-extra-bindings |
| 2411 | (define-key reftex-mode-map | 2269 | (loop for x in |
| 2412 | reftex-extra-bindings-prefix | 2270 | '(("\C-ct" . reftex-toc) |
| 2413 | reftex-extra-bindings-map)) | 2271 | ("\C-cl" . reftex-label) |
| 2414 | 2272 | ("\C-cr" . reftex-reference) | |
| 2273 | ("\C-cc" . reftex-citation) | ||
| 2274 | ("\C-cv" . reftex-view-crossref) | ||
| 2275 | ("\C-cg" . reftex-grep-document) | ||
| 2276 | ("\C-cs" . reftex-search-document)) | ||
| 2277 | do (define-key reftex-mode-map (car x) (cdr x)))) | ||
| 2415 | 2278 | ||
| 2416 | ;;; ========================================================================= | 2279 | ;;; ========================================================================= |
| 2417 | ;;; | 2280 | ;;; |
| @@ -2488,21 +2351,22 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2488 | :style radio :selected (eq reftex-auto-view-crossref 'window)] | 2351 | :style radio :selected (eq reftex-auto-view-crossref 'window)] |
| 2489 | "--" | 2352 | "--" |
| 2490 | "MISC" | 2353 | "MISC" |
| 2491 | ["AUC TeX Interface" reftex-toggle-plug-into-AUCTeX | 2354 | ["AUCTeX Interface" reftex-toggle-plug-into-AUCTeX |
| 2492 | :style toggle :selected reftex-plug-into-AUCTeX] | 2355 | :style toggle :selected reftex-plug-into-AUCTeX] |
| 2493 | ["isearch whole document" reftex-isearch-minor-mode | 2356 | ["isearch whole document" reftex-isearch-minor-mode |
| 2494 | :style toggle :selected reftex-isearch-minor-mode]) | 2357 | :style toggle :selected reftex-isearch-minor-mode]) |
| 2495 | ("Reference Style" | 2358 | ("Reference Style" |
| 2496 | ["Default" (setq reftex-vref-is-default nil | 2359 | ,@(let (list item) |
| 2497 | reftex-fref-is-default nil) | 2360 | (dolist (elt reftex-ref-style-alist) |
| 2498 | :style radio :selected (not (or reftex-vref-is-default | 2361 | (setq elt (car elt) |
| 2499 | reftex-fref-is-default))] | 2362 | item (vector |
| 2500 | ["Varioref" (setq reftex-vref-is-default t | 2363 | elt |
| 2501 | reftex-fref-is-default nil) | 2364 | `(reftex-ref-style-toggle ,elt) |
| 2502 | :style radio :selected reftex-vref-is-default] | 2365 | :style 'toggle |
| 2503 | ["Fancyref" (setq reftex-fref-is-default t | 2366 | :selected `(member ,elt (reftex-ref-style-list)))) |
| 2504 | reftex-vref-is-default nil) | 2367 | (unless (member item list) |
| 2505 | :style radio :selected reftex-fref-is-default]) | 2368 | (add-to-list 'list item t))) |
| 2369 | list)) | ||
| 2506 | ("Citation Style" | 2370 | ("Citation Style" |
| 2507 | ,@(mapcar | 2371 | ,@(mapcar |
| 2508 | (lambda (x) | 2372 | (lambda (x) |
| @@ -2568,6 +2432,9 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2568 | (message "\"Ref\"-menu now contains full customization menu")) | 2432 | (message "\"Ref\"-menu now contains full customization menu")) |
| 2569 | (error "Cannot expand menu (outdated version of cus-edit.el)"))) | 2433 | (error "Cannot expand menu (outdated version of cus-edit.el)"))) |
| 2570 | 2434 | ||
| 2435 | |||
| 2436 | ;;; Misc | ||
| 2437 | |||
| 2571 | (defun reftex-show-commentary () | 2438 | (defun reftex-show-commentary () |
| 2572 | "Use the finder to view the file documentation from `reftex.el'." | 2439 | "Use the finder to view the file documentation from `reftex.el'." |
| 2573 | (interactive) | 2440 | (interactive) |
| @@ -2579,6 +2446,36 @@ With optional NODE, go directly to that node." | |||
| 2579 | (interactive) | 2446 | (interactive) |
| 2580 | (info (format "(reftex)%s" (or node "")))) | 2447 | (info (format "(reftex)%s" (or node "")))) |
| 2581 | 2448 | ||
| 2449 | (defun reftex-report-bug () | ||
| 2450 | "Report a bug in RefTeX. | ||
| 2451 | |||
| 2452 | Don't hesitate to report any problems or inaccurate documentation. | ||
| 2453 | |||
| 2454 | If you don't have setup sending mail from (X)Emacs, please copy the | ||
| 2455 | output buffer into your mail program, as it gives us important | ||
| 2456 | information about your RefTeX version and configuration." | ||
| 2457 | (interactive) | ||
| 2458 | (require 'reporter) | ||
| 2459 | (let ((reporter-prompt-for-summary-p "Bug report subject: ")) | ||
| 2460 | (reporter-submit-bug-report | ||
| 2461 | "bug-auctex@gnu.org" | ||
| 2462 | reftex-version | ||
| 2463 | (list 'window-system | ||
| 2464 | 'reftex-plug-into-AUCTeX) | ||
| 2465 | nil nil | ||
| 2466 | "Remember to cover the basics, that is, what you expected to happen and | ||
| 2467 | what in fact did happen. | ||
| 2468 | |||
| 2469 | Check if the bug is reproducable with an up-to-date version of | ||
| 2470 | RefTeX available from http://www.gnu.org/software/auctex/. | ||
| 2471 | |||
| 2472 | If the bug is triggered by a specific \(La\)TeX file, you should try | ||
| 2473 | to produce a minimal sample file showing the problem and include it | ||
| 2474 | in your report. | ||
| 2475 | |||
| 2476 | Your bug report will be posted to the AUCTeX bug reporting list. | ||
| 2477 | ------------------------------------------------------------------------"))) | ||
| 2478 | |||
| 2582 | ;;; Install the kill-buffer and kill-emacs hooks ------------------------------ | 2479 | ;;; Install the kill-buffer and kill-emacs hooks ------------------------------ |
| 2583 | 2480 | ||
| 2584 | (add-hook 'kill-buffer-hook 'reftex-kill-buffer-hook) | 2481 | (add-hook 'kill-buffer-hook 'reftex-kill-buffer-hook) |
| @@ -2594,6 +2491,4 @@ With optional NODE, go directly to that node." | |||
| 2594 | (setq reftex-tables-dirty t) ; in case this file is evaluated by hand | 2491 | (setq reftex-tables-dirty t) ; in case this file is evaluated by hand |
| 2595 | (provide 'reftex) | 2492 | (provide 'reftex) |
| 2596 | 2493 | ||
| 2597 | ;;;============================================================================ | ||
| 2598 | |||
| 2599 | ;;; reftex.el ends here | 2494 | ;;; reftex.el ends here |