ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: help on def & buffer
Date: Wed, 30 Mar 2016 10:11:43 +0200	[thread overview]
Message-ID: <56FB8A3F.2010509@wxs.nl> (raw)
In-Reply-To: <CAAaWjtHWx7Y_+ks+5x7sm+AvzMANGvF-gFiCyQVjmxwBueda5w@mail.gmail.com>

On 3/30/2016 9:27 AM, Erik Margraf wrote:
> Dear List,
>
> please help me with my problem here ....
>
> I - probably naively - tried the following:
> ------------------------
>
> \starttext
>
>
> \def\Buffer#1#2
>
> {
>
> \startbuffer[#1]
>
> \input #2
>
> \stopbuffer
>
> }
>
> \Buffer{bla}{knuth}
>
>
> \stoptext
>
> -------------------------
>
>
> Context gives me the following error on this:
>
>
> tex error > tex error on line 9 in file
> C:/Users/emargraf/Documents/buffer.tex: ! Undefined control sequence
>
>
>
> \Buffer ...startbuffer [#1] \input #2 \stopbuffer
>
> l.9 \Buffer{bla}{knuth}

\startbuffer .. \stopbuffer is parsed special

so use:

\def\Buffer#1#2
   {\setbuffer[#1]{\input #2\relax}}

\Buffer{bla}{knuth}

but i'm not sure what you gain here as it will still input tufte each time

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2016-03-30  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-30  7:27 Erik Margraf
2016-03-30  8:11 ` Hans Hagen [this message]
2016-03-30  8:34   ` Erik Margraf
2016-03-30  8:53     ` Marco Patzer
2016-03-30 12:46   ` Wolfgang Schuster
2016-03-30 13:24     ` Erik Margraf

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=56FB8A3F.2010509@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).