mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] Re: subtracting lines from a include


Chronological Thread 
  • From: Corey Sweeney <address@hidden>
  • To: Bas Spitters <address@hidden>
  • Cc: address@hidden
  • Subject: Re: [TeXmacs] Re: subtracting lines from a include
  • Date: Tue, 9 Aug 2005 17:49:11 -0500
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VVJl5L2UnX9ID8wt9ZhJ+jV4ZJWwyFGN8oIK0oohVRQhSvEAIx288BcYdR7nAqvv3jq398u8AINFR7SnWbSZmMLxXKDh0lPHF7Be6DZFGwipk3b4gePckP1xp0LmvFsLbrsGTXbc762eFO3dEPYGgK8MPd+pZEZStgmHR85IJSc=

I think I'm getting close. I found help in some shell examples in the
image converter, and copied the format. I wrote "trim-header" to
accept a filename, and display to standard out. so:

(define-format html-with-header
(:name "html with a extra header")
(:must-recognize (lambda (x) (equal? (substring x 0 3) "Wik"))))

(converter html-with-header html
(:shell "trim-header" from ">" to ))
; (:shell "/home/temp3/trim-header" from ">" to ))

but when i do a "\include ./myfile" inside texmacs, i get "bad format
or data". If i include a "normal" file, this dosn't happen, so the
auto-recoginiztion is working.

I set the first line of trim-header to display "i'm running" to
standard error, and tried running it, but the message never displays,
so i think "trim-header" is never running. I tried turning security
off, and puting the bin in /usr/local, but no go. I tried running it
at the bash command line, and it works fine, so it shouldn't be a
permission problem. Any ideas what could be happening?

Corey





On 8/9/05, Corey Sweeney <address@hidden> wrote:
> Ok, it looks like i want something like:
> --------------------
> ;;texmacs converter thing
> (define-format html-with-header
> (:name "html with a extra header")
> (:must-recognize (lambda (x) (equal? (substring x 0 3) "Wik"))))
>
> (converter html-with-header html
> (:shell "~/strip-header"))
> ----------------------
>
> where "~/strip-header" is the program that does the translating.
>
> Then inside my texmacs document I should call it with:
> <converter-input|html-with-header|<include|~/mangled-web-file>>
>
> or maybe just <include|~/mangled-web-file>, if everythings automatic.
>
>
> Now i'm fuzzy as to how i'm supposed to pass the data across. (:shell
> prog prefix-args from innfix-args to postfix-args)
>
> Is "from" and "to" supposed to be the filenames that texmacs reads from?
>
> like:
>
> (:shell "~/strip-header" "temp.file.1" "temp.file.1.html")
>
> but i'm guessing that *-args are texmacs arguments, as if they were to
> the shell program, there wouldn't be 3 of them.
>
> Or is the shell program supposed to read/write with standard
> output/standard input? That'd be really easy to write into the shell
> app.
>
> Corey
>
>
>
>
>
>
> On 8/9/05, Bas Spitters <address@hidden> wrote:
> > On Monday 08 August 2005 23:45, Corey Sweeney wrote:
> > > another idea.... it just occured to me that sessions might be right
> > > for this. Here's the idea:
> > >
> > > Write a program that filters out the first 3 lines, then have a
> > > session which calls the program and reports the output. Something
> > > like \session "filter3lines.exe {filename}". Then write a macro to
> > > wrap it, so something like \include-filtered {filename}, then presents
> > > it?
> > >
> > > I havn't worked in sessions yet. Does anyone this this would work?
> >
> > For instance, have a look at my recent post of a generic latex plugin at
> > texmacs-dev. (and look at Joris' answer).
> >
> > Bas
> >
>



Archive powered by MHonArc 2.6.19.

Top of page