auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] reftex patch to support resolved labels


From: Tim Toolan
Subject: Re: [AUCTeX-devel] reftex patch to support resolved labels
Date: Mon, 01 Dec 2008 07:13:36 -0500
User-agent: Internet Messaging Program (IMP) H3 (4.3)

Quoting Ralf Angeli <address@hidden>:

* Tim Toolan (2008-10-27) writes:

Quoting "Ralf Angeli" <address@hidden>:

This looks like an interesting feature.  Something like that might also
be useful when displaying labels in the table of contents (`C-c =').

It could be useful there, but one thing to consider is that labels are
not "required" for anything, and the only things that can be resolved
are things that have a label.  For instance, if there is a section 3,
but it is not referenced in the document, and the writer decided not
to label it, there will be no resolved label for it.

The TOC usually does not show labels, only if you type <l>.  That's
what I was referring to.

While the display of typeset label numbers might be a good hint when
trying to identify the right label, I think the primary way to select
them should still be based on labels as they are written in the LaTeX
sources.  First, a user should not be required to run LaTeX or look at
the typeset document to identify a label,

True.  Maybe when the .aux files are not present, instead of
presenting question marks for all labels, it should not display
anything at all.

That's also what I'd prefer.

second, the label name in the
sources often carries more information than the typeset one and

That is true, but I am thinking of how I write, and when I reference
an equation, I am almost always looking at in the typeset document,
and my mind says something like
   "combining (17) and (18), we get"
instead of
   "combining (\ref{eq:blah1}) and (\ref{eq:blah2}), we get".

This doesn't address my argument. (c:  If you didn't select a specific
label type when making a reference with RefTeX, then "17" could relate
to a section, an equation, a figure, etc.  The prefix of the label in
the LaTeX source and a descriptive name (if present) of the label make
it much easier to identify the right one.

Anyway, I think we are in agreement that both use cases (referencing by
source and by typeset labels) are valid ones.

third,
the selection from a list (<n>, <p>, <RET> or point and click) is mostly
more convenient than having to type a string with completion.  (The
latter argument is obviously subjective and represents my personal
preference.)  In the label selection process at it is now one can
activate a prompt for typing a label name with completion by pressing
<TAB>.  One could either allow completion on typeset labels here as well
or provide a key to activate a dedicated prompt for asking for the
typeset label name.

That is actually exactly how the patch behaves if
`reftex-ref-start-in-filter-mode' is set to nil.

Oh, perhaps I should try that. (c:

The patch also contained some changes where I am not sure if they are
necessary or good, like commented `message' calls or `defvar' statements
to silence the byte compiler.  But before talking about those (and me
looking deeper into the code) we should agree on the user interface.

I agree about the defvar statements.  I saw in reftex-sel.el that the
same thing was done for the same reason, so I duplicated it, but it
was probably a bad idea.

Yeah, it's likely better to either use a global variable or pass the
respective value as an argument to the functions where you need it.

One additional thing that must be addressed before this patch can be
applied is the compatibility with preview-latex.  The reason for this
is that I made the assumption that the .aux files will be consistent
with the output that the user is looking at.  Normally, it is very
unusual that the .aux files will not be consistent, but in the case of
preview-latex they will never be consistent because preview-latex
doesn't seem to create .aux files.  The .aux file information must be
available in some way for this to work with it.

I have no idea about how preview-latex handles .aux files.  Perhaps
David can comment.

I am making the suggested changes to this patch, but am still concerned about interaction with preview-latex. Because the method used to resolve labels requires that the .aux files are consistent with whatever typeset output the user is looking at, and preview-latex generates typeset output without corresponding .aux files, it is possible to get incorrect labels when using preview-latex. Should I disable this mode for now when preview-latex is being used, or should we try to work out the problem before this patch is applied?

-Tim






reply via email to

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