Re: Improvements for cross-referencing
On 2020-04-11 19:13, Richard Kimberly Heck wrote: On 4/10/20 6:49 AM, Daniel wrote: In summary: - PrettyFormat should be extended to be able use the counter directly as is LabelString. - Ref should be customizable similarly as well. Can you add bug reports for these? They should both be quite easy to fix. I have no idea, actually, why I did PrettyFormat the way I did instead of like LabelString. Done at https://www.lyx.org/trac/ticket/11822 https://www.lyx.org/trac/ticket/11823 And the bonus for the work area (but maybe that's just me): https://www.lyx.org/trac/ticket/11824 Daniel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
Le 11/04/2020 à 19:03, Richard Kimberly Heck a écrit : On 4/11/20 6:18 AM, Jean-Marc Lasgouttes wrote: Le 11/04/2020 à 12:12, Jürgen Spitzmüller a écrit : Am Samstag, den 11.04.2020, 11:01 +0200 schrieb Daniel: That's pretty similar to the breaking labels, I guess. That seems pretty simple idea wise. Didn't expect the implementation to be so tricky for those. It looks easy on paper, as many things. This require to do 'unpack' insets into the current row, a bit like what I did in MathRow. A Summer project of sorts, but I have enough others on my pile. Where is the relevant code exactly? I might have a look. It is the MathRow code. In there I unpack the inset contents using their addToRow method. This allows to have proper spacing when using macros for example. Something similar could be done with Row: create a big Row from the whole paragraph where the insets that we want are inlined, and then use the row breaking algorithm to create the actual rows for the paragraph. JMarc -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
On 4/10/20 6:49 AM, Daniel wrote: > In summary: > - PrettyFormat should be extended to be able use the counter directly > as is LabelString. > - Ref should be customizable similarly as well. Can you add bug reports for these? They should both be quite easy to fix. I have no idea, actually, why I did PrettyFormat the way I did instead of like LabelString. > - NameRef should show what is shown in the latex output, i.e. heading > or list label. This is #8599 already. Riki -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
On 4/11/20 6:18 AM, Jean-Marc Lasgouttes wrote: > Le 11/04/2020 à 12:12, Jürgen Spitzmüller a écrit : >> Am Samstag, den 11.04.2020, 11:01 +0200 schrieb Daniel: >>> That's pretty similar to the breaking labels, I guess. That seems >>> pretty simple idea wise. Didn't expect the implementation to be so >>> tricky for those. >> >> It looks easy on paper, as many things. > > This require to do 'unpack' insets into the current row, a bit like > what I did in MathRow. A Summer project of sorts, but I have enough > others on my pile. Where is the relevant code exactly? I might have a look. Riki -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
Le 11/04/2020 à 12:12, Jürgen Spitzmüller a écrit : Am Samstag, den 11.04.2020, 11:01 +0200 schrieb Daniel: That's pretty similar to the breaking labels, I guess. That seems pretty simple idea wise. Didn't expect the implementation to be so tricky for those. It looks easy on paper, as many things. This require to do 'unpack' insets into the current row, a bit like what I did in MathRow. A Summer project of sorts, but I have enough others on my pile. JMarc -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
Am Samstag, den 11.04.2020, 11:01 +0200 schrieb Daniel: > That's pretty similar to the breaking labels, I guess. That seems > pretty simple idea wise. Didn't expect the implementation to be so > tricky for those. It looks easy on paper, as many things. Jürgen signature.asc Description: This is a digitally signed message part -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
On 2020-04-11 10:34, Jürgen Spitzmüller wrote: The more important case are not collapsible insets but inline insets (such as character styles) that don't have a button but should integrate with the surrounding text. The hard part is to get the metrics and drawing right. That's pretty similar to the breaking labels, I guess. That seems pretty simple idea wise. Didn't expect the implementation to be so tricky for those. Daniel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
Am Samstag, den 11.04.2020, 09:32 +0200 schrieb racoon: > Here is another rough idea for improvement of insets whose content is > not supposed to float in the text, such as footnotes. Leave the label > floating in the normal text line and open the inset below: The more important case are not collapsible insets but inline insets (such as character styles) that don't have a button but should integrate with the surrounding text. The hard part is to get the metrics and drawing right. Jürgen signature.asc Description: This is a digitally signed message part -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
On 2020-04-10 22:02, Richard Kimberly Heck wrote: On 4/10/20 2:55 PM, racoon wrote: On 2020-04-10 20:29, Richard Kimberly Heck wrote: On 4/10/20 1:58 PM, Daniel wrote: On 10/4/20 19:54, Richard Kimberly Heck wrote: On 4/10/20 5:05 AM, Daniel wrote: On 2020-04-09 11:27, Daniel wrote: Attached is a simple concept of what it could look like. Daniel I think this fancy zig-zag is not important. The label could just break at a space with a straight cut. This is how it currently works in both Libre and Word. Seems good enough. Yes, we can't break labels over lines as things currently are. Riki I know. It was just an additional idea that would make the usage of longer labels possible. But in general labels are not that long anyway, so I don't think it should be a show stopper for the other suggestions. We have a similar problem even with textual insets. Riki I am not sure which a textual insets you have in mind. For example, classic insets which can contain text are less often part of the floating text. Footnotes, e.g., but really anything that lets you type into it. You might think we should be able to have: Here is some text. Here is some text. Here is[[FOOTNOTE: This is the text of the footnote, which goes across a few lines, and is broken in a sensible way.]] some text. Here is some text. But what you see is: Here is some text. Here is some text. Here is [[FOOTNOTE: This is the text of the footnote, which goes across a few lines, and is NOT broken in a sensible way. ]] some text. Here is some text. It's a dream of many of us to fix this, but it's super hard. Riki I see. I am not sure what is the super hard part. Is it to get the idea right or the implementation or both? If getting the idea right, then the label breaking that I was suggesting before, seems much less tricky because it's basically just normally broken text with a background color (the button color). On the more complicated inset issue: I guess the idea you suggested is most sensible in the case the inset contains only a single line and floats in the text, which might be the case often enough. But it is not clear to me that it is sensible for multi-line insets, such as footnotes, since a non broken inset gives a better idea of what the footnote would look like. Here is another rough idea for improvement of insets whose content is not supposed to float in the text, such as footnotes. Leave the label floating in the normal text line and open the inset below: ++ Here is some text. Here is| FOOTNOTE 1 | some text. Here is some text. +-++-+ | This is the text of the footnote, which goes across a few lines, | | and is NOT broken in a sensible way. | ++ Here is some text. Here is some text. However, if there is more than one open inset in a line, then the breaking becomes less nice, but I think it's still pretty readable: ++ Here is some text. Here is| FOOTNOTE 1 | +-++-+ | This is the text of the footnote, which goes across a few lines, | | and is NOT broken in a sensible way. | ++ ++ | FOOTNOTE 2 | some text. Here is some text. Here is some text. Here is ++---+ | This is the text of the footnote, which goes across a few lines, | | and is NOT broken in a sensible way. | ++ some text. Just a thought. Not perfect. Daniel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
On 4/10/20 2:55 PM, racoon wrote: > On 2020-04-10 20:29, Richard Kimberly Heck wrote: >> On 4/10/20 1:58 PM, Daniel wrote: >>> On 10/4/20 19:54, Richard Kimberly Heck wrote: On 4/10/20 5:05 AM, Daniel wrote: > On 2020-04-09 11:27, Daniel wrote: >> Attached is a simple concept of what it could look like. >> >> Daniel >> > > I think this fancy zig-zag is not important. The label could just > break at a space with a straight cut. This is how it currently works > in both Libre and Word. Seems good enough. Yes, we can't break labels over lines as things currently are. Riki >>> >>> I know. It was just an additional idea that would make the usage of >>> longer labels possible. But in general labels are not that long anyway, >>> so I don't think it should be a show stopper for the other suggestions. >> >> We have a similar problem even with textual insets. >> >> Riki > > I am not sure which a textual insets you have in mind. For example, > classic insets which can contain text are less often part of the > floating text. Footnotes, e.g., but really anything that lets you type into it. You might think we should be able to have: Here is some text. Here is some text. Here is[[FOOTNOTE: This is the text of the footnote, which goes across a few lines, and is broken in a sensible way.]] some text. Here is some text. But what you see is: Here is some text. Here is some text. Here is [[FOOTNOTE: This is the text of the footnote, which goes across a few lines, and is NOT broken in a sensible way. ]] some text. Here is some text. It's a dream of many of us to fix this, but it's super hard. Riki -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
On 2020-04-10 20:29, Richard Kimberly Heck wrote: On 4/10/20 1:58 PM, Daniel wrote: On 10/4/20 19:54, Richard Kimberly Heck wrote: On 4/10/20 5:05 AM, Daniel wrote: On 2020-04-09 11:27, Daniel wrote: Attached is a simple concept of what it could look like. Daniel I think this fancy zig-zag is not important. The label could just break at a space with a straight cut. This is how it currently works in both Libre and Word. Seems good enough. Yes, we can't break labels over lines as things currently are. Riki I know. It was just an additional idea that would make the usage of longer labels possible. But in general labels are not that long anyway, so I don't think it should be a show stopper for the other suggestions. We have a similar problem even with textual insets. Riki I am not sure which a textual insets you have in mind. For example, classic insets which can contain text are less often part of the floating text. Daniel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
On 4/10/20 1:58 PM, Daniel wrote: > On 10/4/20 19:54, Richard Kimberly Heck wrote: >> On 4/10/20 5:05 AM, Daniel wrote: >>> On 2020-04-09 11:27, Daniel wrote: Attached is a simple concept of what it could look like. Daniel >>> >>> I think this fancy zig-zag is not important. The label could just >>> break at a space with a straight cut. This is how it currently works >>> in both Libre and Word. Seems good enough. >> >> Yes, we can't break labels over lines as things currently are. >> >> Riki > > I know. It was just an additional idea that would make the usage of > longer labels possible. But in general labels are not that long anyway, > so I don't think it should be a show stopper for the other suggestions. We have a similar problem even with textual insets. Riki -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
On 10/4/20 19:54, Richard Kimberly Heck wrote: On 4/10/20 5:05 AM, Daniel wrote: On 2020-04-09 11:27, Daniel wrote: Attached is a simple concept of what it could look like. Daniel I think this fancy zig-zag is not important. The label could just break at a space with a straight cut. This is how it currently works in both Libre and Word. Seems good enough. Yes, we can't break labels over lines as things currently are. Riki I know. It was just an additional idea that would make the usage of longer labels possible. But in general labels are not that long anyway, so I don't think it should be a show stopper for the other suggestions. Daniel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
On 4/10/20 5:05 AM, Daniel wrote: > On 2020-04-09 11:27, Daniel wrote: >> Attached is a simple concept of what it could look like. >> >> Daniel >> > > I think this fancy zig-zag is not important. The label could just > break at a space with a straight cut. This is how it currently works > in both Libre and Word. Seems good enough. Yes, we can't break labels over lines as things currently are. Riki -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
On 2020-04-10 11:00, Daniel wrote: 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 ##. Use case: The Section layout is formatted as "1. Some heading". In this case "section ##" will result in "section 1." but it should still be "section 1". 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). In summary: - PrettyFormat should be extended to be able use the counter directly as is LabelString. - Ref should be customizable similarly as well. - NamRef should show what is shown in the latex output, i.e. heading or list label. Daniel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
On 2020-04-09 11:27, Daniel wrote: Attached is a simple concept of what it could look like. Daniel I think this fancy zig-zag is not important. The label could just break at a space with a straight cut. This is how it currently works in both Libre and Word. Seems good enough. Daniel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
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 -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
On 4/8/20 8:05 AM, Daniel wrote: > Just a couple of rough ideas that I think would improve working with > cross-references. Maybe some of them are already worked on. I'd be > interested to know. > > I guess one of the advantages of LyX is that working with texts is > pretty nice even without generating a preview. Seeing versions of > references that indicate their content, as is already the case for > citations, is helpful in that respect. > > Maybe there could be a switch for this between (global) content labels > and prefix+label-name labels because some people might like to see > label names rather than content previews (although a tool-tip should > also reveal the prefix+label-name, I guess)? > > The content-previews have already been (partly) implemented for > LyXHTML. For example, a reference to the first numbered section shows > "Section 1" (though currently this reference appears only in capitals > rather than being responsive to the capitalization feature in LyX). I > guess the LyXHTML of a reference and its content preview should be the > same and progress made on one part can be used in the other. Due to > recent progress, counters are highly customizable which makes content > labels even more attractive. For textual references, the content of > the element could be used that is already shown in the outliner. I did think about this when doing the LyXHTML work, precisely for the reasons you mention, but never got around to implementing it. I doubt it would be terribly difficult to do at this point. Maybe a good summer project for me. > 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).) You're also right, of course, that this could be used in the TOC. Riki -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Improvements for cross-referencing
On 2020-04-08 14:05, Daniel wrote: The content-previews have already been (partly) implemented for LyXHTML. For example, a reference to the first numbered section shows "Section 1" (though currently this reference appears only in capitals rather than being responsive to the capitalization feature in LyX). I guess the LyXHTML of a reference and its content preview should be the same and progress made on one part can be used in the other. These labels could also be used in the outliner. Currently, I have a number of non-descriptive entries in the TOC where I use NameRefs, such as 4. # reconsidered and the # It would be nicer to see the NameRef content instead of the hash. Daniel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Improvements for cross-referencing
Just a couple of rough ideas that I think would improve working with cross-references. Maybe some of them are already worked on. I'd be interested to know. I guess one of the advantages of LyX is that working with texts is pretty nice even without generating a preview. Seeing versions of references that indicate their content, as is already the case for citations, is helpful in that respect. Maybe there could be a switch for this between (global) content labels and prefix+label-name labels because some people might like to see label names rather than content previews (although a tool-tip should also reveal the prefix+label-name, I guess)? The content-previews have already been (partly) implemented for LyXHTML. For example, a reference to the first numbered section shows "Section 1" (though currently this reference appears only in capitals rather than being responsive to the capitalization feature in LyX). I guess the LyXHTML of a reference and its content preview should be the same and progress made on one part can be used in the other. Due to recent progress, counters are highly customizable which makes content labels even more attractive. For textual references, the content of the element could be used that is already shown in the outliner. 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. Daniel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel