Re: Notes inherit surrounding font

2019-09-12 Thread Daniel

On 2019-09-04 16:30, Jean-Marc Lasgouttes wrote:
I propose in the following patch to reset the outer layout to Plain if 
it only contains the newly insert inset.


It seems to me that my original example had some specific features that 
triggered a solution of which I don't think it solves the whole problem. 
This makes me wonder whether there is a superior solution to the whole 
problem or at least something additional that should be fixed.


Attached is an example very similar to the original. However, this time 
do not select the document's whole content but only from part of the 
section heading, e.g. "tion", to the end of the enumerate item.


The result (also represented in the document) is an enumerate item 
within a note with a font matching the section font. This looks odd to 
me. Rather the enumerate should have a normal font.


Furthermore, I don't think it is something that would be typeset this 
way in any inset. In particular, other insets I tested, e.g. Footnote, 
Program Listing, don't share this "feature". But I couldn't figure out 
why they differ.


Daniel
#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Itemize
Select from "tion" to the end of the first enumeration item and insert a
 note:
\end_layout

\begin_layout Section
Section
\end_layout

\begin_layout Standard

\end_layout

\begin_layout Enumerate
Text
\end_layout

\begin_layout Standard
\begin_inset Separator plain
\end_inset


\end_layout

\begin_layout Itemize
The result will be this:
\end_layout

\begin_layout Section
Sec
\begin_inset Note Note
status open

\begin_layout Section
tion
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Enumerate
Text
\end_layout

\end_inset


\end_layout

\end_body
\end_document


Re: [LyX/master] Reset layout when inserting an inset over full paragraph(s)

2019-09-12 Thread Pavel Sanda
On Thu, Sep 12, 2019 at 10:04:19AM +0200, Jean-Marc Lasgouttes wrote:
> But if there is a consensus about 2.3, I am OK with it.

I was not actually suggesting to push it into official 2.3.x, just
wanted to know whether putting into my private patchset is likely
to cause some harm...
Pavel


Re: [LyX/master] Reset layout when inserting an inset over full paragraph(s)

2019-09-12 Thread Richard Kimberly Heck
On 9/12/19 3:43 PM, Jean-Marc Lasgouttes wrote:
> Le 12/09/2019 à 20:54, Richard Kimberly Heck a écrit :
>>> But if there is a consensus about 2.3, I am OK with it.
>>
>> The basic idea seems correct. I've played around with this before, too.
>> I haven't tested, but one question that arose when I was dealing with
>> this was with lists and depth issues.
>
> One thing that changes with the patch is that I condition on
> forcePlainLayout instead of allowMultiPar, because it seems to be the
> correct condition (and allowMultipar implies forcePlainLayout by
> default).
>
> I also removed some code that I believe to duplicate what is done in
> pasteSelectionHelper.
>
> I have no idea about depth issues, this is typically something I could
> have overlooked.
>
>> In any event, this seems to be a big enough change to hold it for 2.4.0
>> (which we're supposed to be moving towards, right?). 
>
> I take this as a subtle nudge in my direction. It is well deserved :)

No, not at all. I'd actually forgotten you'd taken that on. Scott has
been around again...


>
>> I'm intending to
>> get 2.2.4 under way in a week or so, once things calm down here a bit.
>> We could push to 2.3.x after that, so that it got tested, and it could
>> then appear in 2.3.5, whether that is the last release or not.
>
> I am not sure that we want to have a change we are not sure about in
> our last 2.3 release.
>
> We are sorely lacking daily builds for stable releases. If we knew how
> to automate these, that could be done by our CI tools. I have taken a
> look at the Ubuntu side of things, and ran away screaming. I do not
> have the time to invest in even understanding this thing. And daily
> build is one order of magnitude more difficulty. How can we find
> people who know how to get this up and running, at least when daily
> builds do not require manual intervention (we can afford some
> imperfectness here)?

I take it you mean daily builds of RPMs or something of the sort? Or do
you mean something else? If it's just the tarball we want, then that
ought to be quite easy.

Riki





Re: [LyX/master] Reset layout when inserting an inset over full paragraph(s)

2019-09-12 Thread Jean-Marc Lasgouttes

Le 12/09/2019 à 20:54, Richard Kimberly Heck a écrit :

