From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/27672 Path: news.gmane.org!not-for-mail From: Johannes Graumann Newsgroups: gmane.comp.tex.context Subject: Re: Float caption feature request Date: Fri, 05 May 2006 17:11:26 -0700 Organization: Die Guten Message-ID: References: <445B483C.8000807@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1146874580 20898 80.91.229.2 (6 May 2006 00:16:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 6 May 2006 00:16:20 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sat May 06 02:16:17 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org 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 1FcASv-0006cX-M1 for gctc-ntg-context-518@m.gmane.org; Sat, 06 May 2006 02:16:09 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5F034127D2; Sat, 6 May 2006 02:16:09 +0200 (CEST) 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 22915-04; Sat, 6 May 2006 02:16:09 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 54496127CF; Sat, 6 May 2006 02:13:26 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 68C2A127CF for ; Sat, 6 May 2006 02:13:24 +0200 (CEST) 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 22966-02 for ; Sat, 6 May 2006 02:13:22 +0200 (CEST) Original-Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by ronja.ntg.nl (Postfix) with SMTP id ACF4B127C4 for ; Sat, 6 May 2006 02:13:22 +0200 (CEST) Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FcAQ8-0006EZ-7r for ntg-context@ntg.nl; Sat, 06 May 2006 02:13:16 +0200 Original-Received: from iluvatar.caltech.edu ([131.215.35.27]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 06 May 2006 02:13:16 +0200 Original-Received: from johannes_graumann by iluvatar.caltech.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 06 May 2006 02:13:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ntg-context@ntg.nl Original-Lines: 135 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: iluvatar.caltech.edu User-Agent: KNode/0.10.2 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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:27672 Archived-At: Just disregard this post and have mercy on the deadline panicked ... Joh Johannes Graumann wrote: > The 'selector' feature sounds truly wonderfull! The code below doesn't > compile yet for me though ... > 1) '\protect' needs to be called after '{\executeifdefined{\??sx#1\c!n > 1}}', no? > 2) Even after changing that I run into the following error when compiling > the example below: > > ! Missing { inserted. > > > l.94 > {\select{caption}{zapf}{\input zapf \relax}} > > Thank you for your help! > > Joh > > Hans Hagen wrote: >> \unprotect >> >> % let's reuse this one in selectors (from syst-ext) >> >> \def\dofilterfromstr#1#2% max n >> {\ifcase#1\or >> \ifcase#2\or >> \strippedcsname\firstofoneargument >> \else >> \strippedcsname\gobbleoneargument >> \fi >> \or >> \ifcase#2\or >> \strippedcsname\firstoftwoarguments >> \or >> \strippedcsname\secondoftwoarguments >> \else >> \strippedcsname\gobbletwoarguments >> \fi >> \or >> \ifcase#2\or >> \strippedcsname\firstofthreearguments >> \or >> \strippedcsname\secondofthreearguments >> \or >> \strippedcsname\thirdofthreearguments >> \else >> \strippedcsname\gobblethreearguments >> \fi >> \or >> \ifcase#2\or >> \strippedcsname\firstoffourarguments >> \or >> \strippedcsname\secondoffourarguments >> \or >> \strippedcsname\thirdoffourarguments >> \or >> \strippedcsname\fourthoffourarguments >> \else >> \strippedcsname\gobblefourarguments >> \fi >> \or >> \ifcase#2\or >> \strippedcsname\firstoffivearguments >> \or >> \strippedcsname\secondoffivearguments >> \or >> \strippedcsname\thirdoffivearguments >> \or >> \strippedcsname\fourthoffivearguments >> \or >> \strippedcsname\fifthoffivearguments >> \else >> \strippedcsname\gobblefivearguments >> \fi >> \fi} >> >> \def\filterfromvalue#1#2#3% value max n >> {\@EA\@EAEAEA\csname % we use the fact that an >> \@EA\ifx\csname#1\endcsname\relax % undefined cs has become \relax >> \strippedcsname\gobbleoneargument % which we then gobble here >> \else >> \dofilterfromstr{#2}{#3}% >> \fi >> \endcsname\csname#1\endcsname} >> >> \def\filterfromnext#1#2% max n {..}{..}{..}{..} >> {\csname\dofilterfromstr{#1}{#2}\endcsname} >> >> % new, selectors >> >> \definesystemvariable{sx} >> >> \def\defineselector{\dodoubleargument\dodefineselector} >> \def\setupselector {\dodoubleargument\dosetupselector} >> >> \def\dodefineselector[#1][#2]{\getparameters[\??sx#1][\c!max=2 \c!n=1,#2]} >> \def\dosetupselector [#1][#2]{\getparameters[\??sx#1][#2]} >> >> \unexpanded\def\select#1% >> {\filterfromnext >> {\executeifdefined{\??sx#1\c!max}1} >> {\executeifdefined{\??sx#1\c!n }1}} >> >> \defineselector[caption][max=2,n=1] >> >> \start >> \setupselector[caption][n=1] >> \placelist[figure][criterium=all] >> \stop >> >> \starttext >> >> \placefigure >> {\select{caption}{zapf}{\input zapf \relax}} >> {} >> >> \stoptext >> >> i'll add selectors to the core >> >> Hans >> >> ----------------------------------------------------------------- >> Hans Hagen | PRAGMA ADE >> Ridderstraat 27 | 8061 GH Hasselt | The Netherlands >> tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com >> | www.pragma-pod.nl >> -----------------------------------------------------------------