Tim Toolan | 1 Dec 2008 13:13
Picon
Favicon

Re: reftex patch to support resolved labels

Quoting Ralf Angeli <angeli <at> caeruleus.net>:

> * Tim Toolan (2008-10-27) writes:
>
>> Quoting "Ralf Angeli" <angeli <at> caeruleus.net>:
>>
>>> 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.
>
(Continue reading)

Ralf Angeli | 1 Dec 2008 20:44

Re: reftex patch to support resolved labels

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

> 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.

Perhaps I am misunderstanding the issue, but couldn't you just disable
the feature if no .aux file is present?

> 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?

See above.

By the way, do you have a copyright assignment for Emacs or RefTeX on
file at the FSF?

--

-- 
Ralf
Tim Toolan | 1 Dec 2008 21:26
Picon
Favicon

Re: reftex patch to support resolved labels

Quoting Ralf Angeli <angeli <at> caeruleus.net>:

> * Tim Toolan (2008-12-01) writes:
>
>> 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.
>
> Perhaps I am misunderstanding the issue, but couldn't you just disable
> the feature if no .aux file is present?

If no .aux file is present, then it is straightforward to disable the feature.

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.

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.

If the .aux information was available from the previews, it would be  
(Continue reading)

Ralf Angeli | 1 Dec 2008 22:37

Re: reftex patch to support resolved labels

* 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?

--

-- 
Ralf
Tim Toolan | 2 Dec 2008 13:35
Picon
Favicon

Re: reftex patch to support resolved labels

Quoting Ralf Angeli <angeli <at> caeruleus.net>:

> * 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.
(Continue reading)

Ralf Angeli | 6 Dec 2008 22:45

Re: reftex patch to support resolved labels

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

> Quoting Ralf Angeli <angeli <at> caeruleus.net>:
>
>> 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.

D'oh, you're right.  It seems I didn't pay attention when making the
remark above.  For the reply at hand I used a bit more time, so
hopefully I'm not making an idiot out of myself again. (c:

> 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.

Do I understand correctly that you are suggesting to let preview-latex
generate .aux files and use the data in those files for the display of
resolved labels?  I just tried that by removing the \nofiles switch from
(Continue reading)

Tim Toolan | 8 Dec 2008 16:50
Picon
Favicon

Re: reftex patch to support resolved labels

Quoting Ralf Angeli <angeli <at> caeruleus.net>:

> * Tim Toolan (2008-12-02) writes:
>
>> Quoting Ralf Angeli <angeli <at> caeruleus.net>:
>>
>> 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.
>
> Do I understand correctly that you are suggesting to let preview-latex
> generate .aux files and use the data in those files for the display of
> resolved labels?  I just tried that by removing the \nofiles switch from
> `preview-LaTeX-command' and the .aux files did not contain any label
> information.  So there seem to more changes required to obtain this
> output.

You not only have to remove the \nofiles command from  
`preview-LaTeX-command', but also remove it from the file preview.dtx  
in the section where it creates the file prauctex.def.

> Anyway, I'm not sure if we really want to use the inconsistent numbering
> produced by `preview-region' runs.  In addition the _region_.aux file is
> overwritten with every new run which complicates matters if I am not
> mistaken.
(Continue reading)

Ralf Angeli | 15 Dec 2008 22:17

Determination of value for TeX-macro-private

We currently have the following code for determining the value of
`TeX-macro-private':

(defcustom TeX-macro-private (append (TeX-parse-path "TEXINPUTS")
				     (TeX-parse-path "BIBINPUTS"))
  "Directories where you store your personal TeX macros."
  :group 'TeX-file
  :type '(repeat (file :format "%v")))

On my system this returns nil.  Are $TEXINPUTS and $BIBINPUTS still
widely used for setting the path to personal TeX macros?  To me it looks
like we should rather be using something like
kpsewhich --var-value=TEXMFHOME
or
kpsewhich --expand-var=\$TEXMFHOME
nowadays (and append a "/tex").  However, it's probably not a good idea
to call `kpsewhich' every time tex.el is loaded.  How about getting the
unexpanded value of `TEXMFHOME' at build time and writing that to
tex-site.el (wrapped in a call to `file-exists-p')?  (I'm not sure if
that's possible because until now I've only been able to get the
expanded value.)

--

-- 
Ralf
Uwe Brauer | 18 Dec 2008 14:43
Picon
Favicon

enhance reftex-label-alist, the label-prefix.

Hello 

Part of reftex-label-alist, is the label prefix which is given by

LABEL-PREFIX
    Label prefix string, like "tab:".
    The prefix is a short string used as the start of a label.  It may be the
    empty string.  The prefix may contain the following `%' escapes:
       %f   Current file name with directory and extension stripped.
       %F   Current file name relative to directory of master file.
       %m   Master file name, directory and extension stripped.
       %M   Directory name (without path) where master file is located.
       %u   User login name, on systems which support this.
       %S   A section prefix derived with variable `reftex-section-prefixes'.

I use always %f, which I find very useful.

However for very long documents I would find it useful to have *in
addition* a _new_ section prefix, which is based on the label of the
section.

Example

The file test.tex contains
\section{Contraction in the lower norm}
\label{sec:contr-lower-norm}

(That label was automatically generated)

With the current setting 
(Continue reading)

Ralf Angeli | 18 Dec 2008 22:22

Re: enhance reftex-label-alist, the label-prefix.

* Uwe Brauer (2008-12-18) writes:

> The file test.tex contains
> \section{Contraction in the lower norm}
> \label{sec:contr-lower-norm}

> However what I would like is 
>
> \begin{equation}
> \label{eq:test:sec:contr-lower-norm:1}
> \int 
> \end{equation}

What if you change the sectioning afterwards?

--

-- 
Ralf

Gmane