ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* No partial contents for parts after the first
@ 2005-11-24 19:26 Giuseppe Bilotta
  2005-11-25 17:37 ` Giuseppe Bilotta
  2005-11-25 18:24 ` Giuseppe Bilotta
  0 siblings, 2 replies; 7+ messages in thread
From: Giuseppe Bilotta @ 2005-11-24 19:26 UTC (permalink / raw)


I'm using the latest ConTeXt reported here, and I'm noticing
that partial contents for the second, third etc part are not
available. I have a bunch of files each of which goes like

\part{some part}

Some text (not always)

\placecontent

\chapter{some chapter}

Each of this file is \input from the master file. However,
only in the first part you actually see the (part-specific)
content: every other part reports

system          : part,chapter,section,subsection not found/processed


The setup for the contents is as follows:

\setupcombinedlist[content]
  [interaction=all,
   partnumber=no,
   alternative=c,
   level=subsection]

\setuphead[part][alternative=middle,placehead=yes,resetnumber=no]

The problem is the 'resetnumber': if I take that off,
everything works perfectly.

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: No partial contents for parts after the first
  2005-11-24 19:26 No partial contents for parts after the first Giuseppe Bilotta
@ 2005-11-25 17:37 ` Giuseppe Bilotta
  2005-11-25 18:24 ` Giuseppe Bilotta
  1 sibling, 0 replies; 7+ messages in thread
From: Giuseppe Bilotta @ 2005-11-25 17:37 UTC (permalink / raw)


Thursday, November 24, 2005 Giuseppe Bilotta wrote:

> I'm using the latest ConTeXt reported here, and I'm noticing
> that partial contents for the second, third etc part are not
> available. I have a bunch of files each of which goes like

> \part{some part}

> Some text (not always)

> \placecontent

> \chapter{some chapter}

> Each of this file is \input from the master file. However,
> only in the first part you actually see the (part-specific)
> content: every other part reports

> system          : part,chapter,section,subsection not found/processed


> The setup for the contents is as follows:

> \setupcombinedlist[content]
>   [interaction=all,
>    partnumber=no,
>    alternative=c,
>    level=subsection]

> \setuphead[part][alternative=middle,placehead=yes,resetnumber=no]

> The problem is the 'resetnumber': if I take that off,
> everything works perfectly.

Can somebody please look into this? It's the last thing I
need to print my thesis ...

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: No partial contents for parts after the first
  2005-11-24 19:26 No partial contents for parts after the first Giuseppe Bilotta
  2005-11-25 17:37 ` Giuseppe Bilotta
@ 2005-11-25 18:24 ` Giuseppe Bilotta
  2005-11-26 14:03   ` Re[2]: " Giuseppe Bilotta
  2005-11-28 13:01   ` Hans Hagen
  1 sibling, 2 replies; 7+ messages in thread
From: Giuseppe Bilotta @ 2005-11-25 18:24 UTC (permalink / raw)


Thursday, November 24, 2005 Giuseppe Bilotta wrote:

> I'm using the latest ConTeXt reported here, and I'm noticing
> that partial contents for the second, third etc part are not
> available. I have a bunch of files each of which goes like

> \part{some part}

> Some text (not always)

> \placecontent

> \chapter{some chapter}

> Each of this file is \input from the master file. However,
> only in the first part you actually see the (part-specific)
> content: every other part reports

> system          : part,chapter,section,subsection not found/processed


> The setup for the contents is as follows:

> \setupcombinedlist[content]
>   [interaction=all,
>    partnumber=no,
>    alternative=c,
>    level=subsection]

> \setuphead[part][alternative=middle,placehead=yes,resetnumber=no]

> The problem is the 'resetnumber': if I take that off,
> everything works perfectly.

I've been debugging this, and the reason for the thing not
coming up for parts after the first is that when
resetnumber=no the current level is not properly detected:
in one case you get

\currentlevel ->:1

in the other

\currentlevel ->:2:2:4:2

Which is obviously wrong. Indeed, the problem is here:

