From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/94197 Path: news.gmane.org!not-for-mail From: Erik Margraf Newsgroups: gmane.comp.tex.context Subject: Re: help on def & buffer Date: Wed, 30 Mar 2016 10:34:46 +0200 Message-ID: References: <56FB8A3F.2010509@wxs.nl> Reply-To: erik.margraf@gmail.com, mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2877153230488091911==" X-Trace: ger.gmane.org 1459327123 12661 80.91.229.3 (30 Mar 2016 08:38:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Mar 2016 08:38:43 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Mar 30 10:38:29 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1alBap-00081J-Dq for gctc-ntg-context-518@m.gmane.org; Wed, 30 Mar 2016 10:35:11 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 654399999; Wed, 30 Mar 2016 10:34:59 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AeVrV14SyZ3O; Wed, 30 Mar 2016 10:34:58 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 744F1999B; Wed, 30 Mar 2016 10:34:58 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5310A9999 for ; Wed, 30 Mar 2016 10:34:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ban0UXOHbWNT for ; Wed, 30 Mar 2016 10:34:56 +0200 (CEST) Original-Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 793B29997 for ; Wed, 30 Mar 2016 10:34:46 +0200 (CEST) Original-Received: by mail-wm0-f52.google.com with SMTP id 20so59852994wmh.1 for ; Wed, 30 Mar 2016 01:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to; bh=fQ8xFMmTzyWZDnyO0ScYtkp3QoVQKw3mhMrzZinHChk=; b=hjw06BwZBALmCMYVx+FquCLuJ2nADdd1fmG1ESjZ2zmAXkEJk1oRdscH6QLfNtUVWv RTQpQ7uI7/TIV/9Krbuv72VNKyWGz59rUF60+2Fl/D0KOSwJp4yCUXOpdQbnInIwwXCK I1s0mi/UNyhVTV/0T7XotVrcXsesuWygUluqusH5O+NUQNYgJqONoH5Xse1pDzNmcfzO xM5BgCPt9YstY1mt3NenGb1OCVu8Jr9meE1t1kztMrJAAW71WyTeu6olOn1hTpV280LJ PYXyG9VIi+tveZZAJWVhJdTZr0os6NYnreqq/dwLRHXbIECfsXaw4romnmKI7eJ1pS47 drDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to; bh=fQ8xFMmTzyWZDnyO0ScYtkp3QoVQKw3mhMrzZinHChk=; b=HxblRNBYnywNAQNhlhSo7SMrQXcZTsyn3PzST+hbRvL5YMwsgfuDRcLty0q07CE7t7 6KSMdR+zgRt5gFPI+Jw2ScJ/TfgFl6ZQCmDiTTdn6kb6+SB3ZhBBpvcDENBQ0IvYswf0 f2hrA7lpQrP4Ijw6FSkvdUPE6TmEBklSKFGogsuNzqs5fIElmlb5SQbIwdZYGi0nnf74 HHMVhXPSZllnokCk7clLiH9p96a56/CKekukbBn4bU8/2AVEl0Ptz9GYDDE1tClfuTOl scec+swwKiyP1T2IoCS8oN9peVKpljf+Tm6Ot4Tn5EFpiraBzu9RNcsKSQxJ7AWkmLDN l9LQ== X-Gm-Message-State: AD7BkJKKJG+d2c4pi52azAF4XH5lZqhmt/2Sa8Evvx34VfDbanNTglWVlKktcuDDqDwu8wHbHrTkrEQheKjAsQ== X-Received: by 10.28.101.133 with SMTP id z127mr8620333wmb.84.1459326886144; Wed, 30 Mar 2016 01:34:46 -0700 (PDT) Original-Received: by 10.28.156.75 with HTTP; Wed, 30 Mar 2016 01:34:46 -0700 (PDT) In-Reply-To: <56FB8A3F.2010509@wxs.nl> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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" Xref: news.gmane.org gmane.comp.tex.context:94197 Archived-At: --===============2877153230488091911== Content-Type: multipart/alternative; boundary=001a114b741ea8f2ec052f4004de --001a114b741ea8f2ec052f4004de Content-Type: text/plain; charset=UTF-8 Than you Hans! My plan is simply to use the output of a sagemath run in this way. A run should produce several files containing TeX code. I only wanted to shorten the \startbuffer \input ... \stopbuffer sequence. Maybe this (including sagemath output) could be done differently, but this was the first (and only ;-)) idea I came up with. kind regards Erik On Wed, Mar 30, 2016 at 10:11 AM, Hans Hagen wrote: > 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 > > ___________________________________________________________________________________ --001a114b741ea8f2ec052f4004de Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Than you Hans! =C2=A0
My plan is simply to use the out= put of a sagemath run in this way. A run should produce=C2=A0
sev= eral files containing TeX code. I only wanted to shorten the \startbuffer \= input ... \stopbuffer
sequence. Maybe this (including sagemath ou= tput) could be done differently, but this was=C2=A0
the first (and only = ;-)) idea I came up with.

kind regards
E= rik

On= Wed, Mar 30, 2016 at 10:11 AM, Hans Hagen <pragma@wxs.nl> wrote= :
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
=C2=A0 {\setbuffer[#1]{\input #2\relax}}

\Buffer{bla}{knuth}

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

Hans

-----------------------------------------------------------------
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 H= ans Hagen | PRAGMA ADE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Ridderstraat 27 | 8061 GH = Hasselt | The Netherlands
=C2=A0 =C2=A0 =C2=A0 tel: 038 477 53 69 | www.pragma-ade.com | www.prag= ma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://tex.aanhet.net
archive=C2=A0 : http://foundry.supelec.fr/projects/con= textrev/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________

--001a114b741ea8f2ec052f4004de-- --===============2877153230488091911== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============2877153230488091911==--