But if there is a consensus about 2.3, I am OK with it.


The basic idea seems correct. I've played around with this before, too.
I haven't tested, but one question that arose when I was dealing with
this was with lists and depth issues.


One thing that changes with the patch is that I condition on 
forcePlainLayout instead of allowMultiPar, because it seems to be the 
correct condition (and allowMultipar implies forcePlainLayout by default).


I also removed some code that I believe to duplicate what is done in 
pasteSelectionHelper.


I have no idea about depth issues, this is typically something I could 
have overlooked.



In any event, this seems to be a big enough change to hold it for 2.4.0
(which we're supposed to be moving towards, right?). 


I take this as a subtle nudge in my direction. It is well deserved :)


I'm intending to
get 2.2.4 under way in a week or so, once things calm down here a bit.
We could push to 2.3.x after that, so that it got tested, and it could
then appear in 2.3.5, whether that is the last release or not.


I am not sure that we want to have a change we are not sure about in our 
last 2.3 release.


We are sorely lacking daily builds for stable releases. If we knew how 
to automate these, that could be done by our CI tools. I have taken a 
look at the Ubuntu side of things, and ran away screaming. I do not have 
the time to invest in even understanding this thing. And daily build is 
one order of magnitude more difficulty. How can we find people who know 
how to get this up and running, at least when daily builds do not 
require manual intervention (we can afford some imperfectness here)?


Even having daily builds on one platform would be very helpful.

JMarc


Re: [LyX/master] Reset layout when inserting an inset over full paragraph(s)

2019-09-12 Thread Richard Kimberly Heck
On 9/12/19 4:04 AM, Jean-Marc Lasgouttes wrote:
> Le 12/09/2019 à 01:38, Pavel Sanda a écrit :
>> I like this patch. Is it safe to put it into my personal 2.3 patchset
>> (in the terms of the patch being congruent with old 2.3 codebase
>> or way too many changes were done around in 2.4?)
>
> I like the patch too, and I checked that it applies almost cleanly
> (barring some indentation issues). I am going to work a bit with LyX
> 2.3 in the coming months and having it would be good (although working
> with master would be more fun).
>
> However, I am wary that there are workflows that I did not consider in
> the patch. This happened to me when I streamlined DEPM.
>
> But if there is a consensus about 2.3, I am OK with it.

The basic idea seems correct. I've played around with this before, too.
I haven't tested, but one question that arose when I was dealing with
this was with lists and depth issues.

