Skip to content

Problems and Work-arounds

  • LaTeX commands\input, \include, and \section (etc.) statements have to be first on a line (except for white space).

  • Commented regions RefTeX sees also labels in regions commented out and will refuse to make duplicates of such labels. This is considered to be a feature.

  • Wrong section numbers When using partial scans (reftex-enable-partial-scans), the section numbers in the table of contents may eventually become wrong. A full scan will fix this.

  • Local settings The label environment definitions in reftex-label-alist are global and apply to all documents. If you need to make definitions local to a document, because they would interfere with settings in other documents, you should use AUCTeX and set up style files with calls to reftex-add-label-environments, reftex-set-cite-format, reftex-add-index-macros, and reftex-add-section-levels. Settings made with these functions remain local to the current document. See AUCTeX.

  • Funny display in selection buffer

    When using packages which make the buffer representation of a file different from its disk representation (e.g., x-symbol, isotex, iso-cvt) you may find that RefTeX’s parsing information sometimes reflects the disk state of a file. This happens only in unvisited parts of a multifile document, because RefTeX visits these files literally for speed reasons. Then both short context and section headings may look different from what you usually see on your screen. In rare cases reftex-toc may have problems to jump to an affected section heading. There are three possible ways to deal with this:

    • (setq reftex-keep-temporary-buffers t)
      This implies that RefTeX will load all parts of a multifile document into Emacs (i.e., there won’t be any temporary buffers).
    • (setq reftex-initialize-temporary-buffers t)
      This means full initialization of temporary buffers. It involves a penalty when the same unvisited file is used for lookup often.
    • Set reftex-initialize-temporary-buffers to a list of hook functions doing a minimal initialization.

    See also the variable reftex-refontify-context.

  • Labels as arguments to \begin

    Some packages use an additional argument to a \begin macro to specify a label. E.g., Lamport’s pf.sty uses both

    latex
    \step{label}{claim}   and      \begin{step+}{label}
                                      claim
                                   \end{step+}

    We need to trick RefTeX into swallowing this:

    emacs-lisp
    ;; Configuration for Lamport's pf.sty
    (setq reftex-label-alist
      '(("\\step{*}{}"       ?p "st:" "~\\stepref{%s}" 2 ("Step" "St."))
        ("\\begin{step+}{*}" ?p "st:" "~\\stepref{%s}" 1000)))

    The first line is just a normal configuration for a macro. For the step+ environment we actually tell RefTeX to look for the macro\begin{step+}’ and interpret the first argument (which really is a second argument to the macro \begin) as a label of type ?p. Argument count for this macro starts only after the ‘{step+}’, also when specifying how to get context.