From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/24599 Path: news.gmane.org!not-for-mail From: David Arnold Newsgroups: gmane.comp.tex.context Subject: Re: \useblocks in section Date: Wed, 21 Dec 2005 10:57:10 -0800 Message-ID: <42754BE3-0CE7-45BD-98EE-18AC47A348D8@cox.net> References: <1598EE78-9D8E-4415-A091-BA4D69ECF5DE@cox.net> <43A92091.8000700@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1135191680 22740 80.91.229.2 (21 Dec 2005 19:01:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Dec 2005 19:01:20 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Dec 21 20:01:15 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 1Ep9AX-0006mo-K1 for gctc-ntg-context-518@m.gmane.org; Wed, 21 Dec 2005 19:58:33 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2B9D41280F; Wed, 21 Dec 2005 19:58:33 +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 01770-02; Wed, 21 Dec 2005 19:58:27 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DA2FD1285A; Wed, 21 Dec 2005 19:58:27 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E45F91285A for ; Wed, 21 Dec 2005 19:58:26 +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 01797-03-4 for ; Wed, 21 Dec 2005 19:58:25 +0100 (CET) Original-Received: from fed1rmmtao09.cox.net (fed1rmmtao09.cox.net [68.230.241.30]) by ronja.ntg.nl (Postfix) with ESMTP id 57CC21280F for ; Wed, 21 Dec 2005 19:58:24 +0100 (CET) Original-Received: from [10.0.1.2] (really [70.191.56.23]) by fed1rmmtao09.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20051221185826.LXET25099.fed1rmmtao09.cox.net@[10.0.1.2]> for ; Wed, 21 Dec 2005 13:58:26 -0500 In-Reply-To: <43A92091.8000700@wxs.nl> Original-To: mailing list for ConTeXt users X-Mailer: Apple Mail (2.746.2) 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:24599 Archived-At: Hans, that worked. Code below. Is this something you will fix in one of the core files? %output=pdf \unprotect \def\getblockstatus#1% is this still ok {\dosetfilterlevel{\@@bscriterium}\empty \expanded{\doifblklevelelse[#1\sectionseparator\sectionseparator0]} {\global\blockpermittedtrue} {\global\blockpermittedfalse}% \def\blockstatus{#1}} \def\doselectblocks[#1][#2][#3]% {\begingroup \doifelsenothing{#3} {\getparameters[\??bs][\c!criterium=\v!all,#2]% \dodouseblocks[#1][]} {\getparameters[\??bs][\c!criterium=\v!all,#3]% \dodouseblocks[#1][#2]}}% \def\selectblocks {\dotripleempty\doselectblocks} \protect \starttext \defineenumeration[question][location=serried,text=Question] \defineenumeration[answer][location=serried,text=Answer] \defineblock[question,answer] \hideblocks[answer] \chapter{First Chapter} \input tufte \beginquestion \startquestion What is the square root of 4? \stopquestion \endquestion \beginanswer \startanswer 2 \stopanswer \endanswer \section{Answers} \selectblocks[answer][criterium=chapter] \chapter{Second Chapter} \input tufte \beginquestion \startquestion What is the square root of 9? \stopquestion \endquestion \beginanswer \startanswer 3 \stopanswer \endanswer \section{Answers} \selectblocks[answer][criterium=chapter] \stoptext On Dec 21, 2005, at 1:29 AM, Hans Hagen wrote: > David Arnold wrote: > >> All, >> >> This doesn't seem to work as expected. Replacing the \useblocks >> with \selectblocks also produces an unexpected result. What am I >> doing wrong? I am trying to have only the answers from the >> chapter show up. > > ah, old code, something got lost when i added parameter support ... > > \unprotect > > \def\getblockstatus#1% is this still ok > {\dosetfilterlevel{\@@bscriterium}\empty > \expanded{\doifblklevelelse[#1\sectionseparator\sectionseparator0]} > {\global\blockpermittedtrue} > {\global\blockpermittedfalse}% > \def\blockstatus{#1}} > > \def\doselectblocks[#1][#2][#3]% > {\begingroup > \doifelsenothing{#3} > {\getparameters[\??bs][\c!criterium=\v!all,#2]% > \dodouseblocks[#1][]} > {\getparameters[\??bs][\c!criterium=\v!all,#3]% > \dodouseblocks[#1][#2]}}% > > \def\selectblocks > {\dotripleempty\doselectblocks} > > \protect > > use \selectblocks when you want a criterium > >> >> %output=pdf >> >> \defineenumeration[question][location=serried,text=Question] >> \defineenumeration[answer][location=serried,text=Answer] >> \defineblock[question,answer] >> \hideblocks[answer] >> >> \starttext >> >> \chapter{First Chapter} >> >> \input tufte >> >> \beginquestion >> \startquestion >> What is the square root of 4? >> \stopquestion >> \endquestion >> >> \beginanswer >> \startanswer >> 2 >> \stopanswer >> \endanswer >> >> \section{Answers} >> >> \useblocks[answer][criterium=chapter] >> >> \chapter{Second Chapter} >> >> \input tufte >> >> \beginquestion >> \startquestion >> What is the square root of 9? >> \stopquestion >> \endquestion >> >> \beginanswer >> \startanswer >> 3 >> \stopanswer >> \endanswer >> >> \section{Answers} >> >> \useblocks[answer][criterium=chapter] >> >> \stoptext >> >> _______________________________________________ >> ntg-context mailing list >> ntg-context@ntg.nl >> http://www.ntg.nl/mailman/listinfo/ntg-context > > > _______________________________________________ > ntg-context mailing list > ntg-context@ntg.nl > http://www.ntg.nl/mailman/listinfo/ntg-context