* JohnnyK (2007-02-06) writes:
> I'm trying to reference definitions, theorems etc. using RefTeX. I added
> entries for my various theorem types to my reftex-label-alist. I looks like
> this:
>
> '(reftex-label-alist (quote (
> ("satz" 97 "satz:" "~\\ref{%s}" 1 ("Satz" "Theorem") -3)
> ("korollar" 107 "kor:" "~\\ref{%s}" 1 ("Korollar") -3)
> ("definition" 100 "def:" "~\\ref{%s}" 1 ("Definition" "Def.")-3)
> ("lemma" 108 "lem:" "~\\ref{%s}" 1 nil -3)))))
>
> Adding labels works perfectly. If I specify an additional parameter to the
> theorem environment, e.g. something like "\begin{definition}[useful
> definition]...", it takes the text for the label from the additional
> parameter, else it takes it from the first sentence of the body of the
> environment.
> The problem arises when I try to reference the labels. Only the labels of
> environments without an additional parameter are selectable in the TOC that
> comes up, when I insert an reference. The others appear in the list, but
> aren't selectable (just as if there wasn't a label). How can I get labels in
> environments like "\begin{definition}[useful definition]..." to be
> selectable in the TOC?
Which version of RefTeX and Emacs are you using?
I checked with the attached file and a relatively recent CVS Emacs
which I called like this
emacs -Q -eval '(progn (load "auctex.el" nil t t) (add-hook (quote
LaTeX-mode-hook) (quote turn-on-reftex)) (setq reftex-plug-into-AUCTeX t))'
file.tex
and it worked, i.e. both entries were selectable when trying to create
a reference with `C-c )'. When opening the file make sure that the
form in the local variables stanza is being evaluated. Otherwise the
`satz' environment won't be added to `reftex-label-alist'.
--
Ralf
\documentclass{article}
\begin{document}
\begin{satz}
\label{satz:1}
\end{satz}
\begin{satz}[foo]
\label{satz:2}
\end{satz}
foo
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% eval: (add-to-list 'reftex-label-alist '("satz" 97 "satz:" "~\\ref{%s}" 1 ("Satz" "Theorem") -3))
%%% End:
_______________________________________________
auctex mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/auctex