comparison man/reftex.texi @ 26911:d7f536a01276

Update to reftex 4.9
author Carsten Dominik <dominik@science.uva.nl>
date Wed, 15 Dec 1999 17:27:40 +0000
parents ac7e9e5e2ccb
children d7311a9cb223
comparison
equal deleted inserted replaced
26910:489a5439b988 26911:d7f536a01276
7 * RefTeX: (reftex). Emacs support for LaTeX cross-references and citations. 7 * RefTeX: (reftex). Emacs support for LaTeX cross-references and citations.
8 @end direntry 8 @end direntry
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
18 @set MAINTAINER-EMAIL dominik@@strw.leidenuniv.nl 18 @set MAINTAINER-EMAIL dominik@@strw.leidenuniv.nl
19 @c %**end of header 19 @c %**end of header
70 @subtitle Support for LaTeX labels, references, citations and index entries with GNU Emacs 70 @subtitle Support for LaTeX labels, references, citations and index entries with GNU Emacs
71 @subtitle Edition @value{EDITION}, @value{DATE} 71 @subtitle Edition @value{EDITION}, @value{DATE}
72 72
73 @author by Carsten Dominik 73 @author by Carsten Dominik
74 @page 74 @page
75 Copyright @copyright{} 1997, 1998 Free Software Foundation, Inc. 75 Copyright @copyright{} 1997, 1998, 1999 Free Software Foundation, Inc.
76 76
77 @sp 2 77 @sp 2
78 This is edition @value{EDITION} of the @cite{Ref@TeX{} User Manual} for 78 This is edition @value{EDITION} of the @cite{Ref@TeX{} User Manual} for
79 @b{Ref@TeX{}} version @value{VERSION}, @value{DATE}.@refill 79 @b{Ref@TeX{}} version @value{VERSION}, @value{DATE}.@refill
80 80
176 * Chapterbib and Bibunits:: Multiple bibliographies in a Document. 176 * Chapterbib and Bibunits:: Multiple bibliographies in a Document.
177 * Citations Outside LaTeX:: How to make citations in Emails etc. 177 * Citations Outside LaTeX:: How to make citations in Emails etc.
178 178
179 Index Support 179 Index 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.
186
187 The 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.
185 192
186 AUCTeX 193 AUCTeX
187 194
188 * AUCTeX-RefTeX Interface:: How both packages work together 195 * AUCTeX-RefTeX Interface:: How both packages work together
189 * Style Files:: AUCTeX's style files can support RefTeX 196 * Style Files:: AUCTeX's style files can support RefTeX
354 are supported.@refill 361 are supported.@refill
355 362
356 @itemize @bullet 363 @itemize @bullet
357 @item 364 @item
358 @b{Creating Index Entries}@* 365 @b{Creating Index Entries}@*
359 Type @kbd{C-c /} (@code{reftex-index-selection-or-word}) to index the 366 To index the current selection or the word at point, type @kbd{C-c /}
360 current selection or the word at the cursor with the default macro (see 367 (@code{reftex-index-selection-or-word}). The default macro
361 the variable @code{reftex-index-default-macro}).@* 368 @code{reftex-index-default-macro} will be used. For a more complex entry
362 Type @kbd{C-c <} (@code{reftex-index}) to insert a general index macro. 369 type @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 370 and enter the arguments with completion.@refill
364 completion for the index tag (used to identify one of multiple indices) 371
365 and for the entry itself (useful with subentries). 372 @item
366 373 @b{The Index Phrases File (Delayed Indexing)}@*
367 @refill 374 Type @kbd{C-c \} (@code{reftex-index-phrase-selection-or-word}) to add
368 375 the 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 377 phrases and let you interactively index the matches.@refill
371 buffer, type @kbd{C-c >} (@code{reftex-display-index}). From that 378
372 buffer you can check and edit all entries. The index can be restricted 379 @item
373 to those entries defined in a single document section or in a user 380 @b{Displaying and Editing the Index}@*
374 defined region.@refill 381 To 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
383 all entries.@refill
375 @end itemize 384 @end itemize
376 385
377 @page 386 @page
378 @item @b{Viewing Cross-References}@* 387 @item @b{Viewing Cross-References}@*
379 When point is on the @var{key} argument of a cross--referencing macro 388 When point is on the @var{key} argument of a cross--referencing macro
380 (@code{\label}, @code{\ref}, @code{\cite}, @code{\bibitem}, 389 (@code{\label}, @code{\ref}, @code{\cite}, @code{\bibitem},
381 @code{\index}, and variations) or inside a BibTeX database entry, you 390 @code{\index}, and variations) or inside a BibTeX database entry, you
382 can press @kbd{C-c &} (@code{reftex-view-crossref}) to display 391 can press @kbd{C-c &} (@code{reftex-view-crossref}) to display
383 corresponding locations in the document and associated BibTeX database 392 corresponding locations in the document and associated BibTeX database
384 files.@refill @* When the enclosing macro is @code{\cite} or @code{\ref} 393 files.@refill @*
385 and no other message occupies the echo area, information about the 394 When the enclosing macro is @code{\cite} or @code{\ref} and no other
386 citation or label will automatically be displayed in the echo 395 message occupies the echo area, information about the citation or label
387 area.@refill 396 will automatically be displayed in the echo area.@refill
388 397
389 @item 398 @item
390 @b{Multifile Documents}@* 399 @b{Multifile Documents}@*
391 Multifile Documents are fully supported. The included files must have a 400 Multifile Documents are fully supported. The included files must have a
392 file variable @code{TeX-master} or @code{tex-main-file} pointing to the 401 file variable @code{TeX-master} or @code{tex-main-file} pointing to the
438 @b{Ref@TeX{}}.@refill 447 @b{Ref@TeX{}}.@refill
439 448
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
441 until you have picked up the key bindings. For an overview of what you 450 until you have picked up the key bindings. For an overview of what you
442 can do in each of the different special buffers, press @kbd{?}. Read 451 can do in each of the different special buffers, press @kbd{?}. Read
443 the manual if you get stuck. The first part of the manual explains in 452 the manual if you get stuck, of if you are curious what else might be
453 available. The first part of the manual explains in
444 a tutorial way how to use and customize @b{Ref@TeX{}}. The second 454 a tutorial way how to use and customize @b{Ref@TeX{}}. The second
445 part is a command and variable reference.@refill 455 part is a command and variable reference.@refill
446 @end enumerate 456 @end enumerate
447 457
448 @node Table of Contents, Labels and References, Introduction, Top 458 @node Table of Contents, Labels and References, Introduction, Top
539 @samp{2}, restrict the index to the section at point in the @file{*toc*} 549 @samp{2}, restrict the index to the section at point in the @file{*toc*}
540 buffer. 550 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
556 Change the maximum level of toc entries displayed in the @file{*toc*}
557 buffer. Without prefix arg, all levels will be included. With prefix
558 arg (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.
560 The mode line @samp{T<>} indicator shows the current value. The default
561 depth 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
546 Toggle the display of the file borders of a multifile document in the 566 Toggle the display of the file borders of a multifile document in the
547 @file{*toc*} buffer. The default for this flag can be set with the 567 @file{*toc*} buffer. The default for this flag can be set with the
548 variable @code{reftex-toc-include-file-boundaries}.@refill 568 variable @code{reftex-toc-include-file-boundaries}.@refill
600 keymap @code{reftex-toc-map} may be used.@refill 620 keymap @code{reftex-toc-map} may be used.@refill
601 621
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
606 The section macros recognized by @b{Ref@TeX{}} are all LaTeX section 627 The section macros recognized by @b{Ref@TeX{}} are all LaTeX section
607 macros (from @code{\part} to @code{\subsubparagraph}) and the commands 628 macros (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.
609 Additional macros can be configured with the variable 630 Additional 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
632 environments to the table of contents. This is probably only useful for
633 theorem-like environments. @xref{Defining Label Environments}, for an
634 example.
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
614 @cindex Labels in LaTeX 638 @cindex Labels in LaTeX
615 @cindex References in LaTeX 639 @cindex References in LaTeX
880 @item F 904 @item F
881 Toggle the display of the file borders of a multifile document in the 905 Toggle the display of the file borders of a multifile document in the
882 selection buffer.@refill 906 selection buffer.@refill
883 907
884 @item t 908 @item t
885 Toggle the display of the table of contents in the selection buffer.@refill 909 Toggle the display of the table of contents in the selection buffer.
910 With prefix @var{arg}, change the maximum level of toc entries displayed
911 to @var{arg}. Chapters are level 1, section are level 2.@refill
886 912
887 @item # 913 @item #
888 Toggle the display of a label counter in the selection buffer.@refill 914 Toggle the display of a label counter in the selection buffer.@refill
889 915
890 @item % 916 @item %
1093 either use Lisp to do this (e.g. in @file{.emacs}) or use the custom 1119 either use Lisp to do this (e.g. in @file{.emacs}) or use the custom
1094 library. With Lisp it would look like this 1120 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
1102 The type indicator characters @code{?a} and @code{?h} are used for 1128 The type indicator characters @code{?a} and @code{?h} are used for
1103 prompts when @b{Ref@TeX{}} queries for a label type. @code{?h} 1129 prompts when @b{Ref@TeX{}} queries for a label type. @code{?h}
1104 was chosen for @code{theorem} since @code{?t} is already taken by 1130 was chosen for @code{theorem} since @code{?t} is already taken by
1128 For more complex ways of getting context, see the variable 1154 For more complex ways of getting context, see the variable
1129 @code{reftex-label-alist} (@ref{Options (Defining Label 1155 @code{reftex-label-alist} (@ref{Options (Defining Label
1130 Environments)}).@refill 1156 Environments)}).@refill
1131 @end itemize 1157 @end itemize
1132 1158
1133 The strings at the end of each entry are used to guess the correct label 1159 The following list of strings is used to guess the correct label type
1134 type from the word before point when creating a reference. E.g. if you 1160 from the word before point when creating a reference. E.g. if you
1135 write: @samp{As we have shown in Theorem} and then press @kbd{C-c )}, 1161 write: @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
1137 the menu to only these labels without even asking.@refill 1163 restrict the menu to only these labels without even asking.@refill
1164
1165 The final item in each entry is the level at which the environment
1166 should produce entries in the table of context buffer. If the number is
1167 positive, 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
1170 document similar to sectioning commands. For everything else, omit the
1171 item.@refill
1138 1172
1139 To do the same configuration with @code{customize}, you need to click on 1173 To do the same configuration with @code{customize}, you need to click on
1140 the @code{[INS]} button twice to create two templates and fill them in 1174 the @code{[INS]} button twice to create two templates and fill them in
1141 like this:@refill 1175 like this:@refill
1142 1176
1150 Context method : [Value Menu] After label 1184 Context method : [Value Menu] After label
1151 Magic words: 1185 Magic words:
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
1158 Label prefix string : [Value Menu] String: thr: 1193 Label prefix string : [Value Menu] String: thr:
1159 Label reference format: [Value Menu] String: ~\ref@{%s@} 1194 Label reference format: [Value Menu] String: ~\ref@{%s@}
1161 Magic words: 1196 Magic words:
1162 [INS] [DEL] String: theorem 1197 [INS] [DEL] String: theorem
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
1169 @vindex reftex-label-menu-flags 1205 @vindex reftex-label-menu-flags
1170 Depending on how you would like the label insertion and selection for 1206 Depending on how you would like the label insertion and selection for
1218 Label prefix string : [Value Menu] Default 1254 Label prefix string : [Value Menu] Default
1219 Label reference format: [Value Menu] Default 1255 Label reference format: [Value Menu] Default
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
1226 @subsection Figure Wrapping Macro 1263 @subsection Figure Wrapping Macro
1227 @cindex Macros as environment wrappers 1264 @cindex Macros as environment wrappers
1277 Label prefix string : [Value Menu] Default 1314 Label prefix string : [Value Menu] Default
1278 Label reference format: [Value Menu] Default 1315 Label reference format: [Value Menu] Default
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
1285 @subsection Adding Magic Words 1323 @subsection Adding Magic Words
1286 @cindex Magic words 1324 @cindex Magic words
1441 the customization buffer. Here is a lisp example which uses several of 1479 the customization buffer. Here is a lisp example which uses several of
1442 the entries described above: 1480 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)
1451 (detect-linguex ?x "ex:" "~\\ref@{%s@}" nil ("Example" "Ex.")))) 1489 (detect-linguex ?x "ex:" "~\\ref@{%s@}" nil ("Example" "Ex."))))
1452 @end lisp 1490 @end lisp
1799 about a citation directly into the buffer. Here is the lisp code to add 1837 about a citation directly into the buffer. Here is the lisp code to add
1800 the @kbd{C-c [} binding to the mail buffer. It also provides a local 1838 the @kbd{C-c [} binding to the mail buffer. It also provides a local
1801 binding for @code{reftex-cite-format}.@refill 1839 binding 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
1816 @chapter Index Support 1851 @chapter Index Support
1817 @cindex Index Support 1852 @cindex Index Support
1826 All entries defined in a document are written out to the @file{.aux} 1861 All entries defined in a document are written out to the @file{.aux}
1827 file. A separate tool must be used to convert this information into a 1862 file. A separate tool must be used to convert this information into a
1828 nicely formatted index. Tools used with LaTeX include @code{MakeIndex} 1863 nicely formatted index. Tools used with LaTeX include @code{MakeIndex}
1829 and @code{xindy}.@refill 1864 and @code{xindy}.@refill
1830 1865
1831 Indexing is a lot of work and must follow strict conventions, so that 1866 Indexing is a very difficult task. It must follow strict conventions to
1832 the same word looks the same in all index entries referencing it, and in 1867 make the index consistent and complete. There are basically two
1833 order to avoid spurious multiple entries. Therefore, the author of a 1868 approaches one can follow, and both have their merits.
1834 document will most likely define special macros to make this easier. To 1869
1835 make @b{Ref@TeX{}} support for indexing possible, these special macros 1870 @enumerate
1836 must be added to @b{Ref@TeX{}}'s configuration (@pxref{Defining Index 1871 @item
1837 Macros}).@refill 1872 Part of the indexing should already be done with the markup. The
1873 document structure should be reflected in the index, so when starting
1874 new sections, the basic topics of the section should be indexed. If the
1875 document contains definitions, theorems or the like, these should all
1876 correspond to appropriate index entries. This part of the index can
1877 very well be developed along with the document. Often it is worthwhile
1878 to define special purpose macros which define an item and at the same
1879 time make an index entry, possibly with special formatting to make the
1880 reference page in the index bold or underlined. To make @b{Ref@TeX{}}
1881 support for indexing possible, these special macros must be added to
1882 @b{Ref@TeX{}}'s configuration (@pxref{Defining Index Macros}).@refill
1883
1884 @item
1885 The rest of the index is often just a collection of where in the
1886 document certain words or phrases are being used. This part is
1887 difficult to develop along with the document, because consistent entries
1888 for each occurrence are needed and are best selected when the document
1889 is ready. @b{Ref@TeX{}} supports this with an @emph{index phrases file}
1890 which collects phrases and helps indexing the phrases globally.@refill
1891 @end enumerate
1892
1893 Before you start, you need to make sure that @b{Ref@TeX{}} knows about
1894 the index style being used in the current document. @b{Ref@TeX{}} has
1895 builtin support for the default @code{\index} and @code{\glossary}
1896 macros. Other LaTeX packages, like the @file{multind} or @file{index}
1897 package, redefine the @code{\index} macro to have an additional
1898 argument, and @b{Ref@TeX{}} needs to be configured for those. A
1899 sufficiently new version of AUCTeX (9.10c or later) will do this
1900 automatically. If you really don't use AUCTeX (you should!), this
1901 configuration needs to be done by hand with the menu (@code{Ref->Index
1902 Style}), 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
1853 First you need to make sure that @b{Ref@TeX{}} knows about the index
1854 style being used in the current document. @b{Ref@TeX{}} has builtin
1855 support for the default @code{\index} and @code{\glossary} macros.
1856 Other LaTeX packages, like the @file{multind} or @file{index} package,
1857 redefine the @code{\index} macro to have an additional argument, and
1858 @b{Ref@TeX{}} needs to be configured for those. A sufficiently new
1859 version of AUCTeX (9.10c or later) will do this automatically. If you
1860 really don't use AUCTeX (you should!), this configuration needs to be
1861 done by hand with the menu (@code{Ref->Index Style}), or globally for
1862 all 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
1872 In order to index the current selection or the word at the cursor press 1926 In order to index the current selection or the word at the cursor press
1873 @kbd{C-c /} (@code{reftex-index-selection-or-word}). This causes the 1927 @kbd{C-c /} (@code{reftex-index-selection-or-word}). This causes the
1889 available for the index entry and, if applicable, the index tag. The 1943 available for the index entry and, if applicable, the index tag. The
1890 index tag is a string identifying one of multiple indices. With the 1944 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
1892 to the redefined @code{\index} macro.@refill 1946 to 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
1895 1949 @section The Index Phrases File
1896 There is also a command @code{reftex-index-globally}@footnote{This 1950 @cindex Index phrase file
1897 function is still experimentally and may change or go away.} which 1951 @cindex Phrase file
1898 copies an index entry near point to other occurrences of the same word 1952 @kindex C-c |
1899 in the document. @b{Ref@TeX{}} assumes that the word you want to index 1953 @findex reftex-index-visit-phrases-buffer
1900 is in direct contact with the index macro, e.g. 1954 @cindex Macro definition lines, in phrase buffer
1901 @samp{\index@{@var{word}@}@var{word}} or 1955
1902 @samp{@var{word}\index@{@var{word}@}}. If there is no such word, it 1956 @b{Ref@TeX{}} maintains a file in which phrases can be collected for
1903 uses the key argument of the index macro. After making you confirm the 1957 later indexing. The file is located in the same directory as the master
1904 precise search and replace strings, a query-replace over the entire 1958 file of the document and has the extension @file{.rip} (@b{R}eftex
1905 document will be launched. 1959 @b{I}ndex @b{P}hrases). You can create or visit the file with @kbd{C-c
1906 1960 |} (@code{reftex-index-visit-phrases-buffer}). If the file is empty it
1907 @node Displaying and Editing the Index, Builtin Index Macros, Creating Index Entries, Index Support 1961 is initialized by inserting a file header which contains the definition
1962 of the available index macros. This list is initialized from
1963 @code{reftex-index-macros} (@pxref{Defining Index Macros}). You can
1964 edit the header as needed, but if you define new LaTeX indexing macros,
1965 don't forget to add them to @code{reftex-index-macros} as well. Here is
1966 a 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
1979 The macro definition lines consist of a unique letter identifying a
1980 macro, 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
1983 indicates 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
1986 above example it is assumed that the macro @code{\index*@{@var{word}@}}
1987 already typesets its argument in the text, so that it is unnecessary to
1988 repeat @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
2002 Phrases for indexing can be collected while writing the document. The
2003 command @kbd{C-c \} (@code{reftex-index-phrase-selection-or-word})
2004 copies the current selection (if active) or the word near point into the
2005 phrases buffer. It then selects this buffer, so that the phrase line
2006 can be edited. To return to the LaTeX document, press @kbd{C-c C-c}
2007 (@code{reftex-index-phrases-save-and-return}).
2008
2009 You can also prepare the list of index phrases in a different way and
2010 copy it into the phrases file. For example you might want to start from
2011 a word list of the document and remove all words which should not be
2012 indexed.
2013
2014 The phrase lines in the phrase buffer must have a specific format.
2015 @b{Ref@TeX{}} will use font-lock to indicate if a line has the proper
2016 format. A phrase line looks like this:
2017
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
2024 identifying one of the macros defined in the file header. It is
2025 optional - when omitted, the first macro definition line in the file
2026 will be used for this phrase. The @var{phrase} is the phrase to be
2027 searched for when indexing. It may contain several words separated by
2028 spaces. By default the search phrase is also the text entered as
2029 argument of the index macro. If you want the index entry to be
2030 different from the search phrase, enter another @key{TAB} and the index
2031 argument @var{arg}. If you want to have each match produce several
2032 index 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
2035 able to choose at each match between several different index arguments,
2036 separate them with @samp{ || }@footnote{@samp{||} with optional spaces,
2037 see @code{reftex-index-phrases-logical-or-regexp}.}. Here is an
2038 example:@refill
2039
2040 @example
2041 %--------------------------------------------------------------------
2042 I Sun
2043 i Planet Planets
2044 i Vega Stars!Vega
2045 Jupiter Planets!Jupiter
2046 i Mars Planets!Mars || Gods!Mars || Chocolate Bars!Mars
2047 i Pluto Planets!Pluto && Kuiper Belt Objects!Pluto
2048 @end example
2049
2050
2051 So @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
2055 macro definition in the file header (see above example). At each
2056 occurrence of @samp{Mars} you will be able choose between indexing it as
2057 a subitem of @samp{Planets}, @samp{Gods} or @samp{Chocolate Bars}.
2058 Finally, every occurrence of @samp{Pluto} will be indexed as
2059 @samp{\index@{Planets!Pluto@}\index@{Kuiper Belt Objects!Pluto@}Pluto}
2060 and 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
2069 Before indexing the phrases in the phrases buffer, they should be
2070 checked carefully for consistency. A first step is to sort the phrases
2071 alphabetically - this is done with the command @kbd{C-c C-s}
2072 (@code{reftex-index-sort-phrases}). It will sort all phrases in the
2073 buffer alphabetically by search phrase. If you want to group certain
2074 phrases and only sort within the groups, insert empty lines between the
2075 groups. Sorting will only change the sequence of phrases within each
2076 group (see the variable @code{reftex-index-phrases-sort-in-blocks}).@refill
2077
2078 @kindex C-c C-i
2079 A useful command is @kbd{C-c C-i} (@code{reftex-index-phrases-info})
2080 which lists information about the phrase at point, including an example
2081 of how the index entry will look like and the number of expected matches
2082 in the document.@refill
2083
2084 @kindex C-c C-t
2085 Another important check is to find out if there are double or
2086 overlapping entries in the buffer. For example if you are first
2087 searching and indexing @samp{Mars} and then @samp{Planet Mars}, the
2088 second 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
2091 the buffer which is either duplicate or a subphrase of another phrase.
2092 In order to check the whole buffer like this, start at the beginning and
2093 execute 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
2101 Once the index phrases have been collected and organized, you are set
2102 for global indexing. I recommend to do this only on an otherwise
2103 finished document. Global indexing starts from the phrases buffer.
2104 There are several commands which start indexing: @kbd{C-c C-x} acts on
2105 the current phrase line, @kbd{C-c C-r} on all lines in the current
2106 region and @kbd{C-c C-a} on all phrase lines in the buffer. It is
2107 probably good to do indexing in small chunks since your concentration
2108 may 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
2111 globally in the whole document. At each match it will stop, compute the
2112 replacement string and offer you the following choices@footnote{Windows
2113 users: 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
2118 Replace this match with the proposed string.
2119 @item n
2120 Skip this match.
2121 @item !
2122 Replace this and all further matches in this file.
2123 @item q
2124 Skip this match, start with next file.
2125 @item Q
2126 Skip this match, start with next phrase.
2127 @item o
2128 Select a different indexing macro for this match.
2129 @item 1-9
2130 Select one of multiple index keys (those separated with @samp{||}).
2131 @item e
2132 Edit the replacement text.
2133 @item C-r
2134 Recursive edit. Use @kbd{M-C-c} to return to the indexing process.
2135 @item s
2136 Save this buffer and ask again about the current match.
2137 @item S
2138 Save all document buffers and ask again about the current match.
2139 @item C-g
2140 Abort the indexing process.
2141 @end table
2142
2143 The @samp{Find and Index in Document} menu in the phrases buffer also
2144 lists a few options for the indexing process. The options have
2145 associated 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
2150 When searching for index phrases, make sure whole words are matched.
2151 This should probably always be on.
2152 @item Case Sensitive Search
2153 Search case sensitively for phrases. I recommend to have this setting
2154 off, in order to match the capitalized words at the beginning of a
2155 sentence, and even typos. You can always say @emph{no} at a match you
2156 do not like.
2157 @item Wrap Long Lines
2158 Inserting index macros increases the line length. Turn this option on
2159 to allow @b{Ref@TeX{}} to wrap long lines.
2160 @item Skip Indexed Matches
2161 When this is on, @b{Ref@TeX{}} will at each match try to figure out if
2162 this match is already indexed. A match is considered indexed if it is
2163 either the argument of an index macro, or if an index macro is directly
2164 (without whitespace separation) before or after the match. Index macros
2165 are those configured in @code{reftex-index-macros}. Intended for
2166 re-indexing a documents after changes have been made.@refill
2167 @end table
2168
2169 Even though indexing should be the last thing you do to a document, you
2170 are bound to make changes afterwards. Indexing then has to be applied
2171 to the changed regions. The command
2172 @code{reftex-index-phrases-apply-to-region} is designed for this
2173 purpose. When called from a LaTeX document with active region, it will
2174 apply @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
1911 @cindex Index entries, creating 2180 @cindex Index entries, creating
1912 @cindex Index, displaying 2181 @cindex Index, displaying
1924 only entries in that part of the document will go into the compiled 2193 only entries in that part of the document will go into the compiled
1925 index. To restrict to the current section, use a numeric prefix 2194 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
1927 region, make the region active and use a numeric prefix @samp{3} (press 2196 region, 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
1929 restriction can be moved from one section to the next with the @kbd{<} 2198 restriction can be moved from one section to the next by pressing the
1930 and @kbd{>} keys.@refill 2199 @kbd{<} and @kbd{>} keys.@refill
1931 2200
1932 One caveat: @b{Ref@TeX{}} finds the definition point of an index entry 2201 One caveat: @b{Ref@TeX{}} finds the definition point of an index entry
1933 by searching near the buffer position where it had found to macro during 2202 by searching near the buffer position where it had found to macro during
1934 scanning. If you have several identical index entries in the same 2203 scanning. If you have several identical index entries in the same
1935 buffer and significant changes have shifted the entries around, you must 2204 buffer and significant changes have shifted the entries around, you must
1971 Go to the definition of the current index entry in another 2240 Go to the definition of the current index entry in another
1972 window.@refill 2241 window.@refill
1973 2242
1974 @item @key{RET} 2243 @item @key{RET}
1975 Go to the definition of the current index entry and hide the 2244 Go 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
1980 @vindex reftex-revisit-to-follow 2249 @vindex reftex-revisit-to-follow
1981 Toggle follow mode. When follow mode is active, the other window will 2250 Toggle follow mode. When follow mode is active, the other window will
2028 @item ^ 2297 @item ^
2029 Remove the highest superordinate entry. If the current entry is a 2298 Remove the highest superordinate entry. If the current entry is a
2030 subitem (@samp{aaa!bbb!ccc}), this function moves it up the hierarchy 2299 subitem (@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 &
2034 Globalize the current entry. This runs a search-and-replace through the
2035 entire document in order to index the same word at other places. Rescan
2036 the document in order to get the new entries into the index buffer. For
2037 details, see the command @code{reftex-index-globally},
2038 @ref{Commands}.@refill
2039
2040 @tablesubheading{Exiting} 2302 @tablesubheading{Exiting}
2041 @item q 2303 @item q
2042 Hide the @file{*Index*} buffer.@refill 2304 Hide the @file{*Index*} buffer.@refill
2043 2305
2044 @item k 2306 @item k
2054 default for this flag can be set with the variable 2316 default for this flag can be set with the variable
2055 @code{reftex-index-include-context}.@refill 2317 @code{reftex-index-include-context}.@refill
2056 2318
2057 @item @} 2319 @item @}
2058 Restrict the index to a single document section. The corresponding 2320 Restrict the index to a single document section. The corresponding
2059 section number will be displayed in the @code{R<>} indication in the 2321 section number will be displayed in the @code{R<>} indicator in the
2060 mode line and in the header of the @file{*Index*} buffer.@refill 2322 mode line and in the header of the @file{*Index*} buffer.@refill
2061 2323
2062 @item @{ 2324 @item @{
2063 Widen the index to contain all entries of the document.@refill 2325 Widen the index to contain all entries of the document.@refill
2064 2326
2102 @cindex LaTeX packages, @code{multind} 2364 @cindex LaTeX packages, @code{multind}
2103 @cindex LaTeX packages, @code{index} 2365 @cindex LaTeX packages, @code{index}
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
2107 also builtin support for the re-implementations of the @code{\index} 2369 also builtin support for the re-implementations of @code{\index}
2108 macro of the @file{multind} and @file{index} packages. However, since 2370 in the @file{multind} and @file{index} packages. However, since
2109 the different definitions of the @code{\index} macro are incompatible, 2371 the different definitions of the @code{\index} macro are incompatible,
2110 you will have to explicitly specify the index style used. 2372 you 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.
2112 2374
2113 @node Defining Index Macros, , Builtin Index Macros, Index Support 2375 @node Defining Index Macros, , Builtin Index Macros, Index Support
2135 is how to make @b{Ref@TeX{}} recognize and correctly interpret these 2397 is how to make @b{Ref@TeX{}} recognize and correctly interpret these
2136 macros, first with Emacs Lisp. 2398 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
2145 Note that the index tag is @samp{idx} for the main index, and 2407 Note that the index tag is @samp{idx} for the main index, and
2146 @samp{name} for the name index. @samp{idx} and @samp{glo} are reserved 2408 @samp{name} for the name index. @samp{idx} and @samp{glo} are reserved
2147 for the default index and for the glossary. 2409 for the default index and for the glossary.
2153 @code{\index}, @code{\index*}, and @code{\glossary} macros, 2415 @code{\index}, @code{\index*}, and @code{\glossary} macros,
2154 respectively. 2416 respectively.
2155 2417
2156 The following string is empty unless your macro adds a superordinate 2418 The following string is empty unless your macro adds a superordinate
2157 entry to the index key - this is the case for the @code{\astobj} macro. 2419 entry to the index key - this is the case for the @code{\astobj} macro.
2420
2421 The next entry can be a hook function to exclude certain matches, it
2422 almost always can be @code{nil}.
2423
2424 The final element in the list indicates if the text being indexed needs
2425 to be repeated outside the macro. For the normal index macros, this
2426 should 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}.
2158 2429
2159 To do the same thing with customize, you need to fill in the templates 2430 To do the same thing with customize, you need to fill in the templates
2160 like this: 2431 like this:
2161 2432
2162 @example 2433 @example
2165 Macro with args: \ix@{*@} 2436 Macro with args: \ix@{*@}
2166 Index Tag : [Value Menu] String: idx 2437 Index Tag : [Value Menu] String: idx
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
2185 With the macro @code{\ix} defined, you may want to change the default 2459 With the macro @code{\ix} defined, you may want to change the default
2186 macro used for indexing a text phrase (@pxref{Creating Index Entries}). 2460 macro used for indexing a text phrase (@pxref{Creating Index Entries}).
2187 This would be done like this 2461 This 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
2193 which specifies that the macro identified with the character @code{?x} (the 2467 which 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
2195 in the buffer with @kbd{C-c /} (@code{reftex-index-selection-or-word}). 2469 in the buffer with @kbd{C-c /} (@code{reftex-index-selection-or-word}).
2196 The index tag is "idx", and the final @code{nil} means that it is not 2470 The index tag is "idx".@refill
2197 necessary to repeat the phrase outside the macro, because the macro
2198 indexes @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
2202 @findex reftex-view-crossref 2474 @findex reftex-view-crossref
2203 @findex reftex-mouse-view-crossref 2475 @findex reftex-mouse-view-crossref
2299 @kindex C-c ) 2571 @kindex C-c )
2300 @kindex C-c [ 2572 @kindex C-c [
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
2307 @kbd{C-c =} @code{reftex-toc} 2581 @kbd{C-c =} @code{reftex-toc}
2308 @kbd{C-c (} @code{reftex-label} 2582 @kbd{C-c (} @code{reftex-label}
2309 @kbd{C-c )} @code{reftex-reference} 2583 @kbd{C-c )} @code{reftex-reference}
2310 @kbd{C-c [} @code{reftex-citation} 2584 @kbd{C-c [} @code{reftex-citation}
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
2317 2593
2318 Note that the @kbd{S-mouse-2} binding is only provided if this key is 2594 Note that the @kbd{S-mouse-2} binding is only provided if this key is
2793 (lambda () 3069 (lambda ()
2794 (LaTeX-add-environments '("proposition" LaTeX-env-label)) 3070 (LaTeX-add-environments '("proposition" LaTeX-env-label))
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
2802 @findex reftex-set-cite-format 3078 @findex reftex-set-cite-format
2803 Similarly, a style hook may contain a call to 3079 Similarly, a style hook may contain a call to
2841 (TeX-add-symbols 3117 (TeX-add-symbols
2842 '("molec" TeX-arg-index) 3118 '("molec" TeX-arg-index)
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
2851 Finally the hook may contain a call to @code{reftex-add-section-levels} 3127 Finally the hook may contain a call to @code{reftex-add-section-levels}
2852 to define additional section statements. For example, the FoilTeX class 3128 to define additional section statements. For example, the FoilTeX class
2866 @cindex @code{bib-cite}, Emacs package 3142 @cindex @code{bib-cite}, Emacs package
2867 @cindex Emacs packages, @code{bib-cite} 3143 @cindex Emacs packages, @code{bib-cite}
2868 3144
2869 Once you have written a document with labels, references and citations, 3145 Once you have written a document with labels, references and citations,
2870 it can be nice to read it like a hypertext document. @b{Ref@TeX{}} has 3146 it can be nice to read it like a hypertext document. @b{Ref@TeX{}} has
2871 some support for that: @code{reftex-view-crossref} (bound to @kbd{C-c 3147 support 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
2874 highlighting is provided (among other things) by Peter S. Galbraith's 3150 highlighting is provided (among other things) by Peter S. Galbraith's
2875 @file{bib-cite.el}. There is some overlap in the functionalities of 3151 @file{bib-cite.el}. There is some overlap in the functionalities of
2876 Bib-cite and @b{Ref@TeX{}}. Bib-cite.el comes bundled with 3152 Bib-cite and @b{Ref@TeX{}}. Bib-cite.el comes bundled with
2982 3258
2983 @lisp 3259 @lisp
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
2992 @noindent 3268 @noindent
2993 The first line is just a normal configuration for a macro. For the 3269 The first line is just a normal configuration for a macro. For the
3066 @uref{http://www.strw.leidenuniv.nl/~dominik/Tools/,maintainers 3342 @uref{http://www.strw.leidenuniv.nl/~dominik/Tools/,maintainers
3067 webpage}. Note that the Emacs 19 version supports many but not all 3343 webpage}. Note that the Emacs 19 version supports many but not all
3068 features described in this manual.@refill 3344 features described in this manual.@refill
3069 3345
3070 Thanks to the people on the Net who have used @b{Ref@TeX{}} and helped 3346 Thanks to the people on the Net who have used @b{Ref@TeX{}} and helped
3071 developing it with their reports. In particular thanks to 3347 developing it with their reports. In particular thanks to @i{Fran
3072 @i{Fran Burstall, Alastair Burt, Soren Dayton, Stephen Eglen, Karl 3348 Burstall, Alastair Burt, Soren Dayton, Stephen Eglen, Karl Eichwalder,
3073 Eichwalder, Peter Galbraith, Kai Grossjohann, Dieter Kraft, Adrian Lanz, 3349 Peter Galbraith, Kai Grossjohann, Frank Harrell, Dieter Kraft, Adrian
3074 Rory Molinari, Stefan Monnier, Laurent Mugnier, Sudeep Kumar Palat, 3350 Lanz, Rory Molinari, Stefan Monnier, Laurent Mugnier, Sudeep Kumar
3075 Daniel Polani, Robin Socha, Richard Stanton, Allan Strand, Jan Vroonhof, 3351 Palat, Daniel Polani, Robin Socha, Richard Stanton, Allan Strand, Jan
3076 Christoph Wedler, Alan Williams}.@refill 3352 Vroonhof, Christoph Wedler, Alan Williams}.@refill
3077 3353
3078 The @code{view-crossref} feature was inspired by @i{Peter Galbraith's} 3354 The @code{view-crossref} feature was inspired by @i{Peter Galbraith's}
3079 @file{bib-cite.el}.@refill 3355 @file{bib-cite.el}.@refill
3080 3356
3081 Finally thanks to @i{Uwe Bolick} who first got me (some years ago) into 3357 Finally thanks to @i{Uwe Bolick} who first got me (some years ago) into
3084 3360
3085 @node Commands, Options, Imprint, Top 3361 @node Commands, Options, Imprint, Top
3086 @chapter Commands 3362 @chapter Commands
3087 @cindex Commands, list of 3363 @cindex Commands, list of
3088 3364
3089 Here is a summary of @b{Ref@TeX{}}'s commands. All commands are available 3365 Here is a summary of @b{Ref@TeX{}}'s commands which can be executed from
3090 from the @code{Ref} menu. For keybindings, @pxref{Keybindings}. 3366 LaTeX files. Command which are executed from the special buffers are
3367 not described here. All commands are available from the @code{Ref}
3368 menu. For keybindings, @pxref{Keybindings}.
3091 3369
3092 @deffn Command reftex-toc 3370 @deffn Command reftex-toc
3093 Show the table of contents for the current document. When called with 3371 Show the table of contents for the current document. When called with
3094 one ore two @kbd{C-u} prefixes, rescan the document first.@refill 3372 one ore two @kbd{C-u} prefixes, rescan the document first.@refill
3095 @end deffn 3373 @end deffn
3141 called inside TeX math mode as determined by the @file{texmathp.el} 3419 called inside TeX math mode as determined by the @file{texmathp.el}
3142 library which is part of AUCTeX, the string is first processed with the 3420 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
3425 Add current selection or the word at point to the phrases buffer.
3426 When you are in transient-mark-mode and the region is active, the
3427 selection will be used - otherwise the word at point.
3428 You get a chance to edit the entry in the phrases buffer - to save the
3429 buffer 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
3433 Switch to the phrases buffer, initialize if empty.
3434 @end deffn
3435
3436 @deffn Command reftex-index-phrases-apply-to-region
3437 Index all index phrases in the current region.
3438 This works exactly like global indexing from the index phrases buffer,
3439 but operation is restricted to the current region.
3440 @end deffn
3441
3146 @deffn Command reftex-display-index 3442 @deffn Command reftex-display-index
3147 Display a buffer with an index compiled from the current document. 3443 Display a buffer with an index compiled from the current document.
3148 When the document has multiple indices, first prompts for the correct one. 3444 When the document has multiple indices, first prompts for the correct one.
3149 When index support is turned off, offer to turn it on. 3445 When index support is turned off, offer to turn it on.
3150 With one or two @kbd{C-u} prefixes, rescan document first. 3446 With one or two @kbd{C-u} prefixes, rescan document first.
3151 With prefix 2, restrict index to current document section. 3447 With prefix 2, restrict index to current document section.
3152 With prefix 3, restrict index to active region.@refill 3448 With prefix 3, restrict index to active region.@refill
3153 @end deffn
3154
3155 @deffn Command reftex-index-globally
3156 Index a word with a global search and replace. This works very much
3157 like @code{reftex-query-replace-document}, but the defaults for the
3158 search and replace strings are derived from local context. When there
3159 is an index entry, we try to index similar words. The word to search
3160 for 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
3163 use the the index key. The replacement text is the index macro with all
3164 its arguments and the attached word. When there is no index entry at
3165 point, we search for the word near point and propose to index it like
3166 this: @samp{\index@{@var{word}@}@var{word}}. You get a chance to edit
3167 the search and replacement strings.@refill
3168 @end deffn 3449 @end deffn
3169 3450
3170 @deffn Command reftex-view-crossref 3451 @deffn Command reftex-view-crossref
3171 View cross reference of macro at point. Point must be on the @var{key} 3452 View cross reference of macro at point. Point must be on the @var{key}
3172 argument. Works with the macros @code{\label}, @code{\ref}, 3453 argument. Works with the macros @code{\label}, @code{\ref},
3276 @node Options (Table of Contents), Options (Defining Label Environments), , Options 3557 @node Options (Table of Contents), Options (Defining Label Environments), , Options
3277 @section Table of Contents 3558 @section Table of Contents
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
3563 The maximum level of toc entries which will be included in the TOC.
3564 Section headings with a bigger level will be ignored. In RefTeX,
3565 chapters are level 1, sections level 2 etc. This variable can be
3566 changed 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
3282 Non-@code{nil} means, split the selected window to display the 3570 Non-@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
3284 makes the @file{*toc*} small. When @code{nil}, all other windows except 3572 makes the @file{*toc*} small. When @code{nil}, all other windows except
3285 the selected one will be deleted, so that the @file{*toc*} window fills 3573 the selected one will be deleted, so that the @file{*toc*} window fills
3350 The value of the variable must be a list of items. Each item is a list 3638 The value of the variable must be a list of items. Each item is a list
3351 itself and has the following structure: 3639 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
3358 Each list entry describes either an environment carrying a counter for 3646 Each list entry describes either an environment carrying a counter for
3359 use with @code{\label} and @code{\ref}, or a LaTeX macro defining a 3647 use with @code{\label} and @code{\ref}, or a LaTeX macro defining a
3360 label as (or inside) one of its arguments. The elements of each list 3648 label as (or inside) one of its arguments. The elements of each list
3476 List of magic words which identify a reference to be of this type. If 3764 List of magic words which identify a reference to be of this type. If
3477 the word before point is equal to one of these words when calling 3765 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
3479 restricted to labels of the correct type. If the first element of this 3767 restricted to labels of the correct type. If the first element of this
3480 word--list is the symbol `regexp', the strings are interpreted as regular 3768 word--list is the symbol `regexp', the strings are interpreted as regular
3481 expressions@footnote{Careful: @b{Ref@TeX{}} will add stuff to the 3769 expressions.@refill
3482 beginning and end of these regular expressions.}.@refill 3770
3771 @item @var{toc-level}
3772 The integer level at which this environment should be added to the table
3773 of contents. See also @code{reftex-section-levels}. A positive value
3774 will number the entries mixed with the sectioning commands of the same
3775 level. A negative value will make unnumbered entries. Useful only for
3776 theorem-like environments which structure the document. Will be ignored
3777 for macros. When omitted or @code{nil}, no TOC entries will be
3778 made.@refill
3483 @end table 3779 @end table
3484 3780
3485 If the type indicator characters of two or more entries are the same, 3781 If the type indicator characters of two or more entries are the same,
3486 @b{Ref@TeX{}} will use@refill 3782 @b{Ref@TeX{}} will use@refill
3487 @itemize @minus 3783 @itemize @minus
3505 @defopt reftex-section-levels 3801 @defopt reftex-section-levels
3506 Commands and levels used for defining sections in the document. The 3802 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
3509 same as the positive value, but the section will never get a 3805 same as the positive value, but the section will never get a
3510 number. The @code{cdr} amy also be a function which then has to return 3806 number. The @code{cdr} may also be a function which then has to return
3511 the level.@refill 3807 the level.@refill
3512 @end defopt 3808 @end defopt
3513 3809
3514 @defopt reftex-section-prefixes 3810 @defopt reftex-section-prefixes
3515 Prefixes for section labels. When the label prefix given in an entry in 3811 Prefixes for section labels. When the label prefix given in an entry in
3921 4217
3922 @defopt reftex-index-macros 4218 @defopt reftex-index-macros
3923 List of macros which define index entries. The structure of each entry 4219 List of macros which define index entries. The structure of each entry
3924 is 4220 is
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,
3930 as for example in @samp{\index[]@{*@}}. Use square brackets to denote 4226 as for example in @samp{\index[]@{*@}}. Use square brackets to denote
3931 optional arguments. The star marks where the index key is.@refill 4227 optional arguments. The star marks where the index key is.@refill
3946 4242
3947 @var{exclude} can be a function. If this function exists and returns a 4243 @var{exclude} can be a function. If this function exists and returns a
3948 non-nil value, the index entry at point is ignored. This was 4244 non-nil value, the index entry at point is ignored. This was
3949 implemented to support the (deprecated) @samp{^} and @samp{_} shortcuts 4245 implemented to support the (deprecated) @samp{^} and @samp{_} shortcuts
3950 in the LaTeX2e @code{index} package.@refill 4246 in the LaTeX2e @code{index} package.@refill
4247
4248 @var{repeat}, if non-@code{nil}, means the index macro does not typeset
4249 the entry in the text, so that the text has to be repeated outside the
4250 index macro. Needed for @code{reftex-index-selection-or-word} and for
4251 indexing from the phrase buffer.@refill
3951 4252
3952 The final entry may also be a symbol. It must have an association in 4253 The final entry may also be a symbol. It must have an association in
3953 the variable @code{reftex-index-macros-builtin} to specify the main 4254 the variable @code{reftex-index-macros-builtin} to specify the main
3954 indexing package you are using. Legal values are currently@refill 4255 indexing package you are using. Legal values are currently@refill
3955 @example 4256 @example
3964 package here. 4265 package here.
3965 @end defopt 4266 @end defopt
3966 4267
3967 @defopt reftex-index-default-macro 4268 @defopt reftex-index-default-macro
3968 The default index macro for @code{reftex-index-selection-or-word}. 4269 The default index macro for @code{reftex-index-selection-or-word}.
3969 This is a list with @code{(@var{macro-key} @var{default-tag} @var{repeat-word})}. 4270 This 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}.
3973 4274
3974 @var{default-tag} is the tag to be used if the macro requires a 4275 @var{default-tag} is the tag to be used if the macro requires a
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
3977 TAG argument of the index macro is optional, the TAG argument will be 4278 TAG argument of the index macro is optional, the TAG argument will be
3978 omitted. 4279 omitted.@refill
3979
3980 @var{repeat-word}, when non-@code{nil} means, the index macro does not
3981 typeset the entry in the text, so that the text has to be repeated
3982 outside the index macro.
3983 @end defopt 4280 @end defopt
3984 4281
3985 @defopt reftex-index-default-tag 4282 @defopt reftex-index-default-tag
3986 Default index tag. When working with multiple indexes, RefTeX queries 4283 Default index tag. When working with multiple indexes, RefTeX queries
3987 for an index tag when creating index entries or displaying a specific 4284 for an index tag when creating index entries or displaying a specific
4002 string through the @code{format} function. This can be used to add the 4299 string through the @code{format} function. This can be used to add the
4003 math delimiters (e.g. @samp{$}) to the string. Requires the 4300 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
4305 Regexp matching the @samp{and} operator for index arguments in phrases
4306 file. When several index arguments in a phrase line are separated by
4307 this operator, each part will generate an index macro. So each match of
4308 the search phrase will produce @emph{several} different index entries.
4309 Make sure this does no match things which are not separators. This
4310 logical @samp{and} has higher priority than the logical @samp{or}
4311 specified in @code{reftex-index-phrases-logical-or-regexp}.@refill
4312 @end defopt
4313
4314 @defopt reftex-index-phrases-logical-or-regexp
4315 Regexp matching the @samp{or} operator for index arguments in phrases
4316 file. When several index arguments in a phrase line are separated by
4317 this operator, the user will be asked to select one of them at each
4318 match of the search phrase. The first index arg will be the default. A
4319 number key @kbd{1}--@kbd{9} must be pressed to switch to another. Make
4320 sure this does no match things which are not separators. The logical
4321 @samp{and} specified in @code{reftex-index-phrases-logical-or-regexp}
4322 has higher priority than this logical @samp{or}.@refill
4323 @end defopt
4324
4325 @defopt reftex-index-phrases-search-whole-words
4326 Non-@code{nil} means phrases search will look for whole words, not subwords.
4327 This works by requiring word boundaries at the beginning and end of
4328 the search string. When the search phrase already has a non-word-char
4329 at one of these points, no word boundary is required there.
4330 @end defopt
4331
4332 @defopt reftex-index-phrases-case-fold-search
4333 Non-@code{nil} means, searching for index phrases will ignore
4334 case.@refill
4335 @end defopt
4336
4337 @defopt reftex-index-phrases-skip-indexed-matches
4338 Non-@code{nil} means, skip matches which appear to be indexed already.
4339 When doing global indexing from the phrases buffer, searches for some
4340 phrases may match at places where that phrase was already indexed. In
4341 particular when indexing an already processed document again, this
4342 will 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
4344 index macro is directly before or after the phrase. If that is the
4345 case, that match will be ignored.@refill
4346 @end defopt
4347
4348 @defopt reftex-index-phrases-wrap-long-lines
4349 Non-@code{nil} means, when indexing from the phrases buffer, wrap lines.
4350 Inserting indexing commands in a line makes the line longer - often
4351 so long that it does not fit onto the screen. When this variable is
4352 non-@code{nil}, newlines will be added as necessary before and/or after the
4353 indexing command to keep lines short. However, the matched text
4354 phrase 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
4358 Non-@code{nil} means when sorting phrase lines, the explicit index entry
4359 is used. Phrase lines in the phrases buffer contain a search phrase, and
4360 sorting is normally based on these. Some phrase lines also have
4361 an explicit index argument specified. When this variable is
4362 non-@code{nil}, the index argument will be used for sorting.@refill
4363 @end defopt
4364
4365 @defopt reftex-index-phrases-sort-in-blocks
4366 Non-@code{nil} means, empty and comment lines separate phrase buffer
4367 into blocks. Sorting will then preserve blocks, so that lines are
4368 re-arranged only within blocks.
4369 @end defopt
4370
4371 @defopt reftex-index-phrases-map
4372 Keymap for the Index Phrases buffer.
4373 @end defopt
4374
4375 @defopt reftex-index-phrases-mode-hook
4376 Normal 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
4008 The letters which denote sections in the index. Usually these are all 4381 The letters which denote sections in the index. Usually these are all
4009 capital letters. Don't use any downcase letters. Order is not 4382 capital letters. Don't use any downcase letters. Order is not
4010 significant, the index will be sorted by whatever the sort function 4383 significant, the index will be sorted by whatever the sort function
4011 thinks is correct. In addition to these letters, RefTeX will create a 4384 thinks is correct. In addition to these letters, @b{Ref@TeX{}} will
4012 group @samp{!} which contains all entries sorted below the lowest 4385 create a group @samp{!} which contains all entries sorted below the
4013 specified letter. In the @file{*Index*} buffer, pressing any of these 4386 lowest specified letter. In the @file{*Index*} buffer, pressing any of
4014 capital letters or @kbd{!} will jump to that section.@refill 4387 these 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
4018 Non-@code{nil} means, display the index definition context in the 4391 Non-@code{nil} means, display the index definition context in the
4019 @file{*Index*} buffer. This flag may also be toggled from the 4392 @file{*Index*} buffer. This flag may also be toggled from the
4443 4816
4444 @deffn {Normal Hook} reftex-mode-hook 4817 @deffn {Normal Hook} reftex-mode-hook
4445 Normal hook which is being run when turning on @b{Ref@TeX{}} mode.@refill 4818 Normal hook which is being run when turning on @b{Ref@TeX{}} mode.@refill
4446 @end deffn 4819 @end deffn
4447 4820
4448 Furthermore, the 3 modes used for referencing labels, creating citations 4821 Furthermore, the 4 modes used for referencing labels, creating
4449 and for the table of contents buffer have their own keymaps and mode 4822 citations, the table of contents buffer and the phrases buffer have
4450 hooks. See the respective sections. There are many more hooks which 4823 their own keymaps and mode hooks. See the respective sections. There
4451 are described in the relevant sections about options for a specific part 4824 are many more hooks which are described in the relevant sections about
4452 of @b{Ref@TeX{}}.@refill 4825 options 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
4456 @cindex Changes 4829 @cindex Changes
4457 4830
4901 @code{reftex-search-unrecursed-path-first}. 5274 @code{reftex-search-unrecursed-path-first}.
4902 @item 5275 @item
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
4910 File search further refined. New option @code{reftex-file-extensions}. 5282 File search further refined. New option @code{reftex-file-extensions}.
4911 @item 5283 @item
4930 Files in @code{reftex-default-bibliography} will be searched along 5302 Files in @code{reftex-default-bibliography} will be searched along
4931 @code{BIBINPUTS} path.@refill 5303 @code{BIBINPUTS} path.@refill
4932 @item 5304 @item
4933 Reading a parse file now checks consistency. 5305 Reading 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
4938 RefTeX has been split into several smaller files which are autoloaded on 5311 RefTeX has been split into several smaller files which are autoloaded on
4939 demand. 5312 demand.
4978 @code{reftex-section-levels} can contain a function to compute the level 5351 @code{reftex-section-levels} can contain a function to compute the level
4979 of a sectioning command. 5352 of a sectioning command.
4980 @item 5353 @item
4981 Multiple @code{thebibliography} environments recognized. 5354 Multiple @code{thebibliography} environments recognized.
4982 @end itemize 5355 @end itemize
4983 5356 @noindent @b{Version 4.09}
5357 @itemize @bullet
5358 @item
5359 New option @code{reftex-toc-max-level} to limit the depth of the toc.
5360 New keybinding @kbd{t} in the @file{*toc*} buffer to change this
5361 setting.@refill
5362 @item
5363 RefTeX maintaines an @file{Index Phrases} file in which phrases can be
5364 collected. When the document is ready, RefTeX can search all
5365 these phrases and assist indexing all matches.@refill
5366 @item
5367 The variables @code{reftex-index-macros} and
5368 @code{reftex-index-default-macro} have changed their syntax slightly.
5369 The @var{repeat} parameter has move from the latter to the former.
5370 Also calls to @code{reftex-add-index-macros} from AUCTeX style files
5371 need to be adapted.@refill
5372 @item
5373 The variable @code{reftex-section-levels} no longer contains the
5374 default stuff which has been moved to a constant.@refill
5375 @item
5376 Environments like theorems can be placed into the TOC by putting
5377 entries 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
4987 @printindex cp 5383 @printindex cp
4988 5384