Re: Re: Appendix sections are numbered incorrectly on screen (but do appear correctly on DVI/PDF)

2014-02-04 Thread José Matos
On Friday 10 May 2013 13:29:45 Richard Heck wrote:
> On 05/03/2013 01:48 PM, José Matos wrote:
> > Hi,
> > I got this report from a Fedora user: 
> > https://bugzilla.redhat.com/show_bug.cgi?id=955799
> 
> This has been fixed for 2.0.7 now.
> 
> Richard

While reviewing the bug to close it I noticed that the problem persists in 
2.0.7 but it is fixed on 2.1.0-dev.

The attached file shows the problem. Incidentally, LyXHTML shows the same 
problem (not surprising as the root cause is the same :-) ).

Regards,
-- 
José Abílio

wrong-appendix-heading.lyx
Description: application/lyx


Re: Re: Appendix sections are numbered incorrectly on screen (but do appear correctly on DVI/PDF)

2013-05-12 Thread José Matos
On Friday 10 May 2013 16:23:26 Richard Heck wrote:
> I think I will probably release 2.0.7 fairly early, as well. There are 
> some important fixes in it already, including this one. And, of course, 
> there's the update to the Portuguese translation to include. 
> 
> Richard

I only take the bait on Fridays. :-)

-- 
José Abílio


Re: Appendix sections are numbered incorrectly on screen (but do appear correctly on DVI/PDF)

2013-05-10 Thread Richard Heck

On 05/10/2013 02:23 PM, José Matos wrote:

On Friday 10 May 2013 13:29:45 Richard Heck wrote:

On 05/03/2013 01:48 PM, José Matos wrote:

Hi,
I got this report from a Fedora user: 
https://bugzilla.redhat.com/show_bug.cgi?id=955799

This has been fixed for 2.0.7 now.

Richard

Thank you.

I took the diff and transformed it into a patch. For the moment I will wait for 
lyx-2.0.6 to go to updates, as it is in updates-testing in Fedora 17, 18 and 19 
(in development), before releasing a new package with this patch applied.


I think I will probably release 2.0.7 fairly early, as well. There are 
some important fixes in it already, including this one. And, of course, 
there's the update to the Portuguese translation to include. ;-)


Richard



Re: Re: Appendix sections are numbered incorrectly on screen (but do appear correctly on DVI/PDF)

2013-05-10 Thread José Matos
On Friday 10 May 2013 13:29:45 Richard Heck wrote:
> On 05/03/2013 01:48 PM, José Matos wrote:
> > Hi,
> > I got this report from a Fedora user: 
> > https://bugzilla.redhat.com/show_bug.cgi?id=955799
> 
> This has been fixed for 2.0.7 now.
> 
> Richard

Thank you.

I took the diff and transformed it into a patch. For the moment I will wait for 
lyx-2.0.6 to go to updates, as it is in updates-testing in Fedora 17, 18 and 19 
(in development), before releasing a new package with this patch applied.

Regards,
-- 
José Abílio


Re: Appendix sections are numbered incorrectly on screen (but do appear correctly on DVI/PDF)

2013-05-10 Thread Richard Heck

On 05/03/2013 01:48 PM, José Matos wrote:

Hi,
I got this report from a Fedora user: 
https://bugzilla.redhat.com/show_bug.cgi?id=955799


This has been fixed for 2.0.7 now.

Richard



Re: Appendix sections are numbered incorrectly on screen (but do appear correctly on DVI/PDF)

2013-05-10 Thread Richard Heck

On 05/10/2013 10:40 AM, Uwe Stöhr wrote:

Am 03.05.2013 22:00, schrieb Richard Heck:

>>  Fix a long-standing FIXME by resetting only the counter for

top-level
 sectioning when we see an appendix. This fixes bug #8271, whose 
root

 cause was the fact that we were resetting all the counters inside
ERT.

Note that this commit is also in branch, at ecb65e70


I see this with articles, but not with books, as long as the appendix is
a chapter (which it should be).

