[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Behaviour of reftex-view-crossref

From: Arash Esbati
Subject: Re: Behaviour of reftex-view-crossref
Date: Fri, 22 Sep 2023 14:45:00 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

J. Xu <> writes:

> reftex-view-crossref currently only finds reference to the current space
> delineated word.  For example, if I'm at (* being the point)
> \ref{foo *bar}
> and run reftex-view-crossref, it would find the definition of "bar"
> instead of "foo bar".
> I wonder if this behaviour is intended?

Yes, this is the intended behavior in terms of "this is what the code
does": `reftex-view-crossref' starts like this:

(defun reftex-view-crossref (&optional arg auto-how fail-quietly)
  (interactive "P")
  ;; See where we are.
  (let* ((macro (car (reftex-what-macro-safe 1)))
         (key (reftex-this-word "^{}%\n\r, \t"))

The label key is extracted by `reftex-this-word' which is asked to
ignore spaces with "^{}%\n\r, \t".  I'm not sure if spaces were always
allowed in labels, but they are by now (also other characters besides
ASCII, IIRC).  So we probably should fix this and allow spaces.  But
then we have to know what LaTeX does with linebreaks inside the \label
argument, i.e.:


I haven't tested this.  Is LaTeX's behavior in this regard documented

And if we touch this, we should also change `reftex-label-illegal-re'.

Personally, I recommend to use only this range [-a-zA-Z0-9_+=:;,.] for
label names and be done with it.

Best, Arash

reply via email to

[Prev in Thread] Current Thread [Next in Thread]