In any event, this seems to be a big enough change to hold it for 2.4.0
(which we're supposed to be moving towards, right?). I'm intending to
get 2.2.4 under way in a week or so, once things calm down here a bit.
We could push to 2.3.x after that, so that it got tested, and it could
then appear in 2.3.5, whether that is the last release or not.

Riki





Re: LinkBack support (on MacOS)

2019-09-12 Thread Stephan Witt
Am 08.09.2019 um 10:57 schrieb Stephan Witt :
> 
> Am 25.09.2018 um 17:21 schrieb Stephan Witt :
>> 
>> Am 25.09.2018 um 17:10 schrieb Jürgen Spitzmüller :
>>> 
>>> Am Freitag, den 21.09.2018, 15:55 +0200 schrieb pdv:
 I came across a deprecated call in the LinkBack code, and discovered 
 that LinkBack acctually doesn't work (anymore).
 Apparently nobody uses this?
>>> 
>>> Apparently. I only found this 8 year old bug related to LinkBack:
>>> https://www.lyx.org/trac/ticket/6961
>>> 
>>> 
 When the pasteboard contains linkback-data lyx saves the pdf-data + 
 linkback-data in a file with the .linkback extension and adds the
 size 
 of the pdf-data as a uint32.
 
 When reading/rewriting back the size it's converted with 
 NSSwapBigLongToHost() and NSSwapHostLongToBig() calls.
 
 I suppose that the "Long" refers to 8 bytes.
 
 Replacing the calls by the similar "Int" calls solves the problem.
 
 LinkBack then works with LateXiT and with Omnigraffle.
 
 Enclosed is a patch for this and for replacing the deprecated call.
>>> 
>>> Alas, I know nothing of this. Stephan?
>> 
>> I’ll see if I can find the time.
> 
> I’ve applied the patch and have no problem. I didn’t do the real test with 
> linkback-data.
> I don’t have Omnigraffle an my system.
> 
> The change from NSSwapBigLongToHost to NSSwapBigIntToHost is 100% correct.
> I’ll commit to master. Thank you Patrick for fixing this bug.

I’ve commit it to master.

Patrick, can we close the ticket in LyX’s bug tracker?

Riki, I think we should back port the change to stable. Ok?

Stephan

Re: Notes inherit surrounding font

2019-09-12 Thread Daniel

On 2019-09-12 17:22, Jean-Marc Lasgouttes wrote:

Le 12/09/2019 à 17:02, Daniel a écrit :
By the way, what happens with your patch if one dissolves the inset? 
Currently, if I try to recreate the behaviour in LyX (as far as I 
understood it) by setting the sourrounding layout to normal, the first 
paragraph is changed to Standard. That does not seem ideal  because I 
would have thought that dissolving the inset is just the inverse of 
inserting it.


The patch also takes care of that.


Great.

Daniel



Re: Notes inherit surrounding font

2019-09-12 Thread Jean-Marc Lasgouttes

Le 12/09/2019 à 17:02, Daniel a écrit :
By the way, what happens with your patch if one dissolves the inset? 
Currently, if I try to recreate the behaviour in LyX (as far as I 
understood it) by setting the sourrounding layout to normal, the first 
paragraph is changed to Standard. That does not seem ideal  because I 
would have thought that dissolving the inset is just the inverse of 
inserting it.


The patch also takes care of that.

JMarc


Re: Notes inherit surrounding font

2019-09-12 Thread Daniel

On 2019-09-12 16:35, Daniel wrote:

On 2019-09-12 14:41, Jean-Marc Lasgouttes wrote:

Le 12/09/2019 à 12:53, Daniel a écrit :
I suspect that as well now. With 2.3, if I typeset my example, I get 
an empty document. This is because the section layout is a starred one.


That's cheating :) You have a section that takes vertical space, but 
you do not see it.


Do you mean, that I get a bold 1 if I change the section layout to 
the non-starred version and typeset?


Try it!


I did. (The question was whether you meant that.)

In case you talk about the latter, I don't see a reason why the one 
with the 1 does not sense. Maybe I intentionally wanted to get only 
the 1 typeset. This is possible in LyX by adding a note. And there 
are a couple of cases where it has been recommended in the past 
(maybe unfortunately?) that one should insert empty notes to keep 
layouts without contents when nesting one layout into another without 
adding any content to the outer one, e.g. to create a quote that only 
contains a numbered list.


The behavior that I implemented only trigeers when
1/ one selects the whole paragraph
2/ an inset is inserted over this selection.
3/ the inset is able to contains layouts different from Plain Layout 
(i.e. it is not a CharStyle type of inset)


So inserting an empty note in an empty paragraph does not count

And even when the layout has been reset, one can set it back, the 
Thought Police is not threatening you for non-LyXian behavior.


It is just suppose to help, not to force anything.

I am not saying that this is the way to go. I am only saying that it 
is far from obvious to me that this is the way and it wasn't my 
original concern.


So you tell me that when you sent your original message, it was clear 
for you that the Paragraph that contains the note was still in 
Section* layout?


Yes. I have worked for a while with LyX now. :)

I think it is a good idea that one can set an inset to not inherit 
the font.


However, my latest compromise suggestion was that only the first 
paragraph enherits the font of the enclosing text. It will then 
reflect the format that the text will take if the note gets dissolved.


I think this is too complicated.


I think it is less complicated than to understanding when the behavior 
triggers as you explain in the 1-3 context above.


By the way, what happens with your patch if one dissolves the inset? 
Currently, if I try to recreate the behaviour in LyX (as far as I 
understood it) by setting the sourrounding layout to normal, the first 
paragraph is changed to Standard. That does not seem ideal  because I 
would have thought that dissolving the inset is just the inverse of 
inserting it.




Re: Notes inherit surrounding font

2019-09-12 Thread Daniel

On 2019-09-12 14:41, Jean-Marc Lasgouttes wrote:

Le 12/09/2019 à 12:53, Daniel a écrit :
I suspect that as well now. With 2.3, if I typeset my example, I get 
an empty document. This is because the section layout is a starred one.


