[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. Table of Contents

Pressing the keys C-c = pops up a buffer showing the table of contents of the document. By default, this `*toc*' buffer shows only the sections of a document. Using the l and i keys you can display all labels and index entries defined in the document as well.

With the cursor in any of the lines denoting a location in the document, simple key strokes will display the corresponding part in another window, jump to that location, or perform other actions.

Here is a list of special commands in the `*toc*' buffer. A summary of this information is always available by pressing ?.

General

  • General
  • ? Display a summary of commands.

  • 0-9, - Prefix argument.

    Moving around

  • Moving around
  • n Goto next entry in the table of context.

  • p Goto previous entry in the table of context.

  • C-c C-n Goto next section heading. Useful when many labels and index entries separate section headings.

  • C-c C-p Goto previous section heading.

  • N z Jump to section N, using the prefix arg. For example, 3 z jumps to section 3.

    Access to document locations

  • Access to document locations
  • SPC Show the corresponding location in another window. This command does not select that other window.

  • TAB Goto the location in another window.

  • RET Go to the location and hide the `*toc*' buffer. This will restore the window configuration before reftex-toc (C-c =) was called.

  • mouse-2 Clicking with mouse button 2 on a line has the same effect as RET. See also variable reftex-highlight-selection, 8.10 Fontification.

  • f Toggle follow mode. When follow mode is active, the other window will always show the location corresponding to the line at point in the `*toc*' buffer. This is similar to pressing SPC after each cursor motion. The default for this flag can be set with the variable reftex-toc-follow-mode. Note that only context in files already visited is shown. RefTeX will not visit a file just for follow mode. See, however, the variable reftex-revisit-to-follow.

  • . Show calling point in another window. This is the point from where reftex-toc was last called.

    Exiting

  • Exiting
  • q Hide the `*toc*' buffer, return to the position where reftex-toc was last called.

  • k Kill the `*toc*' buffer, return to the position where reftex-toc was last called.

  • C-c > Switch to the `*Index*' buffer of this document. With prefix `2', restrict the index to the section at point in the `*toc*' buffer.

    Controlling what gets displayed

  • Controlling what gets displayed

  • t Change the maximum level of toc entries displayed in the `*toc*' buffer. Without prefix arg, all levels will be included. With prefix arg (e.g 3 t), ignore all toc entries with level greater than arg (3 in this case). Chapters are level 1, sections are level 2. The mode line `T<>' indicator shows the current value. The default depth can be configured with the variable reftex-toc-max-level.

  • F Toggle the display of the file borders of a multifile document in the `*toc*' buffer. The default for this flag can be set with the variable reftex-toc-include-file-boundaries.

  • l Toggle the display of labels in the `*toc*' buffer. The default for this flag can be set with the variable reftex-toc-include-labels. When called with a prefix argument, RefTeX will prompt for a label type and include only labels of the selected type in the `*toc*' buffer. The mode line `L<>' indicator shows which labels are included.

  • i Toggle the display of index entries in the `*toc*' buffer. The default for this flag can be set with the variable reftex-toc-include-index-entries. When called with a prefix argument, RefTeX will prompt for a specific index and include only entries in the selected index in the `*toc*' buffer. The mode line `I<>' indicator shows which index is used.

  • c Toggle the display of label and index context in the `*toc*' buffer. The default for this flag can be set with the variable reftex-toc-include-context.

    Updating the buffer

  • Updating the buffer

  • g Rebuild the `*toc*' buffer. This does not rescan the document.

  • r Reparse the LaTeX document and rebuild the `*toc*' buffer. When reftex-enable-partial-scans is non-nil, rescan only the file this location is defined in, not the entire document.

  • C-u r Reparse the entire LaTeX document and rebuild the `*toc*' buffer.

  • x Switch to the `*toc*' buffer of an external document. When the current document is using the xr package (see section 3.6 xr: Cross-Document References), RefTeX will switch to one of the external documents.

  • a Toggle the automatic recentering of the `*toc*' buffer. When this option is on, moving around in the document will cause the `*toc*' to always highlight the current section. This can be enabled by default with the variable reftex-auto-recenter-toc.

  • In order to define additional commands for the `*toc*' buffer, the keymap reftex-toc-map may be used.

    If you call reftex-toc while the `*toc*' buffer already exists, the cursor will immediately jump to the right place, i.e. the section from which reftex-toc was called will be highlighted. The command C-c - (reftex-toc-recenter) will only redisplay the `*toc*' buffer and highlight the correct line without actually selecting the `*toc*' window. This can be useful to quickly find out where in the document you currently are. If you want the TOC buffer to show the current section automatically whenever you stop typing, try
     
    (setq reftex-auto-recenter-toc t)
    
    When this is turned on, the toc buffer will be recentered whenever Emacs is idle for more than reftex-idle-time seconds.

    The section macros recognized by RefTeX are all LaTeX section macros (from \part to \subsubparagraph) and the commands \addchap and \addsec from the KOMA-Script classes. Additional macros can be configured with the variable reftex-section-levels. It is also possible to add certain LaTeX environments to the table of contents. This is probably only useful for theorem-like environments. See section 3.4 Defining Label Environments, for an example.


    [ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

    This document was generated on March, 16 2003 using texi2html