aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Dominik1999-12-15 17:27:40 +0000
committerCarsten Dominik1999-12-15 17:27:40 +0000
commitd4e1eea368b4a1b48448272addd2f6b73a9977ef (patch)
tree90b54737c7b74882901bd8476d4ee93ada0d9408
parent7c4d13cca61958bc3387b200450779cd50fdda11 (diff)
downloademacs-d4e1eea368b4a1b48448272addd2f6b73a9977ef.tar.gz
emacs-d4e1eea368b4a1b48448272addd2f6b73a9977ef.zip
Update to reftex 4.9
-rw-r--r--man/reftex.texi708
1 files changed, 552 insertions, 156 deletions
diff --git a/man/reftex.texi b/man/reftex.texi
index 8afb27d6b0a..097eed0d3f0 100644
--- a/man/reftex.texi
+++ b/man/reftex.texi
@@ -9,9 +9,9 @@
9@synindex ky cp 9@synindex ky cp
10@syncodeindex vr cp 10@syncodeindex vr cp
11@syncodeindex fn cp 11@syncodeindex fn cp
12@set VERSION 4.6 12@set VERSION 4.9
13@set EDITION 4.6 13@set EDITION 4.9
14@set DATE September 1999 14@set DATE December 1999
15@set AUTHOR Carsten Dominik 15@set AUTHOR Carsten Dominik
16@set AUTHOR-EMAIL dominik@@strw.leidenuniv.nl 16@set AUTHOR-EMAIL dominik@@strw.leidenuniv.nl
17@set MAINTAINER Carsten Dominik 17@set MAINTAINER Carsten Dominik
@@ -72,7 +72,7 @@ translation approved by the Free Software Foundation.
72 72
73@author by Carsten Dominik 73@author by Carsten Dominik
74@page 74@page
75Copyright @copyright{} 1997, 1998 Free Software Foundation, Inc. 75Copyright @copyright{} 1997, 1998, 1999 Free Software Foundation, Inc.
76 76
77@sp 2 77@sp 2
78This is edition @value{EDITION} of the @cite{Ref@TeX{} User Manual} for 78This is edition @value{EDITION} of the @cite{Ref@TeX{} User Manual} for
@@ -178,11 +178,18 @@ Citations
178 178
179Index Support 179Index Support
180 180
181* Creating Index Entries:: 181* Creating Index Entries:: Macros and completion of entries.
182* Displaying and Editing the Index:: 182* The Index Phrases File:: A special file for global indexing.
183* Displaying and Editing the Index:: The index editor.
183* Builtin Index Macros:: The index macros RefTeX knows about. 184* Builtin Index Macros:: The index macros RefTeX knows about.
184* Defining Index Macros:: ... and macros it doesn't. 185* Defining Index Macros:: ... and macros it doesn't.
185 186
187The Index Phrases File
188
189* Collecting Phrases:: Collecting from document or external.
190* Consistency Checks:: Check for duplicates etc.
191* Global Indexing:: The interactive indexing process.
192
186AUCTeX 193AUCTeX
187 194
188* AUCTeX-RefTeX Interface:: How both packages work together 195* AUCTeX-RefTeX Interface:: How both packages work together
@@ -356,22 +363,24 @@ are supported.@refill
356@itemize @bullet 363@itemize @bullet
357@item 364@item
358@b{Creating Index Entries}@* 365@b{Creating Index Entries}@*
359Type @kbd{C-c /} (@code{reftex-index-selection-or-word}) to index the 366To index the current selection or the word at point, type @kbd{C-c /}
360current selection or the word at the cursor with the default macro (see 367(@code{reftex-index-selection-or-word}). The default macro
361the variable @code{reftex-index-default-macro}).@* 368@code{reftex-index-default-macro} will be used. For a more complex entry
362Type @kbd{C-c <} (@code{reftex-index}) to insert a general index macro. 369type @kbd{C-c <} (@code{reftex-index}), select any of the index macros
363@b{Ref@TeX{}} will offer a list of available macros and provide 370and enter the arguments with completion.@refill
364completion for the index tag (used to identify one of multiple indices) 371
365and for the entry itself (useful with subentries). 372@item
366 373@b{The Index Phrases File (Delayed Indexing)}@*
367@refill 374Type @kbd{C-c \} (@code{reftex-index-phrase-selection-or-word}) to add
368 375the current word or selection to a special @emph{index phrase file}.
369@item 376@b{Ref@TeX{}} can later search the document for occurrences of these
370@b{Displaying the Index}@* To display the compiled index in a special 377phrases and let you interactively index the matches.@refill
371buffer, type @kbd{C-c >} (@code{reftex-display-index}). From that 378
372buffer you can check and edit all entries. The index can be restricted 379@item
373to those entries defined in a single document section or in a user 380@b{Displaying and Editing the Index}@*
374defined region.@refill 381To display the compiled index in a special buffer, type @kbd{C-c >}
382(@code{reftex-display-index}). From that buffer you can check and edit
383all entries.@refill
375@end itemize 384@end itemize
376 385
377@page 386@page
@@ -381,10 +390,10 @@ When point is on the @var{key} argument of a cross--referencing macro
381@code{\index}, and variations) or inside a BibTeX database entry, you 390@code{\index}, and variations) or inside a BibTeX database entry, you
382can press @kbd{C-c &} (@code{reftex-view-crossref}) to display 391can press @kbd{C-c &} (@code{reftex-view-crossref}) to display
383corresponding locations in the document and associated BibTeX database 392corresponding locations in the document and associated BibTeX database
384files.@refill @* When the enclosing macro is @code{\cite} or @code{\ref} 393files.@refill @*
385and no other message occupies the echo area, information about the 394When the enclosing macro is @code{\cite} or @code{\ref} and no other
386citation or label will automatically be displayed in the echo 395message occupies the echo area, information about the citation or label
387area.@refill 396will automatically be displayed in the echo area.@refill
388 397
389@item 398@item
390@b{Multifile Documents}@* 399@b{Multifile Documents}@*
@@ -440,7 +449,8 @@ an AUCTeX style file to support them with both AUCTeX and
440@item @b{Where Next?}@* Go ahead and use @b{Ref@TeX{}}. Use its menus 449@item @b{Where Next?}@* Go ahead and use @b{Ref@TeX{}}. Use its menus
441until you have picked up the key bindings. For an overview of what you 450until you have picked up the key bindings. For an overview of what you
442can do in each of the different special buffers, press @kbd{?}. Read 451can do in each of the different special buffers, press @kbd{?}. Read
443the manual if you get stuck. The first part of the manual explains in 452the manual if you get stuck, of if you are curious what else might be
453available. The first part of the manual explains in
444a tutorial way how to use and customize @b{Ref@TeX{}}. The second 454a tutorial way how to use and customize @b{Ref@TeX{}}. The second
445part is a command and variable reference.@refill 455part is a command and variable reference.@refill
446@end enumerate 456@end enumerate
@@ -541,6 +551,16 @@ buffer.
541 551
542@tablesubheading{Controlling what gets displayed} 552@tablesubheading{Controlling what gets displayed}
543 553
554@item t
555@vindex reftex-toc-max-level
556Change the maximum level of toc entries displayed in the @file{*toc*}
557buffer. Without prefix arg, all levels will be included. With prefix
558arg (e.g @kbd{3 t}), ignore all toc entries with level greater than
559@var{arg} (3 in this case). Chapters are level 1, sections are level 2.
560The mode line @samp{T<>} indicator shows the current value. The default
561depth can be configured with the variable
562@code{reftex-toc-max-level}.@refill
563
544@item F 564@item F
545@vindex reftex-toc-include-file-boundaries 565@vindex reftex-toc-include-file-boundaries
546Toggle the display of the file borders of a multifile document in the 566Toggle the display of the file borders of a multifile document in the
@@ -602,12 +622,16 @@ keymap @code{reftex-toc-map} may be used.@refill
602@cindex Sectioning commands 622@cindex Sectioning commands
603@cindex KOMA-Script, LaTeX classes 623@cindex KOMA-Script, LaTeX classes
604@cindex LaTeX classes, KOMA-Script 624@cindex LaTeX classes, KOMA-Script
625@cindex TOC entries for environments
605@vindex reftex-section-levels 626@vindex reftex-section-levels
606The section macros recognized by @b{Ref@TeX{}} are all LaTeX section 627The section macros recognized by @b{Ref@TeX{}} are all LaTeX section
607macros (from @code{\part} to @code{\subsubparagraph}) and the commands 628macros (from @code{\part} to @code{\subsubparagraph}) and the commands
608@code{\addchap} and @code{\addsec} from the KOMA-Script classes. 629@code{\addchap} and @code{\addsec} from the KOMA-Script classes.
609Additional macros can be configured with the variable 630Additional macros can be configured with the variable
610@code{reftex-section-levels}. 631@code{reftex-section-levels}. It is also possible to add certain LaTeX
632environments to the table of contents. This is probably only useful for
633theorem-like environments. @xref{Defining Label Environments}, for an
634example.
611 635
612@node Labels and References, Citations, Table of Contents, Top 636@node Labels and References, Citations, Table of Contents, Top
613@chapter Labels and References 637@chapter Labels and References
@@ -882,7 +906,9 @@ Toggle the display of the file borders of a multifile document in the
882selection buffer.@refill 906selection buffer.@refill
883 907
884@item t 908@item t
885Toggle the display of the table of contents in the selection buffer.@refill 909Toggle the display of the table of contents in the selection buffer.
910With prefix @var{arg}, change the maximum level of toc entries displayed
911to @var{arg}. Chapters are level 1, section are level 2.@refill
886 912
887@item # 913@item #
888Toggle the display of a label counter in the selection buffer.@refill 914Toggle the display of a label counter in the selection buffer.@refill
@@ -1095,8 +1121,8 @@ library. With Lisp it would look like this
1095 1121
1096@lisp 1122@lisp
1097(setq reftex-label-alist 1123(setq reftex-label-alist
1098 '(("axiom" ?a "ax:" "~\\ref@{%s@}" nil ("axiom" "ax.")) 1124 '(("axiom" ?a "ax:" "~\\ref@{%s@}" nil ("axiom" "ax.") -2)
1099 ("theorem" ?h "thr:" "~\\ref@{%s@}" t ("theorem" "theor." "th.")))) 1125 ("theorem" ?h "thr:" "~\\ref@{%s@}" t ("theorem" "th.") -3)))
1100@end lisp 1126@end lisp
1101 1127
1102The type indicator characters @code{?a} and @code{?h} are used for 1128The type indicator characters @code{?a} and @code{?h} are used for
@@ -1130,11 +1156,19 @@ For more complex ways of getting context, see the variable
1130Environments)}).@refill 1156Environments)}).@refill
1131@end itemize 1157@end itemize
1132 1158
1133The strings at the end of each entry are used to guess the correct label 1159The following list of strings is used to guess the correct label type
1134type from the word before point when creating a reference. E.g. if you 1160from the word before point when creating a reference. E.g. if you
1135write: @samp{As we have shown in Theorem} and then press @kbd{C-c )}, 1161write: @samp{As we have shown in Theorem} and then press @kbd{C-c )},
1136@b{Ref@TeX{}} will know that you are looking for a theorem label and restrict 1162@b{Ref@TeX{}} will know that you are looking for a theorem label and
1137the menu to only these labels without even asking.@refill 1163restrict the menu to only these labels without even asking.@refill
1164
1165The final item in each entry is the level at which the environment
1166should produce entries in the table of context buffer. If the number is
1167positive, the environment will produce numbered entries (like
1168@code{\section}), if it is negative the entries will be unnumbered (like
1169@code{\section*}). Use this only for environments which structure the
1170document similar to sectioning commands. For everything else, omit the
1171item.@refill
1138 1172
1139To do the same configuration with @code{customize}, you need to click on 1173To do the same configuration with @code{customize}, you need to click on
1140the @code{[INS]} button twice to create two templates and fill them in 1174the @code{[INS]} button twice to create two templates and fill them in
@@ -1152,6 +1186,7 @@ Reftex Label Alist: [Hide]
1152 [INS] [DEL] String: axiom 1186 [INS] [DEL] String: axiom
1153 [INS] [DEL] String: ax. 1187 [INS] [DEL] String: ax.
1154 [INS] 1188 [INS]
1189 [X] Make TOC entry : [Value Menu] Level: -2
1155[INS] [DEL] Package or Detailed : [Value Menu] Detailed: 1190[INS] [DEL] Package or Detailed : [Value Menu] Detailed:
1156 Environment or \macro : [Value Menu] String: theorem 1191 Environment or \macro : [Value Menu] String: theorem
1157 Type specification : [Value Menu] Char : h 1192 Type specification : [Value Menu] Char : h
@@ -1163,6 +1198,7 @@ Reftex Label Alist: [Hide]
1163 [INS] [DEL] String: theor. 1198 [INS] [DEL] String: theor.
1164 [INS] [DEL] String: th. 1199 [INS] [DEL] String: th.
1165 [INS] 1200 [INS]
1201 [X] Make TOC entry : [Value Menu] Level: -3
1166@end example 1202@end example
1167 1203
1168@vindex reftex-insert-label-flags 1204@vindex reftex-insert-label-flags
@@ -1220,6 +1256,7 @@ Reftex Label Alist: [Hide]
1220 Context method : [Value Menu] Macro arg nr: 1 1256 Context method : [Value Menu] Macro arg nr: 1
1221 Magic words: 1257 Magic words:
1222 [INS] 1258 [INS]
1259 [ ] Make TOC entry : [Value Menu] No entry
1223@end example 1260@end example
1224 1261
1225@node Figure Wrapper, Adding Magic Words, Quick Equation, Defining Label Environments 1262@node Figure Wrapper, Adding Magic Words, Quick Equation, Defining Label Environments
@@ -1279,6 +1316,7 @@ Again, here the configuration in the customization buffer:
1279 Context method : [Value Menu] Macro arg nr: 3 1316 Context method : [Value Menu] Macro arg nr: 3
1280 Magic words: 1317 Magic words:
1281 [INS] 1318 [INS]
1319 [ ] Make TOC entry : [Value Menu] No entry
1282@end example 1320@end example
1283 1321
1284@node Adding Magic Words, Using \eqref, Figure Wrapper, Defining Label Environments 1322@node Adding Magic Words, Using \eqref, Figure Wrapper, Defining Label Environments
@@ -1443,8 +1481,8 @@ the entries described above:
1443 1481
1444@lisp 1482@lisp
1445(setq reftex-label-alist 1483(setq reftex-label-alist
1446 '(("axiom" ?a "ax:" "~\\ref@{%s@}" nil ("axiom" "ax.")) 1484 '(("axiom" ?a "ax:" "~\\ref@{%s@}" nil ("axiom" "ax.") -2)
1447 ("theorem" ?h "thr:" "~\\ref@{%s@}" t ("theorem" "theor." "th.")) 1485 ("theorem" ?h "thr:" "~\\ref@{%s@}" t ("theorem" "theor." "th.") -3)
1448 ("\\quickeq@{@}" ?e nil nil 1 nil) 1486 ("\\quickeq@{@}" ?e nil nil 1 nil)
1449 AMSTeX 1487 AMSTeX
1450 ("\\myfig[]@{@}@{@}@{*@}@{@}" ?f nil nil 3) 1488 ("\\myfig[]@{@}@{@}@{*@}@{@}" ?f nil nil 3)
@@ -1801,15 +1839,12 @@ the @kbd{C-c [} binding to the mail buffer. It also provides a local
1801binding for @code{reftex-cite-format}.@refill 1839binding for @code{reftex-cite-format}.@refill
1802 1840
1803@lisp 1841@lisp
1804(add-hook 1842(add-hook 'mail-setup-hook
1805 'mail-setup-hook 1843 (lambda () (define-key mail-mode-map "\C-c["
1806 (lambda () 1844 (lambda () (interactive)
1807 (define-key mail-mode-map "\C-c[" 1845 (require 'reftex)
1808 (lambda () 1846 (let ((reftex-cite-format 'locally))
1809 (interactive) 1847 (reftex-citation))))))
1810 (require 'reftex)
1811 (let ((reftex-cite-format 'locally))
1812 (reftex-citation))))))
1813@end lisp 1848@end lisp
1814 1849
1815@node Index Support, Viewing Cross-References, Citations, Top 1850@node Index Support, Viewing Cross-References, Citations, Top
@@ -1828,44 +1863,63 @@ file. A separate tool must be used to convert this information into a
1828nicely formatted index. Tools used with LaTeX include @code{MakeIndex} 1863nicely formatted index. Tools used with LaTeX include @code{MakeIndex}
1829and @code{xindy}.@refill 1864and @code{xindy}.@refill
1830 1865
1831Indexing is a lot of work and must follow strict conventions, so that 1866Indexing is a very difficult task. It must follow strict conventions to
1832the same word looks the same in all index entries referencing it, and in 1867make the index consistent and complete. There are basically two
1833order to avoid spurious multiple entries. Therefore, the author of a 1868approaches one can follow, and both have their merits.
1834document will most likely define special macros to make this easier. To 1869
1835make @b{Ref@TeX{}} support for indexing possible, these special macros 1870@enumerate
1836must be added to @b{Ref@TeX{}}'s configuration (@pxref{Defining Index 1871@item
1837Macros}).@refill 1872Part of the indexing should already be done with the markup. The
1873document structure should be reflected in the index, so when starting
1874new sections, the basic topics of the section should be indexed. If the
1875document contains definitions, theorems or the like, these should all
1876correspond to appropriate index entries. This part of the index can
1877very well be developed along with the document. Often it is worthwhile
1878to define special purpose macros which define an item and at the same
1879time make an index entry, possibly with special formatting to make the
1880reference page in the index bold or underlined. To make @b{Ref@TeX{}}
1881support for indexing possible, these special macros must be added to
1882@b{Ref@TeX{}}'s configuration (@pxref{Defining Index Macros}).@refill
1883
1884@item
1885The rest of the index is often just a collection of where in the
1886document certain words or phrases are being used. This part is
1887difficult to develop along with the document, because consistent entries
1888for each occurrence are needed and are best selected when the document
1889is ready. @b{Ref@TeX{}} supports this with an @emph{index phrases file}
1890which collects phrases and helps indexing the phrases globally.@refill
1891@end enumerate
1892
1893Before you start, you need to make sure that @b{Ref@TeX{}} knows about
1894the index style being used in the current document. @b{Ref@TeX{}} has
1895builtin support for the default @code{\index} and @code{\glossary}
1896macros. Other LaTeX packages, like the @file{multind} or @file{index}
1897package, redefine the @code{\index} macro to have an additional
1898argument, and @b{Ref@TeX{}} needs to be configured for those. A
1899sufficiently new version of AUCTeX (9.10c or later) will do this
1900automatically. If you really don't use AUCTeX (you should!), this
1901configuration needs to be done by hand with the menu (@code{Ref->Index
1902Style}), or globally for all your documents with@refill
1903
1904@lisp
1905(setq reftex-index-macros '(multind)) @r{or}
1906(setq reftex-index-macros '(index))
1907@end lisp
1838 1908
1839@menu 1909@menu
1840* Creating Index Entries:: 1910* Creating Index Entries:: Macros and completion of entries.
1841* Displaying and Editing the Index:: 1911* The Index Phrases File:: A special file for global indexing.
1912* Displaying and Editing the Index:: The index editor.
1842* Builtin Index Macros:: The index macros RefTeX knows about. 1913* Builtin Index Macros:: The index macros RefTeX knows about.
1843* Defining Index Macros:: ... and macros it doesn't. 1914* Defining Index Macros:: ... and macros it doesn't.
1844@end menu 1915@end menu
1845 1916
1846@node Creating Index Entries, Displaying and Editing the Index, , Index Support 1917@node Creating Index Entries, The Index Phrases File, , Index Support
1847@section Creating Index Entries 1918@section Creating Index Entries
1848@cindex Creating index entries 1919@cindex Creating index entries
1849@cindex Index entries, creating 1920@cindex Index entries, creating
1850@kindex C-c < 1921@kindex C-c <
1851@findex reftex-index 1922@findex reftex-index
1852
1853First you need to make sure that @b{Ref@TeX{}} knows about the index
1854style being used in the current document. @b{Ref@TeX{}} has builtin
1855support for the default @code{\index} and @code{\glossary} macros.
1856Other LaTeX packages, like the @file{multind} or @file{index} package,
1857redefine the @code{\index} macro to have an additional argument, and
1858@b{Ref@TeX{}} needs to be configured for those. A sufficiently new
1859version of AUCTeX (9.10c or later) will do this automatically. If you
1860really don't use AUCTeX (you should!), this configuration needs to be
1861done by hand with the menu (@code{Ref->Index Style}), or globally for
1862all your documents with
1863
1864@lisp
1865(setq reftex-index-macros '((multind)) @r{or}
1866(setq reftex-index-macros '((index))
1867@end lisp
1868
1869@kindex C-c / 1923@kindex C-c /
1870@findex reftex-index-selection-or-word 1924@findex reftex-index-selection-or-word
1871 1925
@@ -1891,20 +1945,235 @@ index tag is a string identifying one of multiple indices. With the
1891@file{multind} and @file{index} packages, this tag is the first argument 1945@file{multind} and @file{index} packages, this tag is the first argument
1892to the redefined @code{\index} macro.@refill 1946to the redefined @code{\index} macro.@refill
1893 1947
1894@findex reftex-index-globally 1948@node The Index Phrases File, Displaying and Editing the Index, Creating Index Entries, Index Support
1949@section The Index Phrases File
1950@cindex Index phrase file
1951@cindex Phrase file
1952@kindex C-c |
1953@findex reftex-index-visit-phrases-buffer
1954@cindex Macro definition lines, in phrase buffer
1955
1956@b{Ref@TeX{}} maintains a file in which phrases can be collected for
1957later indexing. The file is located in the same directory as the master
1958file of the document and has the extension @file{.rip} (@b{R}eftex
1959@b{I}ndex @b{P}hrases). You can create or visit the file with @kbd{C-c
1960|} (@code{reftex-index-visit-phrases-buffer}). If the file is empty it
1961is initialized by inserting a file header which contains the definition
1962of the available index macros. This list is initialized from
1963@code{reftex-index-macros} (@pxref{Defining Index Macros}). You can
1964edit the header as needed, but if you define new LaTeX indexing macros,
1965don't forget to add them to @code{reftex-index-macros} as well. Here is
1966a phrase file header example:@refill
1967
1968@example
1969% -*- mode: reftex-index-phrases -*-
1970% Key Macro Format Repeat
1971%----------------------------------------------------------
1972>>>INDEX_MACRO_DEFINITION: i \index@{%s@} t
1973>>>INDEX_MACRO_DEFINITION: I \index*@{%s@} nil
1974>>>INDEX_MACRO_DEFINITION: g \glossary@{%s@} t
1975>>>INDEX_MACRO_DEFINITION: n \index*[name]@{%s@} nil
1976%----------------------------------------------------------
1977@end example
1978
1979The macro definition lines consist of a unique letter identifying a
1980macro, a format string and the @var{repeat} flag, all separated by
1981@key{TAB}. The format string shows how the macro is to be applied, the
1982@samp{%s} will be replaced with the index entry. The repeat flag
1983indicates if @var{word} is indexed by the macro as
1984@samp{\index@{@var{word}@}} (@var{repeat} = @code{nil}) or as
1985@samp{\index@{@var{word}@}@var{word}} (@var{repeat} = @code{t}). In the
1986above example it is assumed that the macro @code{\index*@{@var{word}@}}
1987already typesets its argument in the text, so that it is unnecessary to
1988repeat @var{word} outside the macro.@refill
1989
1990@menu
1991* Collecting Phrases:: Collecting from document or external.
1992* Consistency Checks:: Check for duplicates etc.
1993* Global Indexing:: The interactive indexing process.
1994@end menu
1995
1996@node Collecting Phrases, Consistency Checks, , The Index Phrases File
1997@subsection Collecting Phrases
1998@cindex Collecting index phrases
1999@cindex Index phrases, collection
2000@cindex Phrases, collecting
2001
2002Phrases for indexing can be collected while writing the document. The
2003command @kbd{C-c \} (@code{reftex-index-phrase-selection-or-word})
2004copies the current selection (if active) or the word near point into the
2005phrases buffer. It then selects this buffer, so that the phrase line
2006can be edited. To return to the LaTeX document, press @kbd{C-c C-c}
2007(@code{reftex-index-phrases-save-and-return}).
2008
2009You can also prepare the list of index phrases in a different way and
2010copy it into the phrases file. For example you might want to start from
2011a word list of the document and remove all words which should not be
2012indexed.
1895 2013
1896There is also a command @code{reftex-index-globally}@footnote{This 2014The phrase lines in the phrase buffer must have a specific format.
1897function is still experimentally and may change or go away.} which 2015@b{Ref@TeX{}} will use font-lock to indicate if a line has the proper
1898copies an index entry near point to other occurrences of the same word 2016format. A phrase line looks like this:
1899in the document. @b{Ref@TeX{}} assumes that the word you want to index
1900is in direct contact with the index macro, e.g.
1901@samp{\index@{@var{word}@}@var{word}} or
1902@samp{@var{word}\index@{@var{word}@}}. If there is no such word, it
1903uses the key argument of the index macro. After making you confirm the
1904precise search and replace strings, a query-replace over the entire
1905document will be launched.
1906 2017
1907@node Displaying and Editing the Index, Builtin Index Macros, Creating Index Entries, Index Support 2018@example
2019[@var{key}] <TABs> @var{phrase} [<TABs> @var{arg}[&&@var{arg}]... [ || @var{arg}]...]
2020@end example
2021
2022@code{<TABs>} stands for white space containing at least one @key{TAB}.
2023@var{key} must be at the start of the line and is the character
2024identifying one of the macros defined in the file header. It is
2025optional - when omitted, the first macro definition line in the file
2026will be used for this phrase. The @var{phrase} is the phrase to be
2027searched for when indexing. It may contain several words separated by
2028spaces. By default the search phrase is also the text entered as
2029argument of the index macro. If you want the index entry to be
2030different from the search phrase, enter another @key{TAB} and the index
2031argument @var{arg}. If you want to have each match produce several
2032index entries, separate the different index arguments with @samp{ &&
2033}@footnote{@samp{&&} with optional spaces, see
2034@code{reftex-index-phrases-logical-and-regexp}.}. If you want to be
2035able to choose at each match between several different index arguments,
2036separate them with @samp{ || }@footnote{@samp{||} with optional spaces,
2037see @code{reftex-index-phrases-logical-or-regexp}.}. Here is an
2038example:@refill
2039
2040@example
2041%--------------------------------------------------------------------
2042I Sun
2043i Planet Planets
2044i Vega Stars!Vega
2045 Jupiter Planets!Jupiter
2046i Mars Planets!Mars || Gods!Mars || Chocolate Bars!Mars
2047i Pluto Planets!Pluto && Kuiper Belt Objects!Pluto
2048@end example
2049
2050
2051So @samp{Sun} will be indexed directly as @samp{\index*@{Sun@}}, while
2052@samp{Planet} will be indexed as @samp{\index@{Planets@}Planet}.
2053@samp{Vega} will be indexed as a subitem of @samp{Stars}. The
2054@samp{Jupiter} line will also use the @samp{i} macro as it was the first
2055macro definition in the file header (see above example). At each
2056occurrence of @samp{Mars} you will be able choose between indexing it as
2057a subitem of @samp{Planets}, @samp{Gods} or @samp{Chocolate Bars}.
2058Finally, every occurrence of @samp{Pluto} will be indexed as
2059@samp{\index@{Planets!Pluto@}\index@{Kuiper Belt Objects!Pluto@}Pluto}
2060and will therefore create two different index entries.@refill
2061
2062@node Consistency Checks, Global Indexing, Collecting Phrases, The Index Phrases File
2063@subsection Consistency Checks
2064@cindex Index phrases, consistency checks
2065@cindex Phrases, consistency checks
2066@cindex Consistency check for index phrases
2067
2068@kindex C-c C-s
2069Before indexing the phrases in the phrases buffer, they should be
2070checked carefully for consistency. A first step is to sort the phrases
2071alphabetically - this is done with the command @kbd{C-c C-s}
2072(@code{reftex-index-sort-phrases}). It will sort all phrases in the
2073buffer alphabetically by search phrase. If you want to group certain
2074phrases and only sort within the groups, insert empty lines between the
2075groups. Sorting will only change the sequence of phrases within each
2076group (see the variable @code{reftex-index-phrases-sort-in-blocks}).@refill
2077
2078@kindex C-c C-i
2079A useful command is @kbd{C-c C-i} (@code{reftex-index-phrases-info})
2080which lists information about the phrase at point, including an example
2081of how the index entry will look like and the number of expected matches
2082in the document.@refill
2083
2084@kindex C-c C-t
2085Another important check is to find out if there are double or
2086overlapping entries in the buffer. For example if you are first
2087searching and indexing @samp{Mars} and then @samp{Planet Mars}, the
2088second phrase will not match because of the index macro inserted before
2089@samp{Mars} earlier. The command @kbd{C-c C-t}
2090(@code{reftex-index-find-next-conflict-phrase}) finds the next phrase in
2091the buffer which is either duplicate or a subphrase of another phrase.
2092In order to check the whole buffer like this, start at the beginning and
2093execute this command repeatedly.@refill
2094
2095@node Global Indexing, , Consistency Checks, The Index Phrases File
2096@subsection Global Indexing
2097@cindex Global indexing
2098@cindex Indexing, global
2099@cindex Indexing, from @file{phrases} buffer
2100
2101Once the index phrases have been collected and organized, you are set
2102for global indexing. I recommend to do this only on an otherwise
2103finished document. Global indexing starts from the phrases buffer.
2104There are several commands which start indexing: @kbd{C-c C-x} acts on
2105the current phrase line, @kbd{C-c C-r} on all lines in the current
2106region and @kbd{C-c C-a} on all phrase lines in the buffer. It is
2107probably good to do indexing in small chunks since your concentration
2108may not last long enough to do everything in one go.@refill
2109
2110@b{Ref@TeX{}} will start at the first phrase line and search the phrase
2111globally in the whole document. At each match it will stop, compute the
2112replacement string and offer you the following choices@footnote{Windows
2113users: Restrict yourself to the described keys during indexing. Pressing
2114@key{Help} at the indexing prompt can apparently hang Emacs.}:@refill
2115
2116@table @kbd
2117@item y
2118Replace this match with the proposed string.
2119@item n
2120Skip this match.
2121@item !
2122Replace this and all further matches in this file.
2123@item q
2124Skip this match, start with next file.
2125@item Q
2126Skip this match, start with next phrase.
2127@item o
2128Select a different indexing macro for this match.
2129@item 1-9
2130Select one of multiple index keys (those separated with @samp{||}).
2131@item e
2132Edit the replacement text.
2133@item C-r
2134Recursive edit. Use @kbd{M-C-c} to return to the indexing process.
2135@item s
2136Save this buffer and ask again about the current match.
2137@item S
2138Save all document buffers and ask again about the current match.
2139@item C-g
2140Abort the indexing process.
2141@end table
2142
2143The @samp{Find and Index in Document} menu in the phrases buffer also
2144lists a few options for the indexing process. The options have
2145associated customization variables to set the defaults (@pxref{Options
2146(Index Support)}). Here is a short explanation of what the options do:
2147
2148@table @i
2149@item Match Whole Words
2150When searching for index phrases, make sure whole words are matched.
2151This should probably always be on.
2152@item Case Sensitive Search
2153Search case sensitively for phrases. I recommend to have this setting
2154off, in order to match the capitalized words at the beginning of a
2155sentence, and even typos. You can always say @emph{no} at a match you
2156do not like.
2157@item Wrap Long Lines
2158Inserting index macros increases the line length. Turn this option on
2159to allow @b{Ref@TeX{}} to wrap long lines.
2160@item Skip Indexed Matches
2161When this is on, @b{Ref@TeX{}} will at each match try to figure out if
2162this match is already indexed. A match is considered indexed if it is
2163either the argument of an index macro, or if an index macro is directly
2164(without whitespace separation) before or after the match. Index macros
2165are those configured in @code{reftex-index-macros}. Intended for
2166re-indexing a documents after changes have been made.@refill
2167@end table
2168
2169Even though indexing should be the last thing you do to a document, you
2170are bound to make changes afterwards. Indexing then has to be applied
2171to the changed regions. The command
2172@code{reftex-index-phrases-apply-to-region} is designed for this
2173purpose. When called from a LaTeX document with active region, it will
2174apply @code{reftex-index-all-phrases} to the current region.@refill
2175
2176@node Displaying and Editing the Index, Builtin Index Macros, The Index Phrases File, Index Support
1908@section Displaying and Editing the Index 2177@section Displaying and Editing the Index
1909@cindex Displaying the Index 2178@cindex Displaying the Index
1910@cindex Editing the Index 2179@cindex Editing the Index
@@ -1926,8 +2195,8 @@ index. To restrict to the current section, use a numeric prefix
1926@samp{2}, thus press @kbd{C-u 2 C-c >}. To restrict to the current 2195@samp{2}, thus press @kbd{C-u 2 C-c >}. To restrict to the current
1927region, make the region active and use a numeric prefix @samp{3} (press 2196region, make the region active and use a numeric prefix @samp{3} (press
1928@kbd{C-u 3 C-c >}). From within the @file{*Index*} buffer the 2197@kbd{C-u 3 C-c >}). From within the @file{*Index*} buffer the
1929restriction can be moved from one section to the next with the @kbd{<} 2198restriction can be moved from one section to the next by pressing the
1930and @kbd{>} keys.@refill 2199@kbd{<} and @kbd{>} keys.@refill
1931 2200
1932One caveat: @b{Ref@TeX{}} finds the definition point of an index entry 2201One caveat: @b{Ref@TeX{}} finds the definition point of an index entry
1933by searching near the buffer position where it had found to macro during 2202by searching near the buffer position where it had found to macro during
@@ -1973,7 +2242,7 @@ window.@refill
1973 2242
1974@item @key{RET} 2243@item @key{RET}
1975Go to the definition of the current index entry and hide the 2244Go to the definition of the current index entry and hide the
1976@file{*Index*} buffer.@refill 2245@file{*Index*} buffer window.@refill
1977 2246
1978@item f 2247@item f
1979@vindex reftex-index-follow-mode 2248@vindex reftex-index-follow-mode
@@ -2030,13 +2299,6 @@ Remove the highest superordinate entry. If the current entry is a
2030subitem (@samp{aaa!bbb!ccc}), this function moves it up the hierarchy 2299subitem (@samp{aaa!bbb!ccc}), this function moves it up the hierarchy
2031(@samp{bbb!ccc}).@refill 2300(@samp{bbb!ccc}).@refill
2032 2301
2033@item &
2034Globalize the current entry. This runs a search-and-replace through the
2035entire document in order to index the same word at other places. Rescan
2036the document in order to get the new entries into the index buffer. For
2037details, see the command @code{reftex-index-globally},
2038@ref{Commands}.@refill
2039
2040@tablesubheading{Exiting} 2302@tablesubheading{Exiting}
2041@item q 2303@item q
2042Hide the @file{*Index*} buffer.@refill 2304Hide the @file{*Index*} buffer.@refill
@@ -2056,7 +2318,7 @@ default for this flag can be set with the variable
2056 2318
2057@item @} 2319@item @}
2058Restrict the index to a single document section. The corresponding 2320Restrict the index to a single document section. The corresponding
2059section number will be displayed in the @code{R<>} indication in the 2321section number will be displayed in the @code{R<>} indicator in the
2060mode line and in the header of the @file{*Index*} buffer.@refill 2322mode line and in the header of the @file{*Index*} buffer.@refill
2061 2323
2062@item @{ 2324@item @{
@@ -2104,8 +2366,8 @@ indices).@refill
2104 2366
2105@b{Ref@TeX{}} by default recognizes the @code{\index} and 2367@b{Ref@TeX{}} by default recognizes the @code{\index} and
2106@code{\glossary} macros which are defined in the LaTeX core. It has 2368@code{\glossary} macros which are defined in the LaTeX core. It has
2107also builtin support for the re-implementations of the @code{\index} 2369also builtin support for the re-implementations of @code{\index}
2108macro of the @file{multind} and @file{index} packages. However, since 2370in the @file{multind} and @file{index} packages. However, since
2109the different definitions of the @code{\index} macro are incompatible, 2371the different definitions of the @code{\index} macro are incompatible,
2110you will have to explicitly specify the index style used. 2372you will have to explicitly specify the index style used.
2111@xref{Creating Index Entries}, for information on how to do that. 2373@xref{Creating Index Entries}, for information on how to do that.
@@ -2137,9 +2399,9 @@ macros, first with Emacs Lisp.
2137 2399
2138@lisp 2400@lisp
2139(setq reftex-index-macros 2401(setq reftex-index-macros
2140 '(("\\ix@{*@}" "idx" ?x "" nil) 2402 '(("\\ix@{*@}" "idx" ?x "" nil nil)
2141 ("\\nindex@{*@}" "name" ?n "" nil) 2403 ("\\nindex@{*@}" "name" ?n "" nil nil)
2142 ("\\astobj@{*@}" "idx" ?o "Astronomical Objects!" nil))) 2404 ("\\astobj@{*@}" "idx" ?o "Astronomical Objects!" nil t)))
2143@end lisp 2405@end lisp
2144 2406
2145Note that the index tag is @samp{idx} for the main index, and 2407Note that the index tag is @samp{idx} for the main index, and
@@ -2156,6 +2418,15 @@ respectively.
2156The following string is empty unless your macro adds a superordinate 2418The following string is empty unless your macro adds a superordinate
2157entry to the index key - this is the case for the @code{\astobj} macro. 2419entry to the index key - this is the case for the @code{\astobj} macro.
2158 2420
2421The next entry can be a hook function to exclude certain matches, it
2422almost always can be @code{nil}.
2423
2424The final element in the list indicates if the text being indexed needs
2425to be repeated outside the macro. For the normal index macros, this
2426should be @code{t}. Only if the macro typesets the entry in the text
2427(like @code{\ix} and @code{\nindex} in the example do), this should be
2428@code{nil}.
2429
2159To do the same thing with customize, you need to fill in the templates 2430To do the same thing with customize, you need to fill in the templates
2160like this: 2431like this:
2161 2432
@@ -2167,18 +2438,21 @@ Repeat:
2167 Access Key : x 2438 Access Key : x
2168 Key Prefix : 2439 Key Prefix :
2169 Exclusion hook : nil 2440 Exclusion hook : nil
2441 Repeat Outside : [Toggle] off (nil)
2170[INS] [DEL] List: 2442[INS] [DEL] List:
2171 Macro with args: \nindex@{*@} 2443 Macro with args: \nindex@{*@}
2172 Index Tag : [Value Menu] String: name 2444 Index Tag : [Value Menu] String: name
2173 Access Key : n 2445 Access Key : n
2174 Key Prefix : 2446 Key Prefix :
2175 Exclusion hook : nil 2447 Exclusion hook : nil
2448 Repeat Outside : [Toggle] off (nil)
2176[INS] [DEL] List: 2449[INS] [DEL] List:
2177 Macro with args: \astobj@{*@} 2450 Macro with args: \astobj@{*@}
2178 Index Tag : [Value Menu] String: idx 2451 Index Tag : [Value Menu] String: idx
2179 Access Key : o 2452 Access Key : o
2180 Key Prefix : Astronomical Objects! 2453 Key Prefix : Astronomical Objects!
2181 Exclusion hook : nil 2454 Exclusion hook : nil
2455 Repeat Outside : [Toggle] on (non-nil)
2182[INS] 2456[INS]
2183@end example 2457@end example
2184 2458
@@ -2187,15 +2461,13 @@ macro used for indexing a text phrase (@pxref{Creating Index Entries}).
2187This would be done like this 2461This would be done like this
2188 2462
2189@lisp 2463@lisp
2190(setq reftex-index-default-macro '(?x "idx" nil)) 2464(setq reftex-index-default-macro '(?x "idx"))
2191@end lisp 2465@end lisp
2192 2466
2193which specifies that the macro identified with the character @code{?x} (the 2467which specifies that the macro identified with the character @code{?x} (the
2194@code{\ix} macro) should be used for indexing phrases and words already 2468@code{\ix} macro) should be used for indexing phrases and words already
2195in the buffer with @kbd{C-c /} (@code{reftex-index-selection-or-word}). 2469in the buffer with @kbd{C-c /} (@code{reftex-index-selection-or-word}).
2196The index tag is "idx", and the final @code{nil} means that it is not 2470The index tag is "idx".@refill
2197necessary to repeat the phrase outside the macro, because the macro
2198indexes @emph{and} typesets is argument.
2199 2471
2200@node Viewing Cross-References, RefTeXs Menu, Index Support, Top 2472@node Viewing Cross-References, RefTeXs Menu, Index Support, Top
2201@chapter Viewing Cross--References 2473@chapter Viewing Cross--References
@@ -2301,6 +2573,8 @@ Here is a summary of the available keybindings.
2301@kindex C-c & 2573@kindex C-c &
2302@kindex S-mouse-2 2574@kindex S-mouse-2
2303@kindex C-c / 2575@kindex C-c /
2576@kindex C-c \
2577@kindex C-c |
2304@kindex C-c < 2578@kindex C-c <
2305@kindex C-c > 2579@kindex C-c >
2306@example 2580@example
@@ -2311,6 +2585,8 @@ Here is a summary of the available keybindings.
2311@kbd{C-c &} @code{reftex-view-crossref} 2585@kbd{C-c &} @code{reftex-view-crossref}
2312@kbd{S-mouse-2} @code{reftex-mouse-view-crossref} 2586@kbd{S-mouse-2} @code{reftex-mouse-view-crossref}
2313@kbd{C-c /} @code{reftex-index-selection-or-word} 2587@kbd{C-c /} @code{reftex-index-selection-or-word}
2588@kbd{C-c \} @code{reftex-index-phrase-selection-or-word}
2589@kbd{C-c |} @code{reftex-index-visit-phrases-buffer}
2314@kbd{C-c <} @code{reftex-index} 2590@kbd{C-c <} @code{reftex-index}
2315@kbd{C-c >} @code{reftex-display-index} 2591@kbd{C-c >} @code{reftex-display-index}
2316@end example 2592@end example
@@ -2795,7 +3071,7 @@ with @code{\newtheorem} might use@refill
2795 (if (fboundp 'reftex-add-label-environments) 3071 (if (fboundp 'reftex-add-label-environments)
2796 (reftex-add-label-environments 3072 (reftex-add-label-environments
2797 '(("proposition" ?p "prop:" "~\\ref@{%s@}" t 3073 '(("proposition" ?p "prop:" "~\\ref@{%s@}" t
2798 ("Proposition" "Prop."))))))) 3074 ("Proposition" "Prop.") -3))))))
2799@end group 3075@end group
2800@end lisp 3076@end lisp
2801 3077
@@ -2843,8 +3119,8 @@ you could write this in the style file @file{myindex.el}:
2843 '("aindex" TeX-arg-index)) 3119 '("aindex" TeX-arg-index))
2844 (if (fboundp 'reftex-add-index-macros) 3120 (if (fboundp 'reftex-add-index-macros)
2845 (reftex-add-index-macros 3121 (reftex-add-index-macros
2846 '(("molec@{*@}" "idx" ?m "Molecules!" nil) 3122 '(("molec@{*@}" "idx" ?m "Molecules!" nil nil)
2847 ("aindex@{*@}" "author" ?a "" nil)))))) 3123 ("aindex@{*@}" "author" ?a "" nil nil))))))
2848@end lisp 3124@end lisp
2849 3125
2850@findex reftex-add-section-levels 3126@findex reftex-add-section-levels
@@ -2868,7 +3144,7 @@ is a style file @file{foils.el} that will inform @b{Ref@TeX{}} about these:
2868 3144
2869Once you have written a document with labels, references and citations, 3145Once you have written a document with labels, references and citations,
2870it can be nice to read it like a hypertext document. @b{Ref@TeX{}} has 3146it can be nice to read it like a hypertext document. @b{Ref@TeX{}} has
2871some support for that: @code{reftex-view-crossref} (bound to @kbd{C-c 3147support for that: @code{reftex-view-crossref} (bound to @kbd{C-c
2872&}), @code{reftex-mouse-view-crossref} (bound to @kbd{S-mouse-2}), and 3148&}), @code{reftex-mouse-view-crossref} (bound to @kbd{S-mouse-2}), and
2873@code{reftex-search-document}. A somewhat fancier interface with mouse 3149@code{reftex-search-document}. A somewhat fancier interface with mouse
2874highlighting is provided (among other things) by Peter S. Galbraith's 3150highlighting is provided (among other things) by Peter S. Galbraith's
@@ -2984,8 +3260,8 @@ We need to trick @b{Ref@TeX{}} into swallowing this:
2984@group 3260@group
2985;; Configuration for Lamport's pf.sty 3261;; Configuration for Lamport's pf.sty
2986(setq reftex-label-alist 3262(setq reftex-label-alist
2987 '(("\\step@{*@}@{@}" ?p "st:" "~\\stepref@{%s@}" 2 ("Step" "St.")) 3263 '(("\\step@{*@}@{@}" ?p "st:" "~\\stepref@{%s@}" 2 ("Step" "St."))
2988 ("\\begin@{step+@}@{*@}" ?p "st:" "~\\stepref@{%s@}" 1000))) 3264 ("\\begin@{step+@}@{*@}" ?p "st:" "~\\stepref@{%s@}" 1000)))
2989@end group 3265@end group
2990@end lisp 3266@end lisp
2991 3267
@@ -3068,12 +3344,12 @@ webpage}. Note that the Emacs 19 version supports many but not all
3068features described in this manual.@refill 3344features described in this manual.@refill
3069 3345
3070Thanks to the people on the Net who have used @b{Ref@TeX{}} and helped 3346Thanks to the people on the Net who have used @b{Ref@TeX{}} and helped
3071developing it with their reports. In particular thanks to 3347developing it with their reports. In particular thanks to @i{Fran
3072@i{Fran Burstall, Alastair Burt, Soren Dayton, Stephen Eglen, Karl 3348Burstall, Alastair Burt, Soren Dayton, Stephen Eglen, Karl Eichwalder,
3073Eichwalder, Peter Galbraith, Kai Grossjohann, Dieter Kraft, Adrian Lanz, 3349Peter Galbraith, Kai Grossjohann, Frank Harrell, Dieter Kraft, Adrian
3074Rory Molinari, Stefan Monnier, Laurent Mugnier, Sudeep Kumar Palat, 3350Lanz, Rory Molinari, Stefan Monnier, Laurent Mugnier, Sudeep Kumar
3075Daniel Polani, Robin Socha, Richard Stanton, Allan Strand, Jan Vroonhof, 3351Palat, Daniel Polani, Robin Socha, Richard Stanton, Allan Strand, Jan
3076Christoph Wedler, Alan Williams}.@refill 3352Vroonhof, Christoph Wedler, Alan Williams}.@refill
3077 3353
3078The @code{view-crossref} feature was inspired by @i{Peter Galbraith's} 3354The @code{view-crossref} feature was inspired by @i{Peter Galbraith's}
3079@file{bib-cite.el}.@refill 3355@file{bib-cite.el}.@refill
@@ -3086,8 +3362,10 @@ MicroEmacs at the time).@refill
3086@chapter Commands 3362@chapter Commands
3087@cindex Commands, list of 3363@cindex Commands, list of
3088 3364
3089Here is a summary of @b{Ref@TeX{}}'s commands. All commands are available 3365Here is a summary of @b{Ref@TeX{}}'s commands which can be executed from
3090from the @code{Ref} menu. For keybindings, @pxref{Keybindings}. 3366LaTeX files. Command which are executed from the special buffers are
3367not described here. All commands are available from the @code{Ref}
3368menu. For keybindings, @pxref{Keybindings}.
3091 3369
3092@deffn Command reftex-toc 3370@deffn Command reftex-toc
3093Show the table of contents for the current document. When called with 3371Show the table of contents for the current document. When called with
@@ -3143,6 +3421,24 @@ library which is part of AUCTeX, the string is first processed with the
3143@code{reftex-index-math-format}, which see.@refill 3421@code{reftex-index-math-format}, which see.@refill
3144@end deffn 3422@end deffn
3145 3423
3424@deffn Command reftex-index-phrase-selection-or-word
3425Add current selection or the word at point to the phrases buffer.
3426When you are in transient-mark-mode and the region is active, the
3427selection will be used - otherwise the word at point.
3428You get a chance to edit the entry in the phrases buffer - to save the
3429buffer and return to the LaTeX document, finish with @kbd{C-c C-c}.
3430@end deffn
3431
3432@deffn Command reftex-index-visit-phrases-buffer
3433Switch to the phrases buffer, initialize if empty.
3434@end deffn
3435
3436@deffn Command reftex-index-phrases-apply-to-region
3437Index all index phrases in the current region.
3438This works exactly like global indexing from the index phrases buffer,
3439but operation is restricted to the current region.
3440@end deffn
3441
3146@deffn Command reftex-display-index 3442@deffn Command reftex-display-index
3147Display a buffer with an index compiled from the current document. 3443Display a buffer with an index compiled from the current document.
3148When the document has multiple indices, first prompts for the correct one. 3444When the document has multiple indices, first prompts for the correct one.
@@ -3152,21 +3448,6 @@ With prefix 2, restrict index to current document section.
3152With prefix 3, restrict index to active region.@refill 3448With prefix 3, restrict index to active region.@refill
3153@end deffn 3449@end deffn
3154 3450
3155@deffn Command reftex-index-globally
3156Index a word with a global search and replace. This works very much
3157like @code{reftex-query-replace-document}, but the defaults for the
3158search and replace strings are derived from local context. When there
3159is an index entry, we try to index similar words. The word to search
3160for is the word in direct contact with the index macro (like
3161@samp{\index@{@var{word}@}@var{word}} or
3162@samp{@var{word}\index@{@var{word}@}}). If there is no such word, we
3163use the the index key. The replacement text is the index macro with all
3164its arguments and the attached word. When there is no index entry at
3165point, we search for the word near point and propose to index it like
3166this: @samp{\index@{@var{word}@}@var{word}}. You get a chance to edit
3167the search and replacement strings.@refill
3168@end deffn
3169
3170@deffn Command reftex-view-crossref 3451@deffn Command reftex-view-crossref
3171View cross reference of macro at point. Point must be on the @var{key} 3452View cross reference of macro at point. Point must be on the @var{key}
3172argument. Works with the macros @code{\label}, @code{\ref}, 3453argument. Works with the macros @code{\label}, @code{\ref},
@@ -3278,6 +3559,13 @@ reftex-customize} will get you there.@refill
3278@cindex Options, table of contents 3559@cindex Options, table of contents
3279@cindex Table of contents, options 3560@cindex Table of contents, options
3280 3561
3562@defopt reftex-toc-max-level
3563The maximum level of toc entries which will be included in the TOC.
3564Section headings with a bigger level will be ignored. In RefTeX,
3565chapters are level 1, sections level 2 etc. This variable can be
3566changed from within the @file{*toc*} buffer with the @kbd{t} key.@refill
3567@end defopt
3568
3281@defopt reftex-toc-keep-other-windows 3569@defopt reftex-toc-keep-other-windows
3282Non-@code{nil} means, split the selected window to display the 3570Non-@code{nil} means, split the selected window to display the
3283@file{*toc*} buffer. This helps to keep the window configuration, but 3571@file{*toc*} buffer. This helps to keep the window configuration, but
@@ -3352,7 +3640,7 @@ itself and has the following structure:
3352 3640
3353@example 3641@example
3354 (@var{env-or-macro} @var{type-key} @var{label-prefix} @var{reference-format} 3642 (@var{env-or-macro} @var{type-key} @var{label-prefix} @var{reference-format}
3355 @var{context-method} (@var{magic-word} ... )) 3643 @var{context-method} (@var{magic-word} ... ) @var{toc-level})
3356@end example 3644@end example
3357 3645
3358Each list entry describes either an environment carrying a counter for 3646Each list entry describes either an environment carrying a counter for
@@ -3478,8 +3766,16 @@ the word before point is equal to one of these words when calling
3478@code{reftex-reference}, the label list offered will be automatically 3766@code{reftex-reference}, the label list offered will be automatically
3479restricted to labels of the correct type. If the first element of this 3767restricted to labels of the correct type. If the first element of this
3480word--list is the symbol `regexp', the strings are interpreted as regular 3768word--list is the symbol `regexp', the strings are interpreted as regular
3481expressions@footnote{Careful: @b{Ref@TeX{}} will add stuff to the 3769expressions.@refill
3482beginning and end of these regular expressions.}.@refill 3770
3771@item @var{toc-level}
3772The integer level at which this environment should be added to the table
3773of contents. See also @code{reftex-section-levels}. A positive value
3774will number the entries mixed with the sectioning commands of the same
3775level. A negative value will make unnumbered entries. Useful only for
3776theorem-like environments which structure the document. Will be ignored
3777for macros. When omitted or @code{nil}, no TOC entries will be
3778made.@refill
3483@end table 3779@end table
3484 3780
3485If the type indicator characters of two or more entries are the same, 3781If the type indicator characters of two or more entries are the same,
@@ -3507,7 +3803,7 @@ Commands and levels used for defining sections in the document. The
3507@code{car} of each cons cell is the name of the section macro. The 3803@code{car} of each cons cell is the name of the section macro. The
3508@code{cdr} is a number indicating its level. A negative level means the 3804@code{cdr} is a number indicating its level. A negative level means the
3509same as the positive value, but the section will never get a 3805same as the positive value, but the section will never get a
3510number. The @code{cdr} amy also be a function which then has to return 3806number. The @code{cdr} may also be a function which then has to return
3511the level.@refill 3807the level.@refill
3512@end defopt 3808@end defopt
3513 3809
@@ -3923,7 +4219,7 @@ correspond to the @code{MakeIndex} keywords
3923List of macros which define index entries. The structure of each entry 4219List of macros which define index entries. The structure of each entry
3924is 4220is
3925@lisp 4221@lisp
3926(@var{macro} @var{index-tag} @var{key} @var{prefix} @var{exclude}) 4222(@var{macro} @var{index-tag} @var{key} @var{prefix} @var{exclude} @var{repeat})
3927@end lisp 4223@end lisp
3928 4224
3929@var{macro} is the macro. Arguments should be denoted by empty braces, 4225@var{macro} is the macro. Arguments should be denoted by empty braces,
@@ -3949,6 +4245,11 @@ non-nil value, the index entry at point is ignored. This was
3949implemented to support the (deprecated) @samp{^} and @samp{_} shortcuts 4245implemented to support the (deprecated) @samp{^} and @samp{_} shortcuts
3950in the LaTeX2e @code{index} package.@refill 4246in the LaTeX2e @code{index} package.@refill
3951 4247
4248@var{repeat}, if non-@code{nil}, means the index macro does not typeset
4249the entry in the text, so that the text has to be repeated outside the
4250index macro. Needed for @code{reftex-index-selection-or-word} and for
4251indexing from the phrase buffer.@refill
4252
3952The final entry may also be a symbol. It must have an association in 4253The final entry may also be a symbol. It must have an association in
3953the variable @code{reftex-index-macros-builtin} to specify the main 4254the variable @code{reftex-index-macros-builtin} to specify the main
3954indexing package you are using. Legal values are currently@refill 4255indexing package you are using. Legal values are currently@refill
@@ -3966,7 +4267,7 @@ package here.
3966 4267
3967@defopt reftex-index-default-macro 4268@defopt reftex-index-default-macro
3968The default index macro for @code{reftex-index-selection-or-word}. 4269The default index macro for @code{reftex-index-selection-or-word}.
3969This is a list with @code{(@var{macro-key} @var{default-tag} @var{repeat-word})}. 4270This is a list with @code{(@var{macro-key} @var{default-tag})}.
3970 4271
3971@var{macro-key} is a character identifying an index macro - see 4272@var{macro-key} is a character identifying an index macro - see
3972@code{reftex-index-macros}. 4273@code{reftex-index-macros}.
@@ -3975,11 +4276,7 @@ This is a list with @code{(@var{macro-key} @var{default-tag} @var{repeat-word})}
3975@var{tag} argument. When this is @code{nil} and a @var{tag} is needed, 4276@var{tag} argument. When this is @code{nil} and a @var{tag} is needed,
3976@b{Ref@TeX{}} will ask for it. When this is the empty string and the 4277@b{Ref@TeX{}} will ask for it. When this is the empty string and the
3977TAG argument of the index macro is optional, the TAG argument will be 4278TAG argument of the index macro is optional, the TAG argument will be
3978omitted. 4279omitted.@refill
3979
3980@var{repeat-word}, when non-@code{nil} means, the index macro does not
3981typeset the entry in the text, so that the text has to be repeated
3982outside the index macro.
3983@end defopt 4280@end defopt
3984 4281
3985@defopt reftex-index-default-tag 4282@defopt reftex-index-default-tag
@@ -4004,14 +4301,90 @@ math delimiters (e.g. @samp{$}) to the string. Requires the
4004@file{texmathp.el} library which is part of AUCTeX.@refill 4301@file{texmathp.el} library which is part of AUCTeX.@refill
4005@end defopt 4302@end defopt
4006 4303
4304@defopt reftex-index-phrases-logical-and-regexp
4305Regexp matching the @samp{and} operator for index arguments in phrases
4306file. When several index arguments in a phrase line are separated by
4307this operator, each part will generate an index macro. So each match of
4308the search phrase will produce @emph{several} different index entries.
4309Make sure this does no match things which are not separators. This
4310logical @samp{and} has higher priority than the logical @samp{or}
4311specified in @code{reftex-index-phrases-logical-or-regexp}.@refill
4312@end defopt
4313
4314@defopt reftex-index-phrases-logical-or-regexp
4315Regexp matching the @samp{or} operator for index arguments in phrases
4316file. When several index arguments in a phrase line are separated by
4317this operator, the user will be asked to select one of them at each
4318match of the search phrase. The first index arg will be the default. A
4319number key @kbd{1}--@kbd{9} must be pressed to switch to another. Make
4320sure this does no match things which are not separators. The logical
4321@samp{and} specified in @code{reftex-index-phrases-logical-or-regexp}
4322has higher priority than this logical @samp{or}.@refill
4323@end defopt
4324
4325@defopt reftex-index-phrases-search-whole-words
4326Non-@code{nil} means phrases search will look for whole words, not subwords.
4327This works by requiring word boundaries at the beginning and end of
4328the search string. When the search phrase already has a non-word-char
4329at one of these points, no word boundary is required there.
4330@end defopt
4331
4332@defopt reftex-index-phrases-case-fold-search
4333Non-@code{nil} means, searching for index phrases will ignore
4334case.@refill
4335@end defopt
4336
4337@defopt reftex-index-phrases-skip-indexed-matches
4338Non-@code{nil} means, skip matches which appear to be indexed already.
4339When doing global indexing from the phrases buffer, searches for some
4340phrases may match at places where that phrase was already indexed. In
4341particular when indexing an already processed document again, this
4342will even be the norm. When this variable is non-@code{nil},
4343@b{Ref@TeX{}} checks if the match is an index macro argument, or if an
4344index macro is directly before or after the phrase. If that is the
4345case, that match will be ignored.@refill
4346@end defopt
4347
4348@defopt reftex-index-phrases-wrap-long-lines
4349Non-@code{nil} means, when indexing from the phrases buffer, wrap lines.
4350Inserting indexing commands in a line makes the line longer - often
4351so long that it does not fit onto the screen. When this variable is
4352non-@code{nil}, newlines will be added as necessary before and/or after the
4353indexing command to keep lines short. However, the matched text
4354phrase and its index command will always end up on a single line.@refill
4355@end defopt
4356
4357@defopt reftex-index-phrases-sort-prefers-entry
4358Non-@code{nil} means when sorting phrase lines, the explicit index entry
4359is used. Phrase lines in the phrases buffer contain a search phrase, and
4360sorting is normally based on these. Some phrase lines also have
4361an explicit index argument specified. When this variable is
4362non-@code{nil}, the index argument will be used for sorting.@refill
4363@end defopt
4364
4365@defopt reftex-index-phrases-sort-in-blocks
4366Non-@code{nil} means, empty and comment lines separate phrase buffer
4367into blocks. Sorting will then preserve blocks, so that lines are
4368re-arranged only within blocks.
4369@end defopt
4370
4371@defopt reftex-index-phrases-map
4372Keymap for the Index Phrases buffer.
4373@end defopt
4374
4375@defopt reftex-index-phrases-mode-hook
4376Normal hook which is run when a buffer is put into
4377@code{reftex-index-phrases-mode}.@refill
4378@end defopt
4379
4007@defopt reftex-index-section-letters 4380@defopt reftex-index-section-letters
4008The letters which denote sections in the index. Usually these are all 4381The letters which denote sections in the index. Usually these are all
4009capital letters. Don't use any downcase letters. Order is not 4382capital letters. Don't use any downcase letters. Order is not
4010significant, the index will be sorted by whatever the sort function 4383significant, the index will be sorted by whatever the sort function
4011thinks is correct. In addition to these letters, RefTeX will create a 4384thinks is correct. In addition to these letters, @b{Ref@TeX{}} will
4012group @samp{!} which contains all entries sorted below the lowest 4385create a group @samp{!} which contains all entries sorted below the
4013specified letter. In the @file{*Index*} buffer, pressing any of these 4386lowest specified letter. In the @file{*Index*} buffer, pressing any of
4014capital letters or @kbd{!} will jump to that section.@refill 4387these capital letters or @kbd{!} will jump to that section.@refill
4015@end defopt 4388@end defopt
4016 4389
4017@defopt reftex-index-include-context 4390@defopt reftex-index-include-context
@@ -4445,11 +4818,11 @@ Normal hook which is being run when loading @file{reftex.el}.
4445Normal hook which is being run when turning on @b{Ref@TeX{}} mode.@refill 4818Normal hook which is being run when turning on @b{Ref@TeX{}} mode.@refill
4446@end deffn 4819@end deffn
4447 4820
4448Furthermore, the 3 modes used for referencing labels, creating citations 4821Furthermore, the 4 modes used for referencing labels, creating
4449and for the table of contents buffer have their own keymaps and mode 4822citations, the table of contents buffer and the phrases buffer have
4450hooks. See the respective sections. There are many more hooks which 4823their own keymaps and mode hooks. See the respective sections. There
4451are described in the relevant sections about options for a specific part 4824are many more hooks which are described in the relevant sections about
4452of @b{Ref@TeX{}}.@refill 4825options for a specific part of @b{Ref@TeX{}}.@refill
4453 4826
4454@node Changes, , Keymaps and Hooks, Top 4827@node Changes, , Keymaps and Hooks, Top
4455@chapter Changes 4828@chapter Changes
@@ -4903,7 +5276,6 @@ New options @code{reftex-texpath-environment-variables},
4903@emph{kpathsearch} support. See new options and 5276@emph{kpathsearch} support. See new options and
4904@code{reftex-bibpath-environment-variables}. 5277@code{reftex-bibpath-environment-variables}.
4905@end itemize 5278@end itemize
4906@end ignore
4907@noindent @b{Version 3.42} 5279@noindent @b{Version 3.42}
4908@itemize @bullet 5280@itemize @bullet
4909@item 5281@item
@@ -4932,6 +5304,7 @@ Files in @code{reftex-default-bibliography} will be searched along
4932@item 5304@item
4933Reading a parse file now checks consistency. 5305Reading a parse file now checks consistency.
4934@end itemize 5306@end itemize
5307@end ignore
4935@noindent @b{Version 4.00} 5308@noindent @b{Version 4.00}
4936@itemize @bullet 5309@itemize @bullet
4937@item 5310@item
@@ -4980,7 +5353,30 @@ of a sectioning command.
4980@item 5353@item
4981Multiple @code{thebibliography} environments recognized. 5354Multiple @code{thebibliography} environments recognized.
4982@end itemize 5355@end itemize
4983 5356@noindent @b{Version 4.09}
5357@itemize @bullet
5358@item
5359New option @code{reftex-toc-max-level} to limit the depth of the toc.
5360New keybinding @kbd{t} in the @file{*toc*} buffer to change this
5361setting.@refill
5362@item
5363RefTeX maintaines an @file{Index Phrases} file in which phrases can be
5364collected. When the document is ready, RefTeX can search all
5365these phrases and assist indexing all matches.@refill
5366@item
5367The variables @code{reftex-index-macros} and
5368@code{reftex-index-default-macro} have changed their syntax slightly.
5369The @var{repeat} parameter has move from the latter to the former.
5370Also calls to @code{reftex-add-index-macros} from AUCTeX style files
5371need to be adapted.@refill
5372@item
5373The variable @code{reftex-section-levels} no longer contains the
5374default stuff which has been moved to a constant.@refill
5375@item
5376Environments like theorems can be placed into the TOC by putting
5377entries for @samp{"begin@{theorem@}"} in
5378@code{reftex-setion-levels}.@refill
5379@end itemize
4984 5380
4985@node Index, , , Top 5381@node Index, , , Top
4986@unnumbered Index 5382@unnumbered Index