[antlr-interest] grammar to latex

Ana Nelson nelson.ana at gmail.com
Sun Jun 1 03:29:09 PDT 2008


Hi, Felix,

Don't worry, this wasn't your fault. :-) These things are just addictive.
And, when I read your email I wasn't sure if this was exactly what were
looking for so I just did this out of curiosity.

If you want syntax highlighting using fonts rather than colours, this should
be possible to implement in Pygments but it's not supported at the moment,
just bold/italic etc. are. I think it'd just be a case of writing a custom
latex formatter which emitted e.g. \textrm rather than \colorbox.

It would probably be useful to have this option for people needing to
publish in black and white. I might take a quick look, but I don't know if
I'll have time to do this myself.

Anyway, if you think you want to use this you might try installing Pygments,
preferably the development version, and see how you get on with it.

You could alternatively search for a syntax highlighter with font support
already (I don't know if there is one or not) and write a grammar for that.
Or, if you are just looking for very basic decorations, maybe an existing
grammar would be close enough. (I used to use highlight
http://www.andre-simon.de/ and it worked fine, but I never tried modifying a
grammar.)

-Ana


2008/5/31 Felix Dorner <felix_do at web.de>:

> Hei Ana,
>
> gee, I hope I didn't keep you from socializing this weekend... The example
> looks cool. I don' t know pygments, what I really would like is not syntax
> coloring, but fontification, such that terminals (Strings in ' ' would get
> typewriter font, braces and other ebnf specials roman, and all other stuff
> (rules and subrules) italic. Would this be easy too?
>
> Felix
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080601/66211dc1/attachment.html 


More information about the antlr-interest mailing list