ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: ntg-context@ntg.nl (ConTeXt)
Subject: Re: Problem with buffers in combination with textreference
Date: Mon, 15 Nov 1999 18:12:12 +0100	[thread overview]
Message-ID: <3.0.6.32.19991115181212.00e67500@pop.wxs.nl> (raw)
In-Reply-To: <199911151530.PAA23296@interzone.ucc.ie>

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
-----------------------------------------------------------------


      reply	other threads:[~1999-11-15 17:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-15 15:30 Marc van Dongen
1999-11-15 17:12 ` Hans Hagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3.0.6.32.19991115181212.00e67500@pop.wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).