From: Henning Hraban Ramm <hraban@fiee.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: t-filter for LilyPond enhancements
Date: Sun, 20 Jan 2013 21:35:31 +0100 [thread overview]
Message-ID: <3858932E-1242-408E-91E7-21E4933B088E@fiee.net> (raw)
In-Reply-To: <alpine.LNX.2.02.1301201511110.13787@ybpnyubfg.ybpnyqbznva>
Am 2013-01-20 um 21:19 schrieb Aditya Mahajan:
> Unfortunately no. The name key is reset at every `\startexternalfilter`; otherwise it will be difficult to mix `name=....` with normal usage.
What do you think about using UIDs (or maybe some hash value of the buffer) instead of serial numbers? It might help with other uses of t-filter to be able to re-order the filter sections without re-compiling.
>> Thanks, handling of multipage PDFs might help, but I’d try a different approach: LilyPond can generate EPS/PDF for single note systems and writes the number of them into a simple text file. I’d parse that with Lua and place all those small PDFs. I just need a clue how I must define t-filter’s "readcommand" as a Lua function.
>
> Something like this:
>
> \def\ParseLilypondFile#1%
> % #1 is the name of the output file
> {\ctxlua{thirddata.parselilypondfile("#1")}
>
> \startluacode
> thirddata = thirddata or {}
> function thirddata.parselilypondfile(name)
> --- parse "name" file as you wish and
> --- generate approapriate context(...) commands
> --- to write back to ConTeXt
> end
> \stopluacode
>
> \defineexternalfilter[lilypond]
> [
> .....
> readcommand=\ParseLilypondFile,
> ....
> ]
Thank you very much! It’s been a while since I wrote my last Lua code for ConTeXt...
I’ll just update the LilyPond wiki page (and then delete everything about the old LilyPond module).
Greetlings, Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
prev parent reply other threads:[~2013-01-20 20:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-20 12:15 Henning Hraban Ramm
2013-01-20 16:57 ` Aditya Mahajan
2013-01-20 20:02 ` Henning Hraban Ramm
2013-01-20 20:19 ` Aditya Mahajan
2013-01-20 20:35 ` Henning Hraban Ramm [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3858932E-1242-408E-91E7-21E4933B088E@fiee.net \
--to=hraban@fiee.net \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).