* help on def & buffer
@ 2016-03-30 7:27 Erik Margraf
2016-03-30 8:11 ` Hans Hagen
0 siblings, 1 reply; 6+ messages in thread
From: Erik Margraf @ 2016-03-30 7:27 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 545 bytes --]
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}
-----------------------
Kind regards
Erik
[-- Attachment #1.2: Type: text/html, Size: 1422 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: help on def & buffer
2016-03-30 7:27 help on def & buffer Erik Margraf
@ 2016-03-30 8:11 ` Hans Hagen
2016-03-30 8:34 ` Erik Margraf
2016-03-30 12:46 ` Wolfgang Schuster
0 siblings, 2 replies; 6+ messages in thread
From: Hans Hagen @ 2016-03-30 8:11 UTC (permalink / raw)
To: ntg-context
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: help on def & buffer
2016-03-30 8:11 ` Hans Hagen
@ 2016-03-30 8:34 ` Erik Margraf
2016-03-30 8:53 ` Marco Patzer
2016-03-30 12:46 ` Wolfgang Schuster
1 sibling, 1 reply; 6+ messages in thread
From: Erik Margraf @ 2016-03-30 8:34 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 2158 bytes --]
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 <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
> {\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
>
> ___________________________________________________________________________________
[-- Attachment #1.2: Type: text/html, Size: 3484 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: help on def & buffer
2016-03-30 8:34 ` Erik Margraf
@ 2016-03-30 8:53 ` Marco Patzer
0 siblings, 0 replies; 6+ messages in thread
From: Marco Patzer @ 2016-03-30 8:53 UTC (permalink / raw)
To: ntg-context
On Wed, 30 Mar 2016 10:34:46 +0200
Erik Margraf <erik.margraf@gmail.com> wrote:
> 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.
I don't know sagemath but I assume this is a use case for Aditya's
filter module¹. It's included in the distribution.
Marco
¹ https://github.com/adityam/filter
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: help on def & buffer
2016-03-30 8:11 ` Hans Hagen
2016-03-30 8:34 ` Erik Margraf
@ 2016-03-30 12:46 ` Wolfgang Schuster
2016-03-30 13:24 ` Erik Margraf
1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2016-03-30 12:46 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 265 bytes --]
> Hans Hagen <mailto:pragma@wxs.nl>
> 30. März 2016 um 10:11
>
>
> \startbuffer .. \stopbuffer is parsed special
>
> so use:
>
> \def\Buffer#1#2
> {\setbuffer[#1]{\input #2\relax}}
\def\Buffer#1#2%
{\setbuffer[#1]\input{#2}\endbuffer}
Wolfgang
[-- Attachment #1.2: Type: text/html, Size: 1254 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: help on def & buffer
2016-03-30 12:46 ` Wolfgang Schuster
@ 2016-03-30 13:24 ` Erik Margraf
0 siblings, 0 replies; 6+ messages in thread
From: Erik Margraf @ 2016-03-30 13:24 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1046 bytes --]
Ups, didn't expect that ... ;-)
Thanks Wolfgang! Actually your version works, Hans' version does not ...
(could try them only now)
Kind regards
Erik
On Wed, Mar 30, 2016 at 2:46 PM, Wolfgang Schuster <
schuster.wolfgang@gmail.com> wrote:
> Hans Hagen <pragma@wxs.nl>
> 30. März 2016 um 10:11
>
>
> \startbuffer .. \stopbuffer is parsed special
>
> so use:
>
> \def\Buffer#1#2
> {\setbuffer[#1]{\input #2\relax}}
>
> \def\Buffer#1#2%
> {\setbuffer[#1]\input{#2}\endbuffer}
>
> Wolfgang
>
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>
[-- Attachment #1.2: Type: text/html, Size: 2688 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-03-30 13:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-30 7:27 help on def & buffer Erik Margraf
2016-03-30 8:11 ` Hans Hagen
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
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).