[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [help-texinfo] Embed pstricks, metapost or asymptote markup in texin

From: lfinsto1
Subject: Re: [help-texinfo] Embed pstricks, metapost or asymptote markup in texinfo ?
Date: Thu, 4 Oct 2007 22:37:28 +0200 (CEST)
User-agent: SquirrelMail/1.4.9a

Karl Berry wrote:

> B. Thomas wrote:

>     Is it possible to embed pstricks, metapost or asymptote markup
>     in texinfo source?
> Only if you also write a pre/postprocessor to do something with it.
> Or play some horrible trick with \write18.
> Neither of which would be fun.

It's perfectly easy to embed MetaPost code in Texinfo inside
@end tex
@end iftex

and write it to a file using `\write'.  In my answer to your similar
question on the `comp.text.tex' newsgroup, I posted an example where I did
something very similar using C++ code for an old version of GNU 3DLDF.  It
would work just the same for MetaPost.  It requires an additional pass of
TeX, that is, additional to the two that Texinfo already requires.

In the first pass, the code is written to a file.  Then, you would call
MetaPost on that file.  If you wish, you can convert the EPS files to PNG.
 In the second pass, the images are included in the TeX file.  The
additional pass would be for Texinfo to generate the table of contents and
index or indices.  Depending on what you'd already done, the contents and
indices might already be up-to-date, and/or the images might already

I don't know whether this would work with PSTricks or Asymptote.  That's
not my department.

With all due respect to Karl, it _was_ fun.

>     change the latex preamble for the generated document?
>     For instance to include "\usepackage{pst-plot}".
> The standard Texinfo doesn't use LaTeX at all.
> On the other hand, maybe what would help is the texi2latex program at
> -- it converts Texinfo to LaTeX, and then you can
> do LaTeX-y things.
>     Alternatively can postscript
>     code be embeded directly in the info source ?
> Same answer as above.  Texinfo is converted to much more than just
> PostScript, so there's no way to use PostScript "natively".

For what it's worth, I don't see any advantage to using LaTeX, as Texinfo
already defines a format.  On the other hand, if you prefer using LaTeX,
there's no reason why you shouldn't.  However, I don't see any reason to
mix it with Texinfo.

By the same token, I haven't ever had any reason to use PostScript
directly, since MetaPost is a convenient interface to it.  That's not to
say I never will or that PostScript isn't interesting in itself.  I think
it should be possible to use the technique outlined above for PostScript,
but I've never tried it.  I do find it to be a somewhat low-level and
verbose language.

Laurence Finston

reply via email to

[Prev in Thread] Current Thread [Next in Thread]