That's cheating :) You have a section that takes vertical space, but you 
do not see it.


Do you mean, that I get a bold 1 if I change the section layout to the 
non-starred version and typeset?


Try it!


I did. (The question was whether you meant that.)

In case you talk about the latter, I don't see a reason why the one 
with the 1 does not sense. Maybe I intentionally wanted to get only 
the 1 typeset. This is possible in LyX by adding a note. And there are 
a couple of cases where it has been recommended in the past (maybe 
unfortunately?) that one should insert empty notes to keep layouts 
without contents when nesting one layout into another without adding 
any content to the outer one, e.g. to create a quote that only 
contains a numbered list.


The behavior that I implemented only trigeers when
1/ one selects the whole paragraph
2/ an inset is inserted over this selection.
3/ the inset is able to contains layouts different from Plain Layout 
(i.e. it is not a CharStyle type of inset)


So inserting an empty note in an empty paragraph does not count

And even when the layout has been reset, one can set it back, the 
Thought Police is not threatening you for non-LyXian behavior.


It is just suppose to help, not to force anything.

I am not saying that this is the way to go. I am only saying that it 
is far from obvious to me that this is the way and it wasn't my 
original concern.


So you tell me that when you sent your original message, it was clear 
for you that the Paragraph that contains the note was still in Section* 
layout?


Yes. I have worked for a while with LyX now. :)

I think it is a good idea that one can set an inset to not inherit the 
font.


However, my latest compromise suggestion was that only the first 
paragraph enherits the font of the enclosing text. It will then 
reflect the format that the text will take if the note gets dissolved.


I think this is too complicated.


I think it is less complicated than to understanding when the behavior 
triggers as you explain in the 1-3 context above.


Daniel



Re: Notes inherit surrounding font

2019-09-12 Thread Jean-Marc Lasgouttes

Le 12/09/2019 à 12:53, Daniel a écrit :
I suspect that as well now. With 2.3, if I typeset my example, I get an 
empty document. This is because the section layout is a starred one.


That's cheating :) You have a section that takes vertical space, but you 
do not see it.


Do you mean, that I get a bold 1 if I change the section layout to the 
non-starred version and typeset?


Try it!

In case you talk about the latter, I don't see a reason why the one with 
the 1 does not sense. Maybe I intentionally wanted to get only the 1 
typeset. This is possible in LyX by adding a note. And there are a 
couple of cases where it has been recommended in the past (maybe 
unfortunately?) that one should insert empty notes to keep layouts 
without contents when nesting one layout into another without adding any 
content to the outer one, e.g. to create a quote that only contains a 
numbered list.


The behavior that I implemented only trigeers when
1/ one selects the whole paragraph
2/ an inset is inserted over this selection.
3/ the inset is able to contains layouts different from Plain Layout 
(i.e. it is not a CharStyle type of inset)


So inserting an empty note in an empty paragraph does not count

And even when the layout has been reset, one can set it back, the 
Thought Police is not threatening you for non-LyXian behavior.


It is just suppose to help, not to force anything.

I am not saying that this is the way to go. I am only saying that it is 
far from obvious to me that this is the way and it wasn't my original 
concern.


So you tell me that when you sent your original message, it was clear 
for you that the Paragraph that contains the note was still in Section* 
layout?


I think it is a good idea that one can set an inset to not inherit the 
font.


However, my latest compromise suggestion was that only the first 
paragraph enherits the font of the enclosing text. It will then reflect 
the format that the text will take if the note gets dissolved.


I think this is too complicated.

JMarc


Re: Notes inherit surrounding font

2019-09-12 Thread Daniel

On 2019-09-12 10:08, Jean-Marc Lasgouttes wrote:

Le 11/09/2019 à 21:56, Daniel a écrit :

On 11/9/19 15:47, Jean-Marc Lasgouttes wrote:

Le 06/09/2019 à 18:09, Daniel a écrit :

The 'surrounding layout' problem is actually more general. Suppose you
have a section, with header and associated text. Select the whole 
thing
and make it a branch. It will not do what you want. We really do 
need to
change the 'outside' layout in this case. (I think there might be a 
bug

about this, and I have done some work on the problem.)


