[Top][All Lists]

[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: Fri, 03 Dec 2021 08:08:15 -0300
User-agent: mu4e 1.6.10; emacs 27.2

Hi Arash,

On Fri, 03 Dec 2021 at 10:40, Arash Esbati <> wrote:

You're right, of course. The reason I asked for one thing, and not the
other, is that an interested user can handle \zlabel/\zref from a
personal style file, but tampering with `reftex-parse-from-file'
becomes impractical for this purpose.

Agreed.  I will prepare a small patch.

Thank you.

Agreed.  I think adding support for zref to RefTeX is a source of

That's a pity, but I had to do it. And I understand, of course. (I may pester you folks about this sometime in the future, though, given a project I'm working on, but it is too early for that.)

You can have a function or a variable catering completion for package
options, depends on the use case.

That must be it.  Either way, you know much better than me here.

I guess this was the idea.  I had a look at the list in the manual
(section 2.7 Declared properties) and saw the Property lists and the

I thought \zref has an optional argument which can contain a property
from a certain property list, e.g.


I think my first idea for the alist was that each zref-module adds its
properties to `LaTeX-zref-properties-alist' which is then used for
completion when \zref is called.  But again, I really didn't grok the
manual in this regard.  Are the name of property lists used somewhere?
Or only the name of the properties in the optional argument of \zref?

Yes, there are property lists and properties, and both (technically) may be used independently.

The property lists may be used when setting labels. More explicitly, with `\zref@labelbylist{refname}{listname}'. But this is not a user/document command, the only one available of this kind is the mentioned undocumented `\zkvlabel'. I took a look at its definition and, as far as I understand, its syntax is:

\zkvlabel{k=v options}{refname}

The accepted keys are: `list' (property list), `prop' (property to include), `delprop' (property to exclude), and `immediate' (a boolean, whether to write to .aux immediately).

Usually, you'd be either choosing the property list or the property, the hierarchical relation of them (the alist structure) is not specially meaningful. In particular, when we are making the reference we can indeed specify the property we want to refer to, as you noted, but we have actually no way to infer the property list which generated the label. In fact, only the properties are ever stored in the label. So, if you set a label with `\zlabel', thus using the main list, you'll find (with bare bones default) in the aux file:


We happen to "know" that's the main list, but we only ever see the properties. And the thing is the properties actually included when setting a label can be changed on the fly, either by `\zkvlabel' or by a number of other internal mechanisms. For example, you can add a property to a list locally, so that "main" may contain a further property within environment "foo".

That given, my suggestion would be to keep `LaTeX-zref-properties-(a?)list' a "flat" list of properties which can then be populated presumably basically with the properties of the "main" list, but potentially including other ones too, depending on need. The bottom line is, when making the reference, we technically can't know what property list generated the label we are referring to. We can presume "main", naturally, but even that may mean different things at different places. Possibly, if you do choose to add support for `\zkvlabel', you may also want to keep a list of property lists.

Another related suggestion would be to have `zref-titleref.el' adding
"title" to `LaTeX-zref-properties-alist', which would be a common
need, I think.  For which there's also `\ztitleref' and

I didn't get that far :-)

I assumed that. :-) It was just a suggestion of a module of general interest, to spare you some "manual groking".

My idea was to have everything basic in zref.el, I think.

As you see fit. It'd work just as well, I presume. It just seemed atypical for "zref" to be in `TeX-active-styles' when `zref.sty' is never loaded.

Thanks for your comments.  I'll send you the styles for more feedback
when I have something working, just don't expect fast progress :-)

No hush at all, in your time. And if you'd like to discuss any other points along the way, I remain at your disposal.

Thank you very much!


reply via email to

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