From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/23872 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: No partial contents for parts after the first Date: Mon, 28 Nov 2005 14:03:13 +0100 Message-ID: <438B0011.1040300@wxs.nl> References: <676436556.20051124202641@iol.it> <1181515002.20051125192454@iol.it> <1481653777.20051126150304@iol.it> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1133183102 13588 80.91.229.2 (28 Nov 2005 13:05:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Nov 2005 13:05:02 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Nov 28 14:05:01 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1EgifA-0006Ku-2K for gctc-ntg-context-518@m.gmane.org; Mon, 28 Nov 2005 14:03:20 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C9A9D128A4; Mon, 28 Nov 2005 14:03:19 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06204-04-12; Mon, 28 Nov 2005 14:03:16 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id F168E12820; Mon, 28 Nov 2005 14:03:15 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3046112820 for ; Mon, 28 Nov 2005 14:03:15 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06204-04-11 for ; Mon, 28 Nov 2005 14:03:14 +0100 (CET) Original-Received: from controller-1 (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with ESMTP id D9ED9127B9 for ; Mon, 28 Nov 2005 14:03:13 +0100 (CET) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 5346 for ; Mon, 28 Nov 2005 14:08:04 +0300 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <1481653777.20051126150304@iol.it> X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:23872 Archived-At: Giuseppe Bilotta wrote: >Friday, November 25, 2005 Giuseppe Bilotta wrote: > > =20 > >>Thursday, November 24, 2005 Giuseppe Bilotta wrote: >> =20 >> > > =20 > >>>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 >>> =20 >>> > > =20 > >>>\part{some part} >>> =20 >>> > > =20 > >>>Some text (not always) >>> =20 >>> > > =20 > >>>\placecontent >>> =20 >>> > > =20 > >>>\chapter{some chapter} >>> =20 >>> > > =20 > >>>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 >>> =20 >>> > > =20 > >>>system : part,chapter,section,subsection not found/processed >>> =20 >>> > > > =20 > >>>The setup for the contents is as follows: >>> =20 >>> > > =20 > >>>\setupcombinedlist[content] >>> [interaction=3Dall, >>> partnumber=3Dno, >>> alternative=3Dc, >>> level=3Dsubsection] >>> =20 >>> > > =20 > >>>\setuphead[part][alternative=3Dmiddle,placehead=3Dyes,resetnumber=3Dno= ] >>> =20 >>> > > =20 > >>>The problem is the 'resetnumber': if I take that off, >>>everything works perfectly. >>> =20 >>> > > =20 > >>I've been debugging this, and the reason for the thing not >>coming up for parts after the first is that when >>resetnumber=3Dno the current level is not properly detected: >>in one case you get >> =20 >> > > =20 > >>\currentlevel ->:1 >> =20 >> > > =20 > >>in the other >> =20 >> > > =20 > >>\currentlevel ->:2:2:4:2 >> =20 >> > > =20 > >>Which is obviously wrong. Indeed, the problem is here: >> =20 >> > > =20 > >>\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=EF=BF=BDzier cubic >>analysis}{2::2:3:0:0:0:0:0::35}{36} >> =20 >> > > =20 > >>OOOPSIE! Since resetnumber=3Dno, 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=3Dno), 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'. >> =20 >> > > =20 > >>Can this be fixed? >> =20 >> > > >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=3D\v!yes]}}% > >% New command preserves the value of the next sectionlevel >% when resetnumber=3Dno > >\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=3Dno, some with the usual resetnumber; >sectionblocks etc). It works, and fixes the placecontent not >working. Will this go into mainline? > > =20 > no problem, until some other problem shows up -) Hans