Re: [NTG-context] How to make \def accept block or buffer as part of (long) command argument

2022-01-02 Thread Benjamin Buchmuller via ntg-context
dostartMyCommand[#1]} > > \let\stopMyCommand\relax > > \normalexpanded{\def\noexpand\dostartMyCommand[#1]#2\expandtoken\notcatcodes92 > stopMyCommand}% > {\endgroup > % whatever #1 does > \setbuffer[foo]#2\endbuffer > \typebuffer[foo] > \getbuffer[foo]}

Re: [NTG-context] How to make \def accept block or buffer as part of (long) command argument

2022-01-02 Thread Hans Hagen via ntg-context
\startMyCommand[#1]% {\begingroup \setcatcodetable\notcatcodes \dostartMyCommand[#1]} \let\stopMyCommand\relax \normalexpanded{\def\noexpand\dostartMyCommand[#1]#2\expandtoken\notcatcodes92 stopMyCommand}% {\endgroup % whatever #1 does \setbuffer[foo]#2\endbuffer \typebuffer[foo

Re: [NTG-context] How to make \def accept block or buffer as part of (long) command argument

2022-01-02 Thread Benjamin Buchmuller via ntg-context
pily accept >> these useful features? > buffers are stored as-is so no catcode magic stored, contrary to macros > > you can use \setbuffer but that doesn't solve the argument passing > > however, you can nest buffers so you can make other \start\stop commands >

Re: [NTG-context] How to make \def accept block or buffer as part of (long) command argument

2022-01-02 Thread Hans Hagen via ntg-context
I was wondering how I should define or expand #2 in the MWE below to make TeX happily accept these useful features? buffers are stored as-is so no catcode magic stored, contrary to macros you can use \setbuffer but that doesn't solve the argument passing however, you can nest buffers so yo

Re: [NTG-context] LMTX deeptextcommand issue

2019-04-02 Thread Hans Hagen
}{#5} \fi \else \let \currentreg... l.25 } ...l.11633 \stop 15 16 \registerctxluafile{page-run}{} 17 18 \unprotect 19 20 \unexpanded\gdef\showprint{\dotripleempty\page_layouts_show_print} 21 22 \gdef\page_layo

[NTG-context] LMTX deeptextcommand issue

2019-04-02 Thread Jan Tosovsky
15 16 \registerctxluafile{page-run}{} 17 18 \unprotect 19 20 \unexpanded\gdef\showprint{\dotripleempty\page_layouts_show_print} 21 22 \gdef\page_layouts_show_print[#1][#2][#3]% only english 23 {\setbuffer[crap]% 24 \unpro

Re: [NTG-context] Buffer within a \def

2018-08-10 Thread Wolfgang Schuster
stopbuffer \getbuffer[Buf] } \def\T {\setbuffer[Buf]a b ccc d e f\endbuffer \getbuffer[Buf]} Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg

Re: [NTG-context] add to \setbuffer

2018-01-10 Thread Hans Hagen
On 1/10/2018 6:30 PM, Wolfgang Schuster wrote: dr. Hans van der Meer <mailto:havdm...@ziggo.nl> 10. Januar 2018 um 13:45 With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put something in this buffer. But is it possible to add something at the end of this buffer at a

Re: [NTG-context] add to \setbuffer

2018-01-10 Thread Wolfgang Schuster
dr. Hans van der Meer <mailto:havdm...@ziggo.nl> 10. Januar 2018 um 13:45 With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put something in this buffer. But is it possible to add something at the end of this buffer at a later moment? You can use the “buffers.appen

[NTG-context] add to \setbuffer

2018-01-10 Thread dr. Hans van der Meer
With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put something in this buffer. But is it possible to add something at the end of this buffer at a later moment? Hans van der Meer ___ If your question

Re: [NTG-context] letters in context mkiv

2017-07-31 Thread r . ermers
with alternatives like \startbuffer[lettercontent] … endbuffer. The \input problem remains: it appears that the buffer takes any command (\foo) as literal text.I tried moving the setbuffer … endbuffer part to elswhere in the document. I also experimented with \input a sample text of my own on my

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-23 Thread Jaroslav Hajtmar
rnalfilter@set_filenames \setbuffer[\externalfilter@buffer_name]#3\endbuffer \externalfilter@process_filter \stoptexdefinition \protect \defineexternalfilter [ASY] [ filtercommand={asy -tex context \externalfilterinputfile\space -o \externalfilteroutputfil

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-23 Thread Aditya Mahajan
ument\externalfiter@set_indeed} \starttexdefinition externalfiter@set_indeed [#1][#2]#3 % #1 = filter % #2 = options \begingroup \edef\currentexternalfilter{#1} \setupexternalfilter[#1][\c!name=,#2] \externalfilter@set_filenames \setbuffer[\externalfilter@buffer_name]#3\endb

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-23 Thread Jaroslav Hajtmar
] [ filtercommand={asy -tex context \externalfilterinputfile\space -o \externalfilteroutputfile}, output=\externalfilterbasefile.pdf, purge=no, cache=yes, readcommand=\ReadImage, ] \define[1]\ReadImage{\externalfigure[#1]} \define[1]\mycircle{ #1 - XXX \setbuffer[ASY] import

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-21 Thread Aditya Mahajan
ilter [MARKDOWN] [ filtercommand={pandoc -f markdown -t context \externalfilterinputfile\space -o \externalfilteroutputfile}, cache=yes, purge=no, % Just for testing. May be removed. ] \define[1]\TEST {\setbuffer[MARKDOWN]This is #1\endbuffer \processMARKDOWNb

Re: [NTG-context] buffering inside xmlsetups

2016-10-11 Thread Wolfgang Schuster
. The getbuffer setup is not even reached, as is obvious. I tried \xmltofile to put the data into an intermediate file, but to no avail because it produces the following, leading at best to recursion when processed by \xmlprocessfile. bufferdata Is there a solution to this? \set

Re: [NTG-context] help on def & buffer

2016-03-30 Thread Erik Margraf
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 > > > __

Re: [NTG-context] help on def & buffer

2016-03-30 Thread Wolfgang Schuster
Hans Hagen <mailto:pra...@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} Wo

Re: [NTG-context] help on def & buffer

2016-03-30 Thread Erik Margraf
t; >> \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 >> &g

Re: [NTG-context] help on def & buffer

2016-03-30 Thread Hans Hagen
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 | PR

Re: [NTG-context] Reprocessing part of input

2016-02-02 Thread Hans Hagen
... \stopmyinput \stopbuffer but now not executed at once, but stored in and executable from a buffer with \getbuffer[mystoragebuffer]. \setbuffer[foo]bar\endbuffer But of course there might be a better way to execute the same code more than once within one run of TeX. for that to answer

[NTG-context] mathvariant bold NOT bold-italic

2013-06-16 Thread Steffen Wolfrum
Hi, as far as I have understood MathML, elements tagged with mathvariant=bold should be set upright bold, not bold-italic. Could this be corrected, please? Thank you very much! Steffen --- \usemodule[mathml] \starttext \placeformula\startformula[9pt] \setbuffer http://www.w3.org/1998

Re: [NTG-context] mathml linebreak?

2013-06-09 Thread Aditya Mahajan
line-breaking. Aditya > --- > > \placeformula\startformula[9pt] > \setbuffer http://www.w3.org/1998/Math/MathML";> > http://www.w3.org/1998/Math/MathML";> > > C > E > > > A > > > http://www.w3.org/1998/Math/MathML";>= > ht

[NTG-context] math guru wanted

2013-06-09 Thread Steffen Wolfrum
4 5 6 \usemodule[mathml] \starttext 7 8 9 \setbuffer http://www.w3.org/1998/Math/MathML";> 10 >> http://www.w3.org/1998/Math/MathML"; mathvariant="bold">a 11 http://www.w3.org/1998/Math/MathML";>∈ 12 http://www.w3

[NTG-context] mathml linebreak?

2013-06-09 Thread Steffen Wolfrum
Hi, usually it is possible to break long formulas. But is there a way to do so, when formula is coded in mathml (see example below)? Thanks, Steffen --- \placeformula\startformula[9pt] \setbuffer http://www.w3.org/1998/Math/MathML";> http://www.w3.org/1998/Math/MathML";>

[NTG-context] mathvariant bold

2013-06-08 Thread Steffen Wolfrum
Hi, any idea, how to get it p typeset in bold?? Steffen --- \usemodule[mathml] \starttext \placeformula\startformula[9pt] \setbuffer http://www.w3.org/1998/Math/MathML";> http://www.w3.org/1998/Math/MathML";>π http://www.w3.org/1998/Math/MathML";>= http://www

Re: [NTG-context] buff_gobble error MathML

2013-06-08 Thread Wolfgang Schuster
. >>> Is there a way to solve the error "! Argument of \buff_gobble has an extra >>> }." >> >> You can’t use \startbuffer … \stopbuffer in other commands but with >> \setbuffer >> there is a command which can be used here. >> >> \sym{\

Re: [NTG-context] buff_gobble error MathML

2013-06-08 Thread Steffen Wolfrum
>> }." > > You can’t use \startbuffer … \stopbuffer in other commands but with \setbuffer > there is a command which can be used here. > > \sym{\setbuffer … \endbuffer\processxmlbuffer} great, thanks. but this immediately gives the next error: "invalid

Re: [NTG-context] buff_gobble error MathML

2013-06-08 Thread Wolfgang Schuster
Am 08.06.2013 um 12:53 schrieb Steffen Wolfrum : > Hi friends, > > we need to run MathML inside \sym (see below). > Is there a way to solve the error "! Argument of \buff_gobble has an extra }." You can’t use \startbuffer … \stopbuffer in other commands but with \setbuf

Re: [NTG-context] buffer broken?

2012-01-11 Thread Wolfgang Schuster
t; >> Because running this in isolation goes without a problem, I suspect the >> change has to do with the project structure in which I use the buffer. But >> again, it worked in the past. >> Does it works with >> \setbuffer[abc] >> whatever >> \endbuffe

Re: [NTG-context] buffer broken?

2012-01-11 Thread luigi scarso
> Because running this in isolation goes without a problem, I suspect the >> change has to do with the project structure in which I use the buffer. But >> again, it worked in the past. >> > Does it works with > \setbuffer[abc] > whatever > \endbuffer > ? &g

Re: [NTG-context] buffer broken?

2012-01-11 Thread Meer, H. van der
. Does it works with \setbuffer[abc] whatever \endbuffer ? It works with these macros, yes. Thanks. But is \setbuffer..\endbuffer something new? I do not see it on the Reference page of the wiki. Also it doesn't seem in line with ConTeXt's regular naming scheme of \startsomething..\st

Re: [NTG-context] buffer broken?

2012-01-11 Thread luigi scarso
> \startbuffer[abc] > whatever > \stopbuffer > > Now I get: ! Missing } inserted. > > Because running this in isolation goes without a problem, I suspect the > change has to do with the project structure in which I use the buffer. But > again, it worked in the past. > Does i

Re: [NTG-context] xtables in custom macros

2011-11-04 Thread Hans Hagen
On 4-11-2011 18:18, "Stefan Müller" wrote: On 3-11-2011 23:01, "Stefan Müller" wrote: \define\Doesnt{\startxtable \startxrow \startxcell does not work \stopxcell \stopxrow \stopxtable} > > \starttext > \Works \stopxtable > %\Doesnt > \

Re: [NTG-context] xtables in custom macros

2011-11-04 Thread Stefan Müller
> On 3-11-2011 23:01, "Stefan Müller" wrote: > >> \define\Doesnt{\startxtable \startxrow \startxcell does not work > >> \stopxcell \stopxrow \stopxtable} > >> > > > >> > > \starttext > >> > > \Works \stopxtabl

Re: [NTG-context] xtables in custom macros

2011-11-04 Thread Hans Hagen
On 4-11-2011 11:11, Thomas A. Schmitz wrote: On 11/4/11 10:38 AM, Hans Hagen wrote: \def\test {\setbuffer[demo] \startxtable \startxrow \startxcell does not work \stopxcell \stopxrow \stopxtable \endbuffer \processxtablebuffer[demo]} Hans, is the solution to my xml problem along these lines

Re: [NTG-context] xtables in custom macros

2011-11-04 Thread Thomas A. Schmitz
On 11/4/11 10:38 AM, Hans Hagen wrote: \def\test {\setbuffer[demo] \startxtable \startxrow \startxcell does not work \stopxcell \stopxrow \stopxtable \endbuffer \processxtablebuffer[demo]} Hans, is the solution to my xml problem along these

Re: [NTG-context] xtables in custom macros

2011-11-04 Thread Hans Hagen
On 3-11-2011 23:01, "Stefan Müller" wrote: \define\Doesnt{\startxtable \startxrow \startxcell does not work \stopxcell \stopxrow \stopxtable} > > > > \starttext > > \Works \stopxtable > > %\Doesnt > > \stoptext \def\test {\setbuffer[d

Re: [NTG-context] Handling EMBED tag in Tex

2011-01-06 Thread Anand Raj
.5,4],"44","above");text([3.5,2],"44","right");stroke="red";fontfill="red";line([1,0],[1,4]);text([1,2],"?","right");' >>> /> >>> >> >> Write the whole block to a external file and read

Re: [NTG-context] Handling EMBED tag in Tex

2011-01-06 Thread Hans Hagen
. \startxmlsetups xml:embed \setbuffer[embed]\xmlflush{#1}\endbuffer \savebuffer[embed][embed.svg] \externalfigure[embed.svg] \stopxmlsetups remind me to make a \xmltofile some time

Re: [NTG-context] Handling EMBED tag in Tex

2011-01-06 Thread Wolfgang Schuster
,[3,0],[0,0]]);text([2.5,4],"44","above");text([3.5,2],"44","right");stroke="red";fontfill="red";line([1,0],[1,4]);text([1,2],"?","right");' > /> Write the whole block to a external file and read import it

Re: [NTG-context] buffers and expansion order

2010-12-13 Thread Wolfgang Schuster
Am 13.12.2010 um 12:04 schrieb Yury G. Kudryashov: > Hi! > > Why the following doesn't work? > > \def\mybuf{\startbuffer[a]b\stopbuffer} \def\mybuf{\setbuffer[a]b\endbuffer} Wolfgang ___ If

Re: [NTG-context] vbox construct breaking MKII

2010-08-04 Thread Aditya Mahajan
tartbuffer writes it to an external file. Something that combines the two will be great. Such a feature will be handy for inline syntax highlighting with the t-vim module. \setbuffer[bla]more bla\endbuffer That does not work in mkii and does not look right for the user interface. For pret

Re: [NTG-context] vbox construct breaking MKII

2010-08-04 Thread Hans Hagen
onality is already there. \type parses the contents correctly, and \startbuffer writes it to an external file. Something that combines the two will be great. Such a feature will be handy for inline syntax highlighting with the t-vim module. \setbuffer[bla]more bla

Re: [NTG-context] from latex & pstricks to context

2009-07-13 Thread luigi scarso
box{#2}} {\startTEXapplication[#1]{\usemodule[pstric]}#2\stopTEXapplication}} for \startTEXapplication see page-app.tex \long\def\dostartTEXapplication[#1]#2#3\stopTEXapplication {\bgroup \bgroup \let\f!temporaryextension\c!tex \setbuffer[\@@texapp]% \starttext #2% pr

Re: [NTG-context] \setbuffer

2009-05-10 Thread Hans Hagen
Wolfgang Schuster wrote: Am 14.02.2009 um 10:09 schrieb Wolfgang Schuster: Hi Hans, why is \setbuffer not defined as \long, I want to use it as part of a macro and need it to allow paragraphs as content. Can you change this? no need as \dosetbuffer is defined as \long and \setbuffer

Re: [NTG-context] \setbuffer

2009-05-10 Thread Wolfgang Schuster
Am 14.02.2009 um 10:09 schrieb Wolfgang Schuster: Hi Hans, why is \setbuffer not defined as \long, I want to use it as part of a macro and need it to allow paragraphs as content. Can you change this? TIA, Wolfgang

Re: [NTG-context] \setbuffer

2009-02-24 Thread Wolfgang Schuster
On Sat, Feb 14, 2009 at 10:09 AM, Wolfgang Schuster wrote: > Hi Hans, > > why is \setbuffer not defined with \long, I want to use it as part > of a macro and need it to allow paragraphs as content. > > Can you change this? &

Re: [NTG-context] \setbuffer

2009-02-19 Thread Wolfgang Schuster
Am 14.02.2009 um 10:09 schrieb Wolfgang Schuster: Hi Hans, why is \setbuffer not defined with \long, I want to use it as part of a macro and need it to allow paragraphs as content. Can you change this? TIA, Wolfgang

[NTG-context] \setbuffer

2009-02-14 Thread Wolfgang Schuster
Hi Hans, why is \setbuffer not defined with \long, I want to use it as part of a macro and need it to allow paragraphs as content. Can you change this? TIA, Wolfgang ___ If your question is of interest to others

Re: [NTG-context] creating environments

2007-02-05 Thread Wolfgang Schuster
gt; > >>> I defined my environment in this way: > >>> > >>> \def\startFOO#1\stopFOO{...} > >>> > >>> This means TeX reads everything from \startFOO till \stopFOO and > looks > >>> afterwards at the replacement text. > >>&

Re: [NTG-context] creating environments

2007-01-31 Thread Wolfgang Schuster
gt; >> >>> I used tried the first way with saving the content into a buffer and >>> using the buffer content. >>> >> If you want to write to a buffer and later use it, there are low level >> macros to define your own buffer commands. Have a look at the

Re: [NTG-context] creating environments

2007-01-31 Thread Hans Hagen
>> >> >>> I used tried the first way with saving the content into a buffer and >>> using the buffer content. >>> >> If you want to write to a buffer and later use it, there are low level >> macr

Re: [NTG-context] LilyPond module for LilyPond 2.9.x

2006-10-03 Thread Mojca Miklavec
; \unprotect > \def\??lily{lilypond-} > %... > \newcount\lily!figures > %... > \long\def\dodostartlilypond[#1]#2\stoplilypond{% > \egroup% from \dostartlilypond > \bgroup% > %... > \global\advance\lily!figures\plusone > \startmode[*\v!first]% >

Re: [NTG-context] LilyPond module for LilyPond 2.9.x

2006-10-03 Thread Henning Hraban Ramm
artlilypond[#1]#2\stoplilypond{% \egroup% from \dostartlilypond \bgroup% %... \global\advance\lily!figures\plusone \startmode[*\v!first]% \def\obeyedlines{\string^^J}% \convertargument#2\to\ascii \expanded{% \setbuffer[lilypond-\the\lily!figures]% %>> here it works, all

Re: [NTG-context] counting the words in a TeX document

2006-08-07 Thread Mojca Miklavec
echansim will never be > perfect (or close to perfect) in the sense of parsing arbitrary input. The most dummy solution that I could think of (using slightly modified Hans's ruby script): \unprotect \def\startstatistics {\dodoubleempty\dostartstatistics} \def\dostartstatistics[

Re: [NTG-context] t-rsteps and starttyping

2005-09-22 Thread David Munger
block. > > Please try this: > > \bgroup > > \catcode`\^^M=\active > > \gdef\StartLong{\begingroup\obeylines\let^^M^^J\doStartLong} > > \egroup > > \def\doStartLong#1\StopLong{% > \setbuffer[x]#1\endbuffer > \endgroup > \getbuffer[x] > }

Re: [NTG-context] t-rsteps and starttyping

2005-09-21 Thread Christopher Creutzig
let^^M^^J\doStartLong} \egroup \def\doStartLong#1\StopLong{% \setbuffer[x]#1\endbuffer \endgroup \getbuffer[x] } \starttext \StartLong \starttyping abcde \stoptyping and now for something completely different \StopLong \stoptext Christopher ___ nt

Re: [NTG-context] command definition

2004-06-25 Thread Hans Hagen
[EMAIL PROTECTED] wrote: is it possible anything like the following ? \def\MySomeTable#1% { \startbuffer #1 \stopbuffer } buffers use catcode trickery, so cannot be used in macros'; you can use \setbuffer[name]{...} with \getbuffer[name] \MySomeTable{ \starttable blah blah blah... \stop

Re: [NTG-context] Re: Typesetting music in ConTeXt

2003-12-12 Thread Hans Hagen
in context for processign snippets, something along the lines: \long\def\dostartTEXapplication[#1]#2#3\stopTEXapplication {\bgroup \bgroup \let\f!temporaryextension\c!tex \setbuffer[\@@texapp]% \ifx\starttext\undefined \pdfoutput=1 \pdfcompresslevel=9