lout-users
[Top][All Lists]
Advanced

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

Re: Can anyone save my sanity -- help me to understand filtering?


From: Valeriy E. Ushakov
Subject: Re: Can anyone save my sanity -- help me to understand filtering?
Date: Thu, 5 Jul 2001 01:53:47 +0400
User-agent: Mutt/1.3.3i

On Wed, Jul 04, 2001 at 22:56:03 +0400, Graham Douglas wrote:

> Firstly, I'm running Lout 3.24 on Windows 98.

Haven't tried 98, but on NT filtering works.  But then. NT is sort of
posixish...


> --what are @FilterIn/@FilterOut
> --HOW are these used

These lout symbols expand to file names.  Lout writes the right/body
parameter to a file and @FilterIn stands for the name of that file.

Then lout executes your @Filter and it wants to read replacement text
from the file and @FilterOut stands for the name of that file.

So when you write your @Filter (invocation command), you use @FilterIn
and @FilterOut for the input and output file names.

E.g. on a Unix system, given:

    def @ShellScriptOutput
      right x
    {
      # The right parameter is the shell script.  Run shell on it
      # collectign output at the place Lout expects it at
      def @Filter { sh @FilterIn > @FilterOut }
    
      x
    }

you can say:

    Now is: @ShellScriptOutput { date }


> Everything I try keeps giving me errors concerning Lout1/Lout2 etc
> where do these files come from???  I just don't get it. Sigh.

Those are temporary files (@FilterOut in this case).


> How can I get Lout to run the "Lua foo.lua" command and subsequently
> import "foo.eps"?

    def @GenerateEPS
      # right param is a shell script that should echo the EPS file _NAME_
      # to the standard output
      right x
    {
      def @Filter { sh @FilterIn > @FilterOut }
      @IncludeGraphic { x }     # get the file name from the script
    }

Use like this:

    @GenerateEPS {
    cp su_crest.eps my.eps      # cheat ;-)
    echo my.eps                 # tell lout the EPS file name
    }


> Also, is it possible to embed raw Lua code into Lout and have this
> passed (in a file) to the Lua interpreter?

See above (where shell code is embeded).


> Likewise for MetaPost code -- can I write inline MetaPost code, run
> MetaPost and then import the EPS?

Ditto.


Hope this helps.

SY, Uwe
-- 
address@hidden                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen


reply via email to

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