I never used branches. So maybe that is why I never came across the
problem and cannot evaluate the benefits over the costs correctly.


Replace branch with Note or Box and the issue is the same.


I don't see what is the difference to the example I originally posted. 
Just from the description you give it seems the same and I still don't 
see why the 'sourrounding layout' is necessarily the problem.


I suspect we are not talking about the same thing. With 2.3, if you 
typeset your example, you will get a bold "1" alone on the page. This is 
an empty section. IN master, you will get an empty document. Which is 
the one that makes sense to you?


I suspect that as well now. With 2.3, if I typeset my example, I get an 
empty document. This is because the section layout is a starred one.


Do you mean, that I get a bold 1 if I change the section layout to the 
non-starred version and typeset?


In case you talk about the latter, I don't see a reason why the one with 
the 1 does not sense. Maybe I intentionally wanted to get only the 1 
typeset. This is possible in LyX by adding a note. And there are a 
couple of cases where it has been recommended in the past (maybe 
unfortunately?) that one should insert empty notes to keep layouts 
without contents when nesting one layout into another without adding any 
content to the outer one, e.g. to create a quote that only contains a 
numbered list.


I am not saying that this is the way to go. I am only saying that it is 
far from obvious to me that this is the way and it wasn't my original 
concern.


Now that the real issue is fixed (hopefully correctly), you can 
change the Note font as you want, AFAIAC.


Doesn't ring a bell. I guess I could better understand what you mean 
if I could test the patch.


Currently, the note inset inherits on screen the font of the enclosing 
text (here a section layout). It is possible to change that so that, in 
a Section heading with large and bold characters, the note uses default 
font.


I think it is a good idea that one can set an inset to not inherit the font.

However, my latest compromise suggestion was that only the first 
paragraph enherits the font of the enclosing text. It will then reflect 
the format that the text will take if the note gets dissolved.


I am not sure whether the non-inheritance or the first-paragraph 
inheritance option is preferable as default, but the current 
all-inheritance option seems confusing.


Daniel



Re: Notes inherit surrounding font

2019-09-12 Thread Jean-Marc Lasgouttes

Le 11/09/2019 à 21:56, Daniel a écrit :

On 11/9/19 15:47, Jean-Marc Lasgouttes wrote:

Le 06/09/2019 à 18:09, Daniel a écrit :

The 'surrounding layout' problem is actually more general. Suppose you
have a section, with header and associated text. Select the whole thing
and make it a branch. It will not do what you want. We really do 
need to

change the 'outside' layout in this case. (I think there might be a bug
about this, and I have done some work on the problem.)


I never used branches. So maybe that is why I never came across the
problem and cannot evaluate the benefits over the costs correctly.


Replace branch with Note or Box and the issue is the same.


I don't see what is the difference to the example I originally posted. 
Just from the description you give it seems the same and I still don't 
see why the 'sourrounding layout' is necessarily the problem.


I suspect we are not talking about the same thing. With 2.3, if you 
typeset your example, you will get a bold "1" alone on the page. This is 
an empty section. IN master, you will get an empty document. Which is 
the one that makes sense to you?


Now that the real issue is fixed (hopefully correctly), you can change 
the Note font as you want, AFAIAC.


Doesn't ring a bell. I guess I could better understand what you mean if 
I could test the patch.


Currently, the note inset inherits on screen the font of the enclosing 
text (here a section layout). It is possible to change that so that, in 
a Section heading with large and bold characters, the note uses default 
font.


JMarc


Re: [LyX/master] Reset layout when inserting an inset over full paragraph(s)

2019-09-12 Thread Jean-Marc Lasgouttes

Le 12/09/2019 à 01:38, Pavel Sanda a écrit :

I like this patch. Is it safe to put it into my personal 2.3 patchset
(in the terms of the patch being congruent with old 2.3 codebase
or way too many changes were done around in 2.4?)


I like the patch too, and I checked that it applies almost cleanly 
(barring some indentation issues). I am going to work a bit with LyX 2.3 
in the coming months and having it would be good (although working with 
master would be more fun).


However, I am wary that there are workflows that I did not consider in 
the patch. This happened to me when I streamlined DEPM.


But if there is a consensus about 2.3, I am OK with it.

JMarc