\listentry{part}{1}{1}{Introduction}{2::1:0:0:0:0:0:0::7}{8}
\listentry{chapter}{2}{1}{Presentation}{2::1:1:0:0:0:0:0::8}{9}
\listentry{section}{3}{1.1}{History and motivation}{2::1:1:1:0:0:0:0::8}{9}
\listentry{chapter}{11}{2}{The basics}{2::1:2:0:0:0:0:0::12}{13}
\listentry{section}{12}{2.1}{Notation}{2::1:2:1:0:0:0:0::12}{13}
(more stuff)
\listentry{subsection}{78}{2.4.2}{Scaling the coordinate system}{2::1:2:4:2:0:0:0::31}{32}
\listentry{part}{79}{2}{Mathematical tools}{2::2:2:4:2:0:0:0::34}{35}
\listentry{chapter}{82}{3}{Bézier cubic analysis}{2::2:3:0:0:0:0:0::35}{36}

OOOPSIE! Since resetnumber=no, the listentry keeps the old
settings for chapter, section & the like. This is obviously
wrong. Even if the number is not reset, the sectionformat
*must* be reset, since at the beginning of the new
higher section(level) you are not in the previous one
anymore. So for example when starting a new part (with
resetnumber=no), and until
the first chapter of the new part is started we are in
chapter 0 for that part, not in chapter
'last-chapter-from-previous-part'.

Can this be fixed?

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re[2]: No partial contents for parts after the first
  2005-11-25 18:24 ` Giuseppe Bilotta
@ 2005-11-26 14:03   ` Giuseppe Bilotta
  2005-11-28 13:03     ` Hans Hagen
  2005-11-28 13:01   ` Hans Hagen
  1 sibling, 1 reply; 7+ messages in thread
From: Giuseppe Bilotta @ 2005-11-26 14:03 UTC (permalink / raw)


Friday, November 25, 2005 Giuseppe Bilotta wrote:

> Thursday, November 24, 2005 Giuseppe Bilotta wrote:

>> I'm using the latest ConTeXt reported here, and I'm noticing
>> that partial contents for the second, third etc part are not
>> available. I have a bunch of files each of which goes like

>> \part{some part}

>> Some text (not always)

>> \placecontent

>> \chapter{some chapter}

>> Each of this file is \input from the master file. However,
>> only in the first part you actually see the (part-specific)
>> content: every other part reports

>> system          : part,chapter,section,subsection not found/processed


>> The setup for the contents is as follows:

>> \setupcombinedlist[content]
>>   [interaction=all,
>>    partnumber=no,
>>    alternative=c,
>>    level=subsection]

>> \setuphead[part][alternative=middle,placehead=yes,resetnumber=no]

>> The problem is the 'resetnumber': if I take that off,
>> everything works perfectly.

> I've been debugging this, and the reason for the thing not
> coming up for parts after the first is that when
> resetnumber=no the current level is not properly detected:
> in one case you get

> \currentlevel ->:1

> in the other

> \currentlevel ->:2:2:4:2

> Which is obviously wrong. Indeed, the problem is here:

> \listentry{part}{1}{1}{Introduction}{2::1:0:0:0:0:0:0::7}{8}
> \listentry{chapter}{2}{1}{Presentation}{2::1:1:0:0:0:0:0::8}{9}
> \listentry{section}{3}{1.1}{History and
> motivation}{2::1:1:1:0:0:0:0::8}{9}
> \listentry{chapter}{11}{2}{The
> basics}{2::1:2:0:0:0:0:0::12}{13}
> \listentry{section}{12}{2.1}{Notation}{2::1:2:1:0:0:0:0::12}{13}
> (more stuff)
> \listentry{subsection}{78}{2.4.2}{Scaling the
> coordinate system}{2::1:2:4:2:0:0:0::31}{32}
> \listentry{part}{79}{2}{Mathematical
> tools}{2::2:2:4:2:0:0:0::34}{35}
> \listentry{chapter}{82}{3}{Bézier cubic
> analysis}{2::2:3:0:0:0:0:0::35}{36}

> OOOPSIE! Since resetnumber=no, the listentry keeps the old
> settings for chapter, section & the like. This is obviously
> wrong. Even if the number is not reset, the sectionformat
> *must* be reset, since at the beginning of the new
> higher section(level) you are not in the previous one
> anymore. So for example when starting a new part (with
> resetnumber=no), and until
> the first chapter of the new part is started we are in
> chapter 0 for that part, not in chapter
> 'last-chapter-from-previous-part'.

> Can this be fixed?


Ok, I came up with a solution that seems to work:

