Re: Footnote size is larger on master (\normalsize is prepended)

2021-11-02 Thread Jean-Marc Lasgouttes

Le 01/11/2021 à 10:29, Jürgen Spitzmüller a écrit :

Am Montag, dem 01.11.2021 um 09:56 +0100 schrieb Jürgen Spitzmüller:

(2.) revert b37929fd to correct the workarea font in footnotes (which
otherwise inherits the font of the context, e.g. section)

JMarc, what do you think about (2.)? It was part of your series to
address #12204.


On another look I tend to think that, rather than overwriting metrics
and draw in individual insets, we would need a method similar to
inheritFont() which only applies to screen font (I thought that
resetsFonEdit() is that, but it isn't).


I do not see the needed for treating the screen differently from the lyx 
file. I'll try to propose something, but currently I do not have much 
free time.


JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: master crash (tocwidget code)

2021-11-02 Thread Jürgen Spitzmüller
Am Montag, dem 01.11.2021 um 22:51 +0100 schrieb Pavel Sanda:
> I don't know the code in question either, but I can try to look later
> this week.

OTOH we test for empty toc_ in several other places of the TocModel, so
the check the patch adds might be reasonable (maybe the toc is not yet
re-created at that point).

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: Footnote size is larger on master (\normalsize is prepended)

2021-11-02 Thread Jürgen Spitzmüller
Am Montag, dem 01.11.2021 um 15:27 -0400 schrieb Scott Kostyshak:
> Fixes the original issue from what I can see, although I know nothing
> about the code. I'm not sure if the following is a related issue. See
> attached. It's hard to see, but the in-line footnote number itself is
> now bold on master. Note the "\bfseries" in the difference in TeX
> code
> produced below.
> 
> master with your patch:
> 
>   To set the bracket size for the second line correctly, the first
> line
>   is ended with \textbf{\textbackslash
> right.}\index{Commands!R!right@\textbackslash right}
>   and the second line with \textbf{\textbackslash
> left.}{\bfseries\footnote{for more about \textbf{\textbackslash left}
> and \textbf{\textbackslash right}
> 
> 2.3.x:
> 
>   To set the bracket size for the second line correctly, the first
> line
>   is ended with \textbf{\textbackslash
> right.}\index{Commands!R!right@\textbackslash right}
>   and the second line with \textbf{\textbackslash left.}\footnote{for
> more about \textbf{\textbackslash left} and \textbf{\textbackslash
> right}

I'd need to see the LyX file, but if the footnote itself is set bold
there, master is correct and stable is wrong. This is something we
fixed in master.

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: Footnote size is larger on master (\normalsize is prepended)

2021-11-02 Thread Jean-Marc Lasgouttes

Le 02/11/2021 à 14:45, Jürgen Spitzmüller a écrit :

Am Dienstag, dem 02.11.2021 um 14:08 +0100 schrieb Jean-Marc
Lasgouttes:

I do not see the needed for treating the screen differently from the
lyx file.


My point was to differentiate inheritance of font properties on screen
from inheritance in the TeX output (nothing to do with the LyX file).
Some contexts (footnote is a case in point) require us to use different
font on screen but not change the font in output (as this is done by
the contexts themselves). So footnote should inheritFont() but not
inheritScreenFont(). This is not possible with the current mechanism
(and it only worked since font metrics were hardcoded in InsetFootlike
before you removed that hardcoding).


Why do you want to inherit anything for the footnote? OK, it turns out 
that using \normalfont (as \footnotetext does) resets everything but the 
font size (I believe), but footnote does reset the font completely. And 
I think that it makes sense that it does that. So the font at the point 
where the footnote is is not relevant semantically.


Since we have had this discussion already, so I guess the point is that 
you disagree with me. Otherwise, I think I know how we could coerce 
lyx2lyx to convert from resetfont to inheritfont.


JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Footnote size is larger on master (\normalsize is prepended)

2021-11-02 Thread Jürgen Spitzmüller
Am Dienstag, dem 02.11.2021 um 14:08 +0100 schrieb Jean-Marc
Lasgouttes:
> I do not see the needed for treating the screen differently from the
> lyx file. 

My point was to differentiate inheritance of font properties on screen
from inheritance in the TeX output (nothing to do with the LyX file).
Some contexts (footnote is a case in point) require us to use different
font on screen but not change the font in output (as this is done by
the contexts themselves). So footnote should inheritFont() but not
inheritScreenFont(). This is not possible with the current mechanism
(and it only worked since font metrics were hardcoded in InsetFootlike
before you removed that hardcoding).

> I'll try to propose something, but currently I do not have much
> free time.

OK.

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: Footnote size is larger on master (\normalsize is prepended)

2021-11-02 Thread Jürgen Spitzmüller
Am Dienstag, dem 02.11.2021 um 15:40 +0100 schrieb Jean-Marc
Lasgouttes:
> Why do you want to inherit anything for the footnote? OK, it turns
> out that using \normalfont (as \footnotetext does) resets everything
> but the font size (I believe), but footnote does reset the font
> completely.

With inheritFont() == false, we end up in unnecessary font switches at
footnote start, e.g. \footnote{\normalsize text ...} in section
headings (see Scott's example), and I want to avoid that.

With inheritFont() == true, these switches are gone (as it should be),
but the font in the workarea is wrong.

resetsFontEdit() (layout's ResetsFont) does not help here, it does
something different (don't ask me, what).

If we are stuck with the current choices, I'd rather prefer wrong
workarea font that cluttered LaTeX output. 

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: Footnote size is larger on master (\normalsize is prepended)

2021-11-02 Thread Jürgen Spitzmüller
Am Dienstag, dem 02.11.2021 um 15:52 +0100 schrieb Jürgen Spitzmüller:
> With inheritFont() == false, we end up in unnecessary font switches
> at footnote start, e.g. \footnote{\normalsize text ...} in section
> headings (see Scott's example), and I want to avoid that.

And note that this is not only cosmetic, but also wrong, as this resets
the footnote text size from \footnotesize to \normalsize. See attached
example and compare the output (both TeX and PDF) in stable and master.

Jürgen



footnote-size-is-different.23.lyx
Description: application/lyx


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


Qt6 crash

2021-11-02 Thread Jürgen Spitzmüller
I just notices that, when compiling master against Qt 6.2.0, LyX
crashes reliably at document compilation (somewhere in QFutureWatcher).

Can anyone confirm or is this something on my end?

Thanks,
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: master crash (tocwidget code)

2021-11-02 Thread Pavel Sanda
On Tue, Nov 02, 2021 at 08:08:05AM +0100, Jürgen Spitzmüller wrote:
> Am Montag, dem 01.11.2021 um 22:51 +0100 schrieb Pavel Sanda:
> > I don't know the code in question either, but I can try to look later
> > this week.
> 
> OTOH we test for empty toc_ in several other places of the TocModel, so
> the check the patch adds might be reasonable

Yes.

> (maybe the toc is not yet re-created at that point).

I believe something else is going on.

When you add something like
+++ b/src/frontends/qt/TocModel.cpp
@@ -327,6 +330,7 @@ TocItem const TocModels::currentItem(QString const & type,
}
LASSERT(index.model() == it.value()->model(), return TocItem());
 
+ lyxerrempty() << "\n";
return it.value()->tocItem(index);
 }
 

You can see steady flow of identical lines, e.g.
tableofcontents 0x55a7b8d94af8 0x55a7b9c931f0 0

associated with the first window. Then you create second window
open new view of the same file and get steady flow of second type e.g.

tableofcontents 0x55a7ba5e5438 0x55a7ba817910 0 

until the last line before crash
tableofcontents 0x55a7b8d94af8 0x55a7b9c931f0 1

which is again pointing to structure associated with window 1
but now empty. So instead of missing initialization we likely
destroy the content of first structure meanwhile.

We call various reset() and clear() routines many many times,
and its unclear to me why we repeatedlt call the whole machinery.

My time for this issue is spent for today...
Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Footnote size is larger on master (\normalsize is prepended)

2021-11-02 Thread Scott Kostyshak
On Tue, Nov 02, 2021 at 08:33:47AM +0100, Jürgen Spitzmüller wrote:
> Am Montag, dem 01.11.2021 um 15:27 -0400 schrieb Scott Kostyshak:
> > Fixes the original issue from what I can see, although I know nothing
> > about the code. I'm not sure if the following is a related issue. See
> > attached. It's hard to see, but the in-line footnote number itself is
> > now bold on master. Note the "\bfseries" in the difference in TeX
> > code
> > produced below.
> > 
> > master with your patch:
> > 
> >   To set the bracket size for the second line correctly, the first
> > line
> >   is ended with \textbf{\textbackslash
> > right.}\index{Commands!R!right@\textbackslash right}
> >   and the second line with \textbf{\textbackslash
> > left.}{\bfseries\footnote{for more about \textbf{\textbackslash left}
> > and \textbf{\textbackslash right}
> > 
> > 2.3.x:
> > 
> >   To set the bracket size for the second line correctly, the first
> > line
> >   is ended with \textbf{\textbackslash
> > right.}\index{Commands!R!right@\textbackslash right}
> >   and the second line with \textbf{\textbackslash left.}\footnote{for
> > more about \textbf{\textbackslash left} and \textbf{\textbackslash
> > right}
> 
> I'd need to see the LyX file, but if the footnote itself is set bold
> there, master is correct and stable is wrong. This is something we
> fixed in master.

Thanks for taking a look. I see, so master behavior is correct. I think
in most cases the intent is to not have it bold, i.e., I might look into
removing the bold in the .lyx files if I am motivated.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Qt6 crash

2021-11-02 Thread Stephan Witt
Am 02.11.2021 um 17:11 schrieb Jürgen Spitzmüller :
> 
> I just notices that, when compiling master against Qt 6.2.0, LyX
> crashes reliably at document compilation (somewhere in QFutureWatcher).
> 
> Can anyone confirm or is this something on my end?

I’ve built master with Qt 6.2.0 on Mac and it doesn’t crash. I’m compiling the 
UG with pdflatex.

Stephan

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel