auctex-devel
[Top][All Lists]
Advanced

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

Re: [FR] RefTex support for zref-xr


From: Gustavo Barros
Subject: Re: [FR] RefTex support for zref-xr
Date: Mon, 06 Dec 2021 11:22:13 -0300
User-agent: mu4e 1.6.10; emacs 27.2

Hi Arash,

that was fast! :-)

On Mon, 06 Dec 2021 at 09:26, Arash Esbati <arash@gnu.org> wrote:

After thinking about it, I think there is a chance to use RefTeX with
something like this:

    (reftex-add-label-environments
     '(("\\zlabel{*]" ?z nil nil nil)))

The labels defined with the macro are accessible with the z typekey.
This is of course not so convenient because one gets all labels in the
RefTeX select buffer and can't narrow after section, figure, etc., but
it is better than nothing.

I've taken a look at it and agree that's an interesting idea. We still get them all together when using the SPC typekey, but there's a way to separate them. Though, indeed, there's no way to narrow by type for zlabels, this may be a good compromise, I think.

But, if I may make a request, would you consider offering a variable for those who may want a `("\\zlabel{*}" nil nil nil nil)' kind of behavior? (btw, as far as I can tell, there's a typo on that closing brace at `reftex-add-label-environments').

I've made some light testing here and choosing labels from `reftex-reference' seems to be working well, but setting a `\zlabel' always gives me "z-1", "z-2", "z-N" labels (no prompt, no `TeX-read-label-prefix', no nothing). I'm not sure if it's interacting with some of my settings, though, it may be. Or is this supposed to be an implication of making "\zlabel" type "?z"? (If that's the case, that'd be quite a strong limitation, but again, I think I'm missing something here).

I've had another idea here around this issue. It is actually orthogonal to your approach from the technical side, and may be an alternative or a complement to it. It would be adding a (e.g.) `TeX-zlabel-prefix' to zlabels, so supposing a prefix "z:" we could have, for example "z:sec:foo", "z:fig:bar" etc. That would make the labels easily recognizable when making a reference, even when using the SPC typekey, would cater for "non-duplicates", and would allow for narrowing for label types also for zlabels. Granted, it is a little work-aroundish, but it is simple, and seems to cover the main related problems.

I thought the entry point for users is either

    \usepackage[<module>]{zref}

or

    \usepackage{zref-<module>}

Indeed it is.

All of them load zref-base.sty, but I think we can skip that extra file
zref-base.el and put all the functionality in zref.el.

It seemed atypical to me, and I just wanted to make sure it was intentional. It is, so we're good. ;-)

Thanks, here the next incarnation.  Any comments welcome.

Best, Arash

[2. application/emacs-lisp; zref.el]...

[3. application/emacs-lisp; zref-abspage.el]...

[4. application/emacs-lisp; zref-lastpage.el]...

[5. application/emacs-lisp; zref-user.el]...

`zref-abspage.el' and `zref-lastpage.el' look good. And the comments I had about `zref.el' and `zref-user.el' are the "crux" ones I made above. Some stuff I had mentioned previously I'm assuming you just didn't take a look at them yet, so no need to reiterate. Otherwise, that's it. I'm not sure I can see well all the ramifications of `LaTeX-zref-read-zlabel', and perhaps some more mileage in testing may be needed for me to be able to give you better feedback about the approach. But these were my initial thoughts about it.

Thank you once again for the quick new "incarnation" and, particularly, for bringing RefTeX support back on the table.

And I remain at your disposal.

Best,
Gustavo.



reply via email to

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