Improvements for cross-referencing

Daniel xracoonx at gmx.de
Fri Apr 10 09:00:44 UTC 2020


On 2020-04-09 23:55, Richard Kimberly Heck wrote:
> On 4/8/20 8:05 AM, Daniel wrote:
>> Ideally, these "labels" would be customizable so that the content
>> label string can be customized in the same way as label strings and
>> counters (as in "section \thesection" and "(\roman{enumiii})"). Again
>> some shared features. There would be commands for different cross
>> reference types, maybe "RefLabelString", "EqRefLabelString",
>> "FormatLabelString", and "NameRefLabelString". Again, these
>> customization could be utilized by LyXHTML as well.
> 
> We have the PrettyFormat tag, which is what controls the HTML output of
> formatted references. What are you imagining that the others would do?
> (FYI, all that was done before I added refstyle support. That's why the
> caps and plurals aren't supported (yet).)

FormatRef: Yes, the PrettyFormat tag in counters is nice. Yes, capital 
and plural support would be nice there. However, I think that for full 
customization, the counter should be directly referable, in addition to 
the LabelString via ##.

By the way, theorem environments seem not to have PrettyFormats by 
default. I could take a look and post a patch if that's helpful and not 
yet in master.

Ref, EqRef: Currently, these references to enumerate lists will show the 
counter label string in LyXHTML. But that is incorrect since it also 
shows the period which is not shown in the latex output. Furthermore, 
what will be shown in the latex output can be customized with the 
enumitem package 
(https://ftp.acc.umu.se/mirror/CTAN/macros/latex/contrib/enumitem/enumitem.pdf, 
p. 5). Hence, the ability to customize the plain reference would be nice 
as well. Again, it is not sufficient to refer to the LabelString via ##.

But I think that I was wrong to suggest a customization for both the 
label of Ref and EqRef because only the label of Ref needs to be 
customizable. EqRef just adds brackets.

NameRef: Currently, NameRef seems to show the same as FormatRef in 
LyXHTML. However, in contrast, the latex output shows section headings. 
Also, I think it would be nice if one could add labels to other elements 
than headings such as description and labeling lists labels. This is not 
officially supported by NameRef but kind of works in latex already by 
default and can be made to work fully rather easily 
(https://tex.stackexchange.com/a/526139).

Daniel



More information about the lyx-devel mailing list