\def\definesection[#1]%
  {\doifundefined{\??se#1}
     {\doifelsenothing\firstsection
        {\def\firstsection{#1}%
         \setevalue{\??se#1\c!before}{\v!text}%
         \setevalue{\??se\v!text\c!after}{#1}}
        {\setevalue{\??se\commalistelement\c!after}{#1}%
         \setevalue{\??se#1\c!before}{\lastsection}%
         \setevalue{\??se\lastsection\c!after}{#1}}%
      \advance\nofsections \plusone
      \setevalue{\??se#1\c!level}{\the\nofsections}%
      \letvalue{\??se#1\c!after}\empty
      \setvalue{\e!next#1}{\@@nextsectionnumber{#1}}%
      \setvalue{#1\c!number}{\@@longsectionnumber{#1}}%
      \setvalue{#1\s!format}{\@@longformatnumber{#1}}%
      \setevalue{\??by#1}{#1}%
      \setevalue{\??by\v!by#1}{#1}%
      \makecounter{\??se#1}%
      \makecounter{\??se lastvalueof#1}% GB
      \edef\lastsection{#1}%
      \setvalue{\??sk#1}{#1}%
      \letvalue{\??se#1\c!marking}\empty
      \setupsection[#1][\c!previousnumber=\v!yes]}}%

% New command preserves the value of the next sectionlevel
% when resetnumber=no

\def\checkpreservevalueafter#1%
  {\ifnum\getvalue{\??se#1\c!level}<\the\nofsections
     \edef\preservedsection{\getvalue{\??se#1\c!after}}%
     \ifconditional\@@resetsubheadnumbers
       \setcounter{\??se lastvalueof\preservedsection}%
                  {0}%
     \else
       \setcounter{\??se lastvalueof\preservedsection}%
                  {\countervalue{\??se\preservedsection}}%
     \fi
   \fi}

\def\@@setsectionnumber#1#2%
  {\letgvalueempty{\??se#1\s!start}% signal i.p.v. boolean
   \setcounter{\??se#1}{#2}%
   \checkpreservevalueafter{#1}
   \resetsectioncounters{#1}
   \checkpagecounter}

\def\@@nextsectionnumber#1%
  {\letgvalueempty{\??se#1\s!start}% signal i.p.v. boolean
   \ifnum\countervalue{\??se lastvalueof#1}>\zerocount
     \setcounter{\??se#1}{\countervalue{\??se lastvalueof#1}}
     \setcounter{\??se lastvalueof#1}{0}
   \fi
   \pluscounter{\??se#1}%
   \checkpreservevalueafter{#1}
   \resetsectioncounters{#1}
   \checkpagecounter}

This has been tested in a fairly complex document (some
levels with resetnumber=no, some with the usual resetnumber;
sectionblocks etc). It works, and fixes the placecontent not
working. Will this go into mainline?

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: No partial contents for parts after the first
  2005-11-25 18:24 ` Giuseppe Bilotta
  2005-11-26 14:03   ` Re[2]: " Giuseppe Bilotta
@ 2005-11-28 13:01   ` Hans Hagen
  2005-11-28 15:49     ` Re[2]: " Giuseppe Bilotta
  1 sibling, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2005-11-28 13:01 UTC (permalink / raw)


Giuseppe Bilotta wrote:

>
>I've been debugging this, and the reason for the thing not
>coming up for parts after the first is that when
>resetnumber=no the current level is not properly detected:
>in one case you get
>
>\currentlevel ->:1
>
>in the other
>
>\currentlevel ->:2:2:4:2
>
>Which is obviously wrong. Indeed, the problem is here:
>
>\listentry{part}{1}{1}{Introduction}{2::1:0:0:0:0:0:0::7}{8}
>\listentry{chapter}{2}{1}{Presentation}{2::1:1:0:0:0:0:0::8}{9}
>\listentry{section}{3}{1.1}{History and motivation}{2::1:1:1:0:0:0:0::8}{9}
>\listentry{chapter}{11}{2}{The basics}{2::1:2:0:0:0:0:0::12}{13}
>\listentry{section}{12}{2.1}{Notation}{2::1:2:1:0:0:0:0::12}{13}
>(more stuff)
>\listentry{subsection}{78}{2.4.2}{Scaling the coordinate system}{2::1:2:4:2:0:0:0::31}{32}
>\listentry{part}{79}{2}{Mathematical tools}{2::2:2:4:2:0:0:0::34}{35}
>\listentry{chapter}{82}{3}{B�zier cubic analysis}{2::2:3:0:0:0:0:0::35}{36}
>
>OOOPSIE! Since resetnumber=no, the listentry keeps the old
>settings for chapter, section & the like. This is obviously
>wrong. Even if the number is not reset, the sectionformat
>*must* be reset, since at the beginning of the new
>higher section(level) you are not in the previous one
>anymore. So for example when starting a new part (with
>resetnumber=no), and until
>the first chapter of the new part is started we are in
>chapter 0 for that part, not in chapter
>'last-chapter-from-previous-part'.
>
>Can this be fixed?
>
>  
>
sure, but i need a small test file -)

Hans

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: No partial contents for parts after the first
  2005-11-26 14:03   ` Re[2]: " Giuseppe Bilotta
@ 2005-11-28 13:03     ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2005-11-28 13:03 UTC (permalink / raw)


Giuseppe Bilotta wrote:

>Friday, November 25, 2005 Giuseppe Bilotta wrote:
>
>  
>
>>Thursday, November 24, 2005 Giuseppe Bilotta wrote:
>>    
>>
>
>  
>
>>>I'm using the latest ConTeXt reported here, and I'm noticing
>>>that partial contents for the second, third etc part are not
>>>available. I have a bunch of files each of which goes like
>>>      
>>>
>
>  
>
>>>\part{some part}
>>>      
>>>
>
>  
>
>>>Some text (not always)
>>>      
>>>
>
>  
>
>>>\placecontent
>>>      
>>>
>
>  
>
>>>\chapter{some chapter}
>>>      
>>>
>
>  
>
>>>Each of this file is \input from the master file. However,
>>>only in the first part you actually see the (part-specific)
>>>content: every other part reports
>>>      
>>>
>
>  
>
>>>system          : part,chapter,section,subsection not found/processed
>>>      
>>>
>
>
>  
>
>>>The setup for the contents is as follows:
>>>      
>>>
>
>  
>
>>>\setupcombinedlist[content]
>>>  [interaction=all,
>>>   partnumber=no,
>>>   alternative=c,
>>>   level=subsection]
>>>      
>>>
>
>  
>
>>>\setuphead[part][alternative=middle,placehead=yes,resetnumber=no]
>>>      
>>>
>
>  
>
>>>The problem is the 'resetnumber': if I take that off,
>>>everything works perfectly.
>>>      
>>>
>
>  
>
>>I've been debugging this, and the reason for the thing not
>>coming up for parts after the first is that when
>>resetnumber=no the current level is not properly detected:
>>in one case you get
>>    
>>
>
>  
>
>>\currentlevel ->:1
>>    
>>
>
>  
>
>>in the other
>>    
>>
>
>  
>
>>\currentlevel ->:2:2:4:2
>>    
>>
>
>  
>
>>Which is obviously wrong. Indeed, the problem is here:
>>    
>>
>
>  
>
>>\listentry{part}{1}{1}{Introduction}{2::1:0:0:0:0:0:0::7}{8}
>>\listentry{chapter}{2}{1}{Presentation}{2::1:1:0:0:0:0:0::8}{9}
>>\listentry{section}{3}{1.1}{History and
>>motivation}{2::1:1:1:0:0:0:0::8}{9}
>>\listentry{chapter}{11}{2}{The
>>basics}{2::1:2:0:0:0:0:0::12}{13}
>>\listentry{section}{12}{2.1}{Notation}{2::1:2:1:0:0:0:0::12}{13}
>>(more stuff)
>>\listentry{subsection}{78}{2.4.2}{Scaling the
>>coordinate system}{2::1:2:4:2:0:0:0::31}{32}
>>\listentry{part}{79}{2}{Mathematical
>>tools}{2::2:2:4:2:0:0:0::34}{35}
>>\listentry{chapter}{82}{3}{B�zier cubic
>>analysis}{2::2:3:0:0:0:0:0::35}{36}
>>    
>>
>
>  
>
>>OOOPSIE! Since resetnumber=no, the listentry keeps the old
>>settings for chapter, section & the like. This is obviously
>>wrong. Even if the number is not reset, the sectionformat
>>*must* be reset, since at the beginning of the new
>>higher section(level) you are not in the previous one
>>anymore. So for example when starting a new part (with
>>resetnumber=no), and until
>>the first chapter of the new part is started we are in
>>chapter 0 for that part, not in chapter
>>'last-chapter-from-previous-part'.
>>    
>>
>
>  
>
>>Can this be fixed?
>>    
>>
>
>
>Ok, I came up with a solution that seems to work:
>
>\def\definesection[#1]%
>  {\doifundefined{\??se#1}
>     {\doifelsenothing\firstsection
>        {\def\firstsection{#1}%
>         \setevalue{\??se#1\c!before}{\v!text}%
>         \setevalue{\??se\v!text\c!after}{#1}}
>        {\setevalue{\??se\commalistelement\c!after}{#1}%
>         \setevalue{\??se#1\c!before}{\lastsection}%
>         \setevalue{\??se\lastsection\c!after}{#1}}%
>      \advance\nofsections \plusone
>      \setevalue{\??se#1\c!level}{\the\nofsections}%
>      \letvalue{\??se#1\c!after}\empty
>      \setvalue{\e!next#1}{\@@nextsectionnumber{#1}}%
>      \setvalue{#1\c!number}{\@@longsectionnumber{#1}}%
>      \setvalue{#1\s!format}{\@@longformatnumber{#1}}%
>      \setevalue{\??by#1}{#1}%
>      \setevalue{\??by\v!by#1}{#1}%
>      \makecounter{\??se#1}%
>      \makecounter{\??se lastvalueof#1}% GB
>      \edef\lastsection{#1}%
>      \setvalue{\??sk#1}{#1}%
>      \letvalue{\??se#1\c!marking}\empty
>      \setupsection[#1][\c!previousnumber=\v!yes]}}%
>
>% New command preserves the value of the next sectionlevel
>% when resetnumber=no
>
>\def\checkpreservevalueafter#1%
>  {\ifnum\getvalue{\??se#1\c!level}<\the\nofsections
>     \edef\preservedsection{\getvalue{\??se#1\c!after}}%
>     \ifconditional\@@resetsubheadnumbers
>       \setcounter{\??se lastvalueof\preservedsection}%
>                  {0}%
>     \else
>       \setcounter{\??se lastvalueof\preservedsection}%
>                  {\countervalue{\??se\preservedsection}}%
>     \fi
>   \fi}
>
>\def\@@setsectionnumber#1#2%
>  {\letgvalueempty{\??se#1\s!start}% signal i.p.v. boolean
>   \setcounter{\??se#1}{#2}%
>   \checkpreservevalueafter{#1}
>   \resetsectioncounters{#1}
>   \checkpagecounter}
>
>\def\@@nextsectionnumber#1%
>  {\letgvalueempty{\??se#1\s!start}% signal i.p.v. boolean
>   \ifnum\countervalue{\??se lastvalueof#1}>\zerocount
>     \setcounter{\??se#1}{\countervalue{\??se lastvalueof#1}}
>     \setcounter{\??se lastvalueof#1}{0}
>   \fi
>   \pluscounter{\??se#1}%
>   \checkpreservevalueafter{#1}
>   \resetsectioncounters{#1}
>   \checkpagecounter}
>
>This has been tested in a fairly complex document (some
>levels with resetnumber=no, some with the usual resetnumber;
>sectionblocks etc). It works, and fixes the placecontent not
>working. Will this go into mainline?
>
>  
>
no problem, until some other problem shows up -)

Hans

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re[2]: No partial contents for parts after the first
  2005-11-28 13:01   ` Hans Hagen
@ 2005-11-28 15:49     ` Giuseppe Bilotta
  0 siblings, 0 replies; 7+ messages in thread
From: Giuseppe Bilotta @ 2005-11-28 15:49 UTC (permalink / raw)


Monday, November 28, 2005 Hans Hagen wrote:

> sure, but i need a small test file -)

\setuphead[part][placehead=yes,resetnumber=no]

\starttext

\part{Part one}

\placecontent

\chapter{One}

\section{One-one}

\chapter{Two}

\section{Two-one}

\part{Part two}

\placecontent

\chapter{Three}

\chapter{Four}

\section{Four-one}

\stoptext

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-11-28 15:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-24 19:26 No partial contents for parts after the first Giuseppe Bilotta
2005-11-25 17:37 ` Giuseppe Bilotta
2005-11-25 18:24 ` Giuseppe Bilotta
2005-11-26 14:03   ` Re[2]: " Giuseppe Bilotta
2005-11-28 13:03     ` Hans Hagen
2005-11-28 13:01   ` Hans Hagen
2005-11-28 15:49     ` Re[2]: " Giuseppe Bilotta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).