From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/86843 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Defining commands in \start ... \stop Date: Sun, 30 Mar 2014 19:29:49 +0200 Message-ID: <1394F179-A148-46C1-8196-9AF523413935@gmail.com> References: <20140330191357.4171548bb30e5bbefe9b0cb2@telefonica.net> <20140330192800.10b317897d5e3e4afbfa31a5@telefonica.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1396200614 2772 80.91.229.3 (30 Mar 2014 17:30:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Mar 2014 17:30:14 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Mar 30 19:30:10 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WUJYd-00067A-4a for gctc-ntg-context-518@m.gmane.org; Sun, 30 Mar 2014 19:30:07 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9C63010207; Sun, 30 Mar 2014 19:30:06 +0200 (CEST) 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 6PmUYtfVElWV; Sun, 30 Mar 2014 19:30:04 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 70C07101E9; Sun, 30 Mar 2014 19:30:04 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DE73F101E9 for ; Sun, 30 Mar 2014 19:30:02 +0200 (CEST) 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 nkuz-nZxdZtB for ; Sun, 30 Mar 2014 19:30:01 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 37D2E101E7 for ; Sun, 30 Mar 2014 19:29:56 +0200 (CEST) Original-Received: from mail-bk0-x22c.google.com (mail-bk0-x22c.google.com [IPv6:2a00:1450:4008:c01::22c]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s2UHTto0020529 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sun, 30 Mar 2014 19:29:55 +0200 Original-Received: by mail-bk0-f44.google.com with SMTP id mz13so1083165bkb.17 for ; Sun, 30 Mar 2014 10:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=5nIXYl+qYehdRSvHQtiNIs59wJb6jZW4QVtjdjplrQk=; b=nIH4mYRwhzYyUGwitHkQDEaRu7W6d1sactCOuT2+HlYBxdVOaKS7aZMkyDECaFMdH8 yi9lEqTmZa8uLfpfTpnC5AGyWeqYepFYwTRwa0ztJElfWm8REfEWGBpyimklCt7pempy XrI86B2m0vF7/ScY+nXgGm34lGYs6eXW5kl4adJ0WQygpOuNMmXAGxVCwhHrPFgQR1jE Suh5t1ov3aWcyaIme9f0ej7JmKLWUorE1IiJ720i/5NkHMYdepXahNX59/IcmZe7cehG 3PTp7Y3mt08s7JNbSJSnFnpzrwfmYMivVR1wC9WWzCAWQjvBgCadC16OHbUIMGSTv+vk QE3w== X-Received: by 10.204.180.67 with SMTP id bt3mr18533979bkb.16.1396200595167; Sun, 30 Mar 2014 10:29:55 -0700 (PDT) Original-Received: from keima.localdomain (x2f2198e.dyn.telefonica.de. [2.242.25.142]) by mx.google.com with ESMTPSA id xj2sm11129820bkb.15.2014.03.30.10.29.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 30 Mar 2014 10:29:52 -0700 (PDT) In-Reply-To: <20140330192800.10b317897d5e3e4afbfa31a5@telefonica.net> X-Mailer: Apple Mail (2.1874) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:4008:c01::22c; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03LHRtTW8 - 840f3941f974 - 20140330 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:86843 Archived-At: Am 30.03.2014 um 19:28 schrieb Xan : > This: > = > \defineblock[question] > \defineblock[answer] > = > \defineenumeration[question][text=3D{Question}] > \defineenumeration[answer] [text=3D{Answer}] > = > \keepblocks[question] > \hideblocks[answer] > = > = > \def\mynewcommand{\dosingleempty\doMyNewCommand} > \def\doMyNewCommand[#1]#2{% > \iffirstargument > \beginquestion > \startquestion #2% > \stopquestion > \endquestion > \beginanswer \startanswer #1% > \stopanswer \endanswer > \else > \beginquestion > \startquestion #2% > \stopquestion > \endquestion > \incrementcounter[answer] > \fi > } > = > = > \starttext > = > \chapter{Question} > = > \beginquestion > \startquestion > Question 1. > \stopquestion > \endquestion > = > \beginanswer > \startanswer > Answer 1. > \stopanswer > \endanswer > = > \beginquestion > \startquestion > Question 2. > \stopquestion > \endquestion > = > \beginanswer > \incrementcounter[answer] > \endanswer > = > \beginquestion > \startquestion > Question 3. > \stopquestion > \endquestion > = > \beginanswer > \startanswer > Answer 3. > \stopanswer > \endanswer > = > \mynewcommand{Question 5} > = > \mynewcommand[Resposta 6]{Question 6} > = > \chapter{Answers} > = > \useblocks[answer] > = > \stoptext > = > does not work The block commands use a buffer to store the content and buffers can=92t be= used in commands. Wolfgang ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________