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: Tue, 02 Dec 2008 07:35:53 -0500
User-agent: Internet Messaging Program (IMP) H3 (4.3)

Quoting Ralf Angeli <address@hidden>:

* Tim Toolan (2008-12-01) writes:

The concern is that someone:
1) Runs latex and generates the typeset document along with the .aux files.
2) Edits a large portion somewhere early on in the document, and
regenerates previews for the entire document.
3) Uses the method provided by this patch to refer to an equation in
the later portion of the document using the equation number they see
in the typeset preview.

I see.

Because there is currently no way to get the .aux information from the
generated previews this will produce the wrong label.  The reason it
is wrong is because that label has been renumbered, but it was not
recorded in any .aux file.

Hm, but there is a similar problem if labels are inserted after a LaTeX
run.  The more one is editing labels in the buffer, the more outdated
the information in the .aux file becomes.  Are there provisions in your
code dealing with this problem?

If one is only using LaTeX to view the typeset document and not using preview-latex, then no matter how outdated the .aux files become, the information they contain will always be correct, because resolved labels only appear in the typeset document. For instance, if someone:

1) Runs LaTeX to generate the typeset document.
2) Inserts lots of new equations somewhere in the middle of the document.
3) Refers to the last equation in the typeset document by its equation number from the out of date typeset document.

the label is guaranteed to be correct unless two things happened. First, the label for the equation they refer to was changed to a different string, and second, that label was reused somewhere in the document for a different equation. This is very unlikely except for when reftex-renumber-simple-labels is used, but is relatively easy to detect and address in any case because both reftex and the .aux files contain an ordered list of the labels as they appear in the document, therefore if the order changed, something like this happened.

There is no danger of giving an incorrect label for labels that were added since the last time latex was run because they have not been resolved yet, therefore there is no way to refer to them using what they resolved to.

When using preview-latex, ideally preview-preserve-counters should be set to true, but even that is not necessary. If someone runs preview-document, it will generate the full set of correct .aux data, but even if they run preview-region, the generated .aux files will contain the resolved labels for that section as they appear in the preview. If there are duplicate resolved labels in the document (for instance lots of equation 1s), it is okay because we will know that, and can make it clear to the user that this is the case.

-Tim






reply via email to

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