From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/64546 Path: news.gmane.org!not-for-mail From: Marco Pessotto Newsgroups: gmane.comp.tex.context Subject: \do(single|double|etc)empty behaviour Date: Wed, 15 Dec 2010 19:40:27 +0100 Message-ID: <87fwtyj2w4.fsf@universe.krase.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1292438472 6861 80.91.229.12 (15 Dec 2010 18:41:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 15 Dec 2010 18:41:12 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed Dec 15 19:41:06 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PSwHh-0003KH-8h for gctc-ntg-context-518@m.gmane.org; Wed, 15 Dec 2010 19:41:05 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9933DCA904; Wed, 15 Dec 2010 19:41:04 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id pTDsTiaUEqaM; Wed, 15 Dec 2010 19:41:01 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7E479CA8F7; Wed, 15 Dec 2010 19:41:01 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DA993CA8F7 for ; Wed, 15 Dec 2010 19:40:59 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GgpI3VczY7iS for ; Wed, 15 Dec 2010 19:40:48 +0100 (CET) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 315FBCA8F6 for ; Wed, 15 Dec 2010 19:40:48 +0100 (CET) Original-Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oBFIekrW024435 for ; Wed, 15 Dec 2010 19:40:47 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PSwHN-00034j-G1 for ntg-context@ntg.nl; Wed, 15 Dec 2010 19:40:45 +0100 Original-Received: from 78-2-38-118.adsl.net.t-com.hr ([78.2.38.118]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Dec 2010 19:40:45 +0100 Original-Received: from melmothx by 78-2-38-118.adsl.net.t-com.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Dec 2010 19:40:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 80 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 78-2-38-118.adsl.net.t-com.hr User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:v68KmXh6tZrcYIVeO9QgqrQtmUg= X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.91.229.12; country=NO; latitude=62.0000; longitude=10.0000; http://maps.google.com/maps?q=62.0000,10.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0eDHuELfp - 3070f201ff51 - 20101215 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:64546 Archived-At: Hello there. I was writing a small macro to emulate a custom \part command, and I broke my head against \dosingleempty (but finally I won). Why this example is working: %%%%%%%%% start %%%%%%%%%%%%%%%%% \definelist[talpart] \define\talpart{\page[right]% \blank[2*big]% \startalignment[center]% \dosingleempty\doTalPart} \def\doTalPart[#1]#2{% \iffirstargument debug: I have the optional arg \bfc#1\blank[2*big] \writetolist[talpart]{}{{#1. }#2} \else debug: I don't have any arg \blank[2*big] \writetolist[talpart]{}{#2} \fi \bfd#2 \stopalignment \blank[2*big] } \starttext \placelist[talpart] \talpart[optional]{With optional argument} \input knuth \talpart{No argument} \input ward \stoptext %%%%%%%%%%% stop %%%%%%%%%%%%%%%% While this, the original one, is definitively not working? %%%%%%%%% start %%%%%%%%%%%%%%%%% \definelist[talpart] \define\talpart{\dosingleempty\doTalPart} \def\doTalPart[#1]#2{% \page[right] \startalignment[center] \blank[force,2*big] \iffirstargument debug: I have the optional arg \noindent{\bfc#1}\blank[2*big] \writetolist[talpart]{}{{#1. }#2} \else debug: I don't have any arg \blank[2*big] \writetolist[talpart]{}{#2} \fi {\noindent \bfd#2} \stopalignment \page[left] } \starttext \placelist[talpart] \talpart[optional]{With optional argument} \input knuth \talpart{No argument} \input ward \stoptext %%%%%%%%%%% stop %%%%%%%%%%%%%%%% It's unclear to me how the arguments are passed between macros. Probably it's just a matter of knowledge of TeX macro programming (which obviously I don't have). My source of inspiration was: http://wiki.contextgarden.net/Commands_with_optional_arguments Bests -- Marco ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________