in reply to printing source code green bar style

a2ps (the swiss knife of pretty-printing) actually already has support for doing this. a2ps uses different styles for its printouts and one of those is named 'matrix'.
so, by running:

a2ps --prologue=matrix -o test.ps test.pl

it will generate a suitable matrix style printout. The default is to alternate the background each 6. line, but this can be adjusted. (I tested with a2ps 4.13b. I had a postscript-problem with an earlier version before I asked apt to kindly update it.)

I actually didn't find out how to adjust that value now, so I ended up patching matrix.pro (the prologue file). I changed the expand-line to:

%Expand:  nline #{pro.matrix.cycle:-2} mod #{pro.matrix.gray:-1} ge {

-Thorkild

PS: Yes, a2ps knows perl already

Replies are listed 'Best First'.
Re^2: printing source code green bar style
by BlndCat (Initiate) on Sep 20, 2004 at 15:56 UTC
    First of all, thanks for all the helpful replies. Especially to hsmyers because I was starting to think that I was the only one who ever wanted to print-out code in such a way. And also to Thorkild. I've just had a look at a2ps and it seems that it might do the trick, especially with the patched matrix.pro file.

    I might still try to implement it using perl and outputting html etc. in the future but in the meantime, I'll use the right tool for the right job.

    thanks again!