From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/1248 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Problem with buffers in combination with textreference Date: Mon, 15 Nov 1999 18:12:12 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <3.0.6.32.19991115181212.00e67500@pop.wxs.nl> References: <199911151530.PAA23296@interzone.ucc.ie> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: main.gmane.org 1035392079 31116 80.91.224.250 (23 Oct 2002 16:54:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 16:54:39 +0000 (UTC) Cc: ntg-context@ntg.nl (ConTeXt) Original-To: Marc van Dongen In-Reply-To: <199911151530.PAA23296@interzone.ucc.ie> Xref: main.gmane.org gmane.comp.tex.context:1248 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:1248 At 03:30 PM 11/15/99 +0000, Marc van Dongen wrote: >Below there is one macro (no arguments) which if used at >a certain position in the text causes a problem. When >replacing the macro call by its definition, will resolve >the problem..... Buffers are strange animals. You cannot start and stop them in a macro, since they fool around with catcodes. >\def\beginanswer{% > \begingroup > \startbuffer[Answerbuffer] > \textreference[Answer]{Answer} >} >%\endanswer{\endbuffer\endgroup\page[yes]} >\def\beginquestion{% > \begingroup > Blah. >} >\def\endquestion{\endgroup} Anyhow, there is a more straightforward way: \defineblock[question] \defineblock[answer] \hideblocks[answer] \beginquestion .... \beginquestion \beginanswer .... \endanswer Now you can say: \chapter {Answers} \placeblocks[answer] Of course it makes sense to use definitions or enumarations (just try it yourself first) which end up in \beginquestion \startquestion some text \stopquestion \endquestion etc etc When properly set up, you get cross linked questions and answers for free. This mechanism can also be used selectively, with tags, so you can make sets of answers and so. (Blocks is a pretty old mechanism that I wrote because I wanted to make some educational documents based on one source.) 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.nl -----------------------------------------------------------------