Discussion:
label completion in the \ref auctex macro
Daniel Schmitt
2005-03-15 14:46:58 UTC
Permalink
Using the auctex macro \ref I would excpect that the key completion
using TAB to offer all labels in the current document.

For example starting from this document:
\documentclass[a4paper]{article}

\begin{document}
\begin{figure}
dfdsj
\caption{eins}
\label{fig:eins}
\end{figure}
\end{document}

using copy and paste:
\documentclass[a4paper]{article}

\begin{document}
\begin{figure}
dfdsj
\caption{eins}
\label{fig:eins}
\end{figure}

\begin{figure}
dfdsj
\caption{zwei}
\label{fig:zwei}
\end{figure}

\end{document}

Now, fig:zwei is not offered in the completion list.

Emacs : GNU Emacs 22.0.50.36 (x86_64-unknown-linux-gnu, GTK+ Version 2.4.9)
of 2005-03-15 on bridgekeeper
Package: AUCTeX CVS-5.489 (2005-03-15)

current state:
==============
(setq
window-system 'x
LaTeX-version "2e"
TeX-style-path '("style/" "auto/" "/home/dept/scht/.TeX/style/"
"/usr/share/doc/.TeX/style/" "/usr/doc/.TeX/style/"
"/home/dept/scht/.TeX/style/" "/usr/share/doc/.TeX/style/"
"/usr/doc/.TeX/style/" "/home/dept/scht/.TeX/auto/"
"/usr/share/doc/.TeX/auto/" "/usr/doc/.TeX/auto/"
"/home/dept/scht/.TeX/auto/" "/usr/share/doc/.TeX/auto/"
"/usr/doc/.TeX/auto/"
"/import/xtra/emacs/RC/share/emacs/site-lisp/auctex/style/"
"/usr/local/share/emacs/site-lisp/auctex/auto/")
TeX-auto-save t
TeX-parse-self t
TeX-master nil
)
David Kastrup
2005-03-15 15:21:22 UTC
Permalink
Post by Daniel Schmitt
Using the auctex macro \ref I would excpect that the key completion
using TAB to offer all labels in the current document.
\documentclass[a4paper]{article}
\begin{document}
\begin{figure}
dfdsj
\caption{eins}
\label{fig:eins}
\end{figure}
\end{document}
\documentclass[a4paper]{article}
\begin{document}
\begin{figure}
dfdsj
\caption{eins}
\label{fig:eins}
\end{figure}
\begin{figure}
dfdsj
\caption{zwei}
\label{fig:zwei}
\end{figure}
\end{document}
Now, fig:zwei is not offered in the completion list.
Labels that you did not let RefTeX insert itself become known to it
only when reparsing the document. Use the menu "Ref/Parse Document".
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Reiner Steib
2005-03-15 16:03:13 UTC
Permalink
Post by David Kastrup
Post by Daniel Schmitt
Using the auctex macro \ref I would excpect that the key completion
using TAB to offer all labels in the current document.
[...]
Post by David Kastrup
Post by Daniel Schmitt
Now, fig:zwei is not offered in the completion list.
Labels that you did not let RefTeX insert itself become known to it
only when reparsing the document. Use the menu "Ref/Parse Document".
Daniel didn't use any RefTeX command, but he used `C-x RET \ref RET'.
After C&P, `M-: (LaTeX-label-list) RET' only shows fig:eins.
After `C-c C-n' (<LaTeX> <Multifile/Parsing> <Reset Buffer> /
TeX-normal-mode), `M-: (LaTeX-label-list) RET' shows the updated list.

As an end user not familiar with AUCTeX's internals, Daniel expected
that AUCTeX might know about the labels after running LaTeX on the
document. Is `C-c C-n' the best way to deal with this problem?

Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
Ralf Angeli
2005-03-15 17:38:04 UTC
Permalink
Post by Reiner Steib
Daniel didn't use any RefTeX command, but he used `C-x RET \ref RET'.
After C&P, `M-: (LaTeX-label-list) RET' only shows fig:eins.
After `C-c C-n' (<LaTeX> <Multifile/Parsing> <Reset Buffer> /
TeX-normal-mode), `M-: (LaTeX-label-list) RET' shows the updated list.
As an end user not familiar with AUCTeX's internals, Daniel expected
that AUCTeX might know about the labels after running LaTeX on the
document. Is `C-c C-n' the best way to deal with this problem?
Probably yes. I don't think it would be a good idea to search the
whole file for labels every time a new reference is about to be added.
This could become very annoying in larger files.
--
Ralf
Loading...