From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/64634 Path: news.gmane.org!not-for-mail From: "Thomas Schmitz" Newsgroups: gmane.comp.tex.context Subject: mkiv: append to buffer Date: Sat, 18 Dec 2010 16:51:05 +0100 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1292687489 16051 80.91.229.12 (18 Dec 2010 15:51:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 18 Dec 2010 15:51:29 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Dec 18 16:51:25 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 1PTz48-0007f5-0e for gctc-ntg-context-518@m.gmane.org; Sat, 18 Dec 2010 16:51:24 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 03CDCCA923; Sat, 18 Dec 2010 16:51:23 +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 9ovS6WwT93W7; Sat, 18 Dec 2010 16:51:19 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E4F91CA8CF; Sat, 18 Dec 2010 16:51:18 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 90603CA8CF for ; Sat, 18 Dec 2010 16:51:17 +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 mUMNNuPq4kD6 for ; Sat, 18 Dec 2010 16:51:06 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 518BCC9A8A for ; Sat, 18 Dec 2010 16:51:06 +0100 (CET) Original-Received: from uni-bonn.de (mail1x.uni-bonn.de [131.220.15.112]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oBIFp53P005637 for ; Sat, 18 Dec 2010 16:51:06 +0100 Original-Received: from [87.178.43.124] (account tschmit1@uni-bonn.de) by be2.uni-bonn.de (CommuniGate Pro WEBUSER 5.2.12) with HTTP id 6054420 for ntg-context@ntg.nl; Sat, 18 Dec 2010 16:51:05 +0100 X-Mailer: CommuniGate Pro WebUser v5.2.12 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=131.220.15.112; country=DE; region=07; city=Bonn; latitude=50.7333; longitude=7.1000; http://maps.google.com/maps?q=50.7333,7.1000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rDIDP5el - 74efcf2fd4be - 20101218 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 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:64634 Archived-At: Hi all, i guess this is easy, but I can't find an example to help me: I want to write a macro that will collect one of its arguments in a buffer and then collect the other argument in a buffer. Difficult to make a minimal example since I don't know how to do this, so here is some pseudo-code; this is what I want to achieve: \definebuffer[MyBuffer] \def\MyGreatMacro#1#2#3% {\item[#1] #2 \par \appendtobuffer{MyBuffer}{\in[#1] #3}} \starttext \startitemize \MyGreatMacro{1}{aa}{AA} \MyGreatMacro{2}{bb}{BB} \stopitemize \page \getbuffer[MyBuffer] \resetbuffer[MyBuffer] % so I can reuse the buffer \stoptext What I want to do with this is typeset exercises for my students, with an itemization for problems and solutions which use the same numbering. In real life, this will involve xml, but I will try and figure that out myself once I know how to use buffers... It looks like buffers.collectcontent should be able to do this, but I can't figure out how to use it. Any pointers? Thanks a lot! All best Thomas ___________________________________________________________________________________ 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 ___________________________________________________________________________________