Here is the relevant question: Shouldn't Part have toclevel -1?


It has. 


The problem is that in the layout files, it does not. From stdsections.inc:

Style Part
Category  Sectioning
MarginDynamic
LabelString   "Part \thepart"
LabelType Static
TocLevel  0
LabelCounter  part

This and similar stuff is what needs to be fixed.

Richard




Re: Appendix sections are numbered incorrectly on screen (but do appear correctly on DVI/PDF)

2013-05-10 Thread Uwe Stöhr

Am 03.05.2013 22:00, schrieb Richard Heck:

>>  Fix a long-standing FIXME by resetting only the counter for

top-level
 sectioning when we see an appendix. This fixes bug #8271, whose root
 cause was the fact that we were resetting all the counters inside
ERT.

Note that this commit is also in branch, at ecb65e70


I see this with articles, but not with books, as long as the appendix is
a chapter (which it should be).

Here is the relevant question: Shouldn't Part have toclevel -1?


It has. Articles don't have chapters, but parts, so we then have leven - 
1 for parts and 1 for sections but no 0.


However, your commit introduced a regression to LyX 2.0.4:
http://www.lyx.org/trac/ticket/8666

So I vote to revert your change until a better solution is found.

regards Uwe


Re: Appendix sections are numbered incorrectly on screen (but do appear correctly on DVI/PDF)

2013-05-03 Thread Richard Heck

On 05/03/2013 04:23 PM, Jean-Marc Lasgouttes wrote:

Le 03/05/2013 22:00, Richard Heck a écrit :

I see this with articles, but not with books, as long as the appendix is
a chapter (which it should be).

Here is the relevant question: Shouldn't Part have toclevel -1? We seem
to handle this inconsistently in the layout files. I test for toclevel
 >= 0 in the getTOCLayout() routine to try to ignore the Part counter,
but it seems to have toclevel 0 in many layouts. Same as Chapter. So we
find it first and reset that. So again: Shouldn't Parts be -1?


As far as I remeber, the levels we use are the same as what they are 
in the latex cls files. An article has no chapters, but it can have 
parts.


So, looking at this:

\newcommand*\l@part[2]{%
  \ifnum \c@tocdepth >-2\relax
\addpenalty\@secpenalty
etc...

That tells me that the tocdepth for part is -1, right? Thus:

\newcommand*\l@section[2]{%
  \ifnum \c@tocdepth >\z@
 etc

So tocdepth for section is 1.




There's another potential bug here involving unnumbered sections.
Probably I should also test whether the thing has an associated counter.


Unnumbered sections have no related counter AFAIK.


OK.


We would need to indicate in the layout format which counter is appendix.


Yes, if nothing else works, we can do that.

Richard



Re: Appendix sections are numbered incorrectly on screen (but do appear correctly on DVI/PDF)

2013-05-03 Thread Jean-Marc Lasgouttes

Le 03/05/2013 22:00, Richard Heck a écrit :

I see this with articles, but not with books, as long as the appendix is
a chapter (which it should be).

Here is the relevant question: Shouldn't Part have toclevel -1? We seem
to handle this inconsistently in the layout files. I test for toclevel
 >= 0 in the getTOCLayout() routine to try to ignore the Part counter,
but it seems to have toclevel 0 in many layouts. Same as Chapter. So we
find it first and reset that. So again: Shouldn't Parts be -1?


As far as I remeber, the levels we use are the same as what they are in 
the latex cls files. An article has no chapters, but it can have parts.



There's another potential bug here involving unnumbered sections.
Probably I should also test whether the thing has an associated counter.


Unnumbered sections have no related counter AFAIK. We would need to 
indicate in the layout format which counter is appendix.


JMarc




Re: Appendix sections are numbered incorrectly on screen (but do appear correctly on DVI/PDF)

2013-05-03 Thread Richard Heck

On 05/03/2013 03:25 PM, Scott Kostyshak wrote:

On Fri, May 3, 2013 at 2:28 PM, Scott Kostyshak  wrote:

On Fri, May 3, 2013 at 1:48 PM, José Matos  wrote:

The problem is that the section counter is not reset when the appendix starts 
in the lyx view but it is reset in the output. Honestly I am not sure if we 
have changed anything here recently, so I am not sure if this a bug or a 
missing feature. :-)

This is a regression. I will do a bisect.

The bisect led me to the following commit:

commit 894569e601ea1e0acb1adf92a0f168c10d6577dc
Author: Richard Heck 
Date:   Sat Jul 21 14:14:12 2012 -0400

 Fix a long-standing FIXME by resetting only the counter for top-level
 sectioning when we see an appendix. This fixes bug #8271, whose root
 cause was the fact that we were resetting all the counters inside ERT.

Note that this commit is also in branch, at ecb65e70


I see this with articles, but not with books, as long as the appendix is 
a chapter (which it should be).


Here is the relevant question: Shouldn't Part have toclevel -1? We seem 
to handle this inconsistently in the layout files. I test for toclevel 
>= 0 in the getTOCLayout() routine to try to ignore the Part counter, 
but it seems to have toclevel 0 in many layouts. Same as Chapter. So we 
find it first and reset that. So again: Shouldn't Parts be -1?


There's another potential bug here involving unnumbered sections. 
Probably I should also test whether the thing has an associated counter.


Richard



Re: Appendix sections are numbered incorrectly on screen (but do appear correctly on DVI/PDF)

2013-05-03 Thread Scott Kostyshak
On Fri, May 3, 2013 at 2:28 PM, Scott Kostyshak  wrote:
> On Fri, May 3, 2013 at 1:48 PM, José Matos  wrote:
>> The problem is that the section counter is not reset when the appendix 
>> starts in the lyx view but it is reset in the output. Honestly I am not sure 
>> if we have changed anything here recently, so I am not sure if this a bug or 
>> a missing feature. :-)
>
> This is a regression. I will do a bisect.

