[metapost] generic TeX interface?

Taco Hoekwater taco at elvenkind.com
Sun Dec 10 11:37:05 CET 2006

Stephan Hennig wrote:

> I've attached a first attempt to implement such an interface to this
> mail.  Unfortunately, my solution doesn't work for the btex..etex case.
>  Since text between btex..etex is interpreted verbatim you can't write
> something like
> btex s etex
> to compile a string s.  I've tried
> scantokens("btex " & s & " etex")
> but scantokens refuses to process btex..etex constructs complaining
> | ! You can only use `btex' or `verbatimtex' in a file.
> I think that's the reason the TEX package was written.  Is there any
> work around that?

In short: no. The only solution is to write a string to a file;
then include the file (which is exactly what the TEX package does).

> Additionally, let me add, that in the longer term I'd like to see native
> support for something like that in MetaPost, not only a package.  What
> do you think?

Conceptually, btex .. etex is preprocessed much like 'pic', 'eqn' and
'tbl' in troff. It turns out to be really hard to change that behaviour
while remaining backward compatible. However, I see no problem with
inventing a completely new subsystem. Do you have any ideas about how
this should work (at the lowest level)?


More information about the metapost mailing list