From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/86842 Path: news.gmane.org!not-for-mail From: Xan Newsgroups: gmane.comp.tex.context Subject: Re: Defining commands in \start ... \stop Date: Sun, 30 Mar 2014 19:28:00 +0200 Message-ID: <20140330192800.10b317897d5e3e4afbfa31a5@telefonica.net> References: <20140330191357.4171548bb30e5bbefe9b0cb2@telefonica.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1396200505 1617 80.91.229.3 (30 Mar 2014 17:28:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Mar 2014 17:28:25 +0000 (UTC) Cc: mailing list for ConTeXt users To: Xan Original-X-From: ntg-context-bounces@ntg.nl Sun Mar 30 19:28:20 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 1WUJWs-0004x2-9H for gctc-ntg-context-518@m.gmane.org; Sun, 30 Mar 2014 19:28:18 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7E94F101E7; Sun, 30 Mar 2014 19:28:17 +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 H6xTbbux0peg; Sun, 30 Mar 2014 19:28:15 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 7D1C2101E9; Sun, 30 Mar 2014 19:28:15 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 49445101E9 for ; Sun, 30 Mar 2014 19:28:14 +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 KUyyKLi+9akm for ; Sun, 30 Mar 2014 19:28:12 +0200 (CEST) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id AD967101E7 for ; Sun, 30 Mar 2014 19:28:02 +0200 (CEST) Original-Received: from smtp.movistar.es (smtp11.acens.net [86.109.99.135]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s2UHS18o025904 for ; Sun, 30 Mar 2014 19:28:01 +0200 X-CTCH-RefID: str=0001.0A0B0206.53385421.0015, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-Spam: Unknown Original-Received: from rulot (81.32.88.229) by smtp.movistar.es (8.6.117.05) (authenticated as dxpublica) id 53354FEF00120E46; Sun, 30 Mar 2014 17:28:01 +0000 In-Reply-To: <20140330191357.4171548bb30e5bbefe9b0cb2@telefonica.net> X-Mailer: Sylpheed 3.3.1 (GTK+ 2.24.22; i686-pc-linux-gnu) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=86.109.99.135; country=ES; latitude=40.0000; longitude=-4.0000; http://maps.google.com/maps?q=40.0000,-4.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0NLHRs1ua - 1bab25bd902a - 20140330 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 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:86842 Archived-At: This: \defineblock[question] \defineblock[answer] \defineenumeration[question][text={Question}] \defineenumeration[answer] [text={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 ___________________________________________________________________________________ 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 ___________________________________________________________________________________