The bisect led me to the following commit:

commit 894569e601ea1e0acb1adf92a0f168c10d6577dc
Author: Richard Heck 
Date:   Sat Jul 21 14:14:12 2012 -0400

Fix a long-standing FIXME by resetting only the counter for top-level
sectioning when we see an appendix. This fixes bug #8271, whose root
cause was the fact that we were resetting all the counters inside ERT.

Note that this commit is also in branch, at ecb65e70

Scott


Re: Appendix sections are numbered incorrectly on screen (but do appear correctly on DVI/PDF)

2013-05-03 Thread Scott Kostyshak
On Fri, May 3, 2013 at 1:48 PM, José Matos  wrote:
> The problem is that the section counter is not reset when the appendix starts 
> in the lyx view but it is reset in the output. Honestly I am not sure if we 
> have changed anything here recently, so I am not sure if this a bug or a 
> missing feature. :-)

This is a regression. I will do a bisect.

Scott


Appendix sections are numbered incorrectly on screen (but do appear correctly on DVI/PDF)

2013-05-03 Thread José Matos
Hi,
I got this report from a Fedora user: 
https://bugzilla.redhat.com/show_bug.cgi?id=955799

"when using the "Document->Start Appendix Here", the counter for appendix 
sections is not being reset. Thus, when I have a document with, say, 4 numbered 
chapters, the appendix numbering displayed in LyX starts with an "E" instead of 
an "A", as it should be. Also, figures on the appendix are not being correctly 
numbered: LyX shows them just as "Figure 1", "Figure 2", etc., when the correct 
display would be "Figure A.1", "Figure A.2" and so on."

The problem is that the section counter is not reset when the appendix starts 
in the lyx view but it is reset in the output. Honestly I am not sure if we 
have changed anything here recently, so I am not sure if this a bug or a 
missing feature. :-)

The problem seems to be that the appendix marker does not reset the proper 
counters.

I have an example attached, written in lyx-2.1, but the same problem occurs in 
lyx-2.0.5.1

Regards,
-- 
José Abílio

fedora-bug-955799.lyx
Description: application/lyx