[NTG-context] \bufferprefix in MKIV

Mojca Miklavec mojca.miklavec.lists at gmail.com
Fri Jan 28 00:36:12 CET 2011

On Thu, Jan 27, 2011 at 20:08, Aditya Mahajan wrote:
> On a unrelated note, I have been thinking if I can extend the filter module
> to take care of features provided by lilypond and gnuplot modules. IIUC, in
> both these modules, the input is transformed before being written to an
> output file

It is not really transformed, at least not in the case of gnuplot. At
the moment it is composed out of three parts (so it should be easier
to handle):
a) set term <nameofterminal> <options>; set output
b) everything inside \startGNUPLOTinclusions ...
\stopGNUPLOTinclusions (that could be covered by continue=yes to some
c) everything inside \startGNUPLOTscript ... \stopGNUPLOTscript

But if I was to rewrite the code for MKIV, I would try to pipe input
to gnuplot and pipe it back to ConTeXt to avoid zillions of
intermediate files (and maybe also to make it slightly faster).

> then an external filter is run and the output is read back
> again. If we  restrict ourselves to MkIV, then the transforming the input
> can be done in a lua function; the filter module already takes care of the
> rest of the book-keeping.
> Do you think that it makes sense to have such a feature? Then you could just
> define the gnuplot module as:
> \usemodule[filter]
> \defineexternalfilter[GNUPLOT]
>   [filter={gnuplot --appropriate options},
>    conitnue=yes,
>    transformation=thirddata.GNUPLOT.transformation,
>   ]

What exactly would the transformation do? Append the first line (set
terminal etc.)?

Other functionality of current module includes features such as
but that is not part of your work.


More information about the ntg-context mailing list