Literate Programming

Tim Arnold tim.arnold at sas.com
Mon Apr 11 18:39:50 CEST 2011


"Hans Georg Schaathun" <hg at schaathun.net> wrote in message 
news:aca678-b87.ln1 at svn.schaathun.net...
> On Fri, 8 Apr 2011 12:58:34 -0400, Tim Arnold
>  <tim.arnold at sas.com> wrote:
> :  If you already know LaTeX, you might experiment with the *.dtx docstrip
> :  capability.
>
> Hi.  Hmmm.  That's a new thought.  I never thought of using docstrip
> with anything but LaTeX.  It sounds like a rather primitive tool for
> handling python code, and I would expect some serious trouble getting
> sensible highlighting in vim/eclim (or most other editors for that
> matter).  But I'll give it a thought.  Thanks.
>
> :  It has some pain points if you're developing from scratch, but I use it 
> once
> :  I've got a system in reasonable shape.
>
> Hmmm.  I wonder if I am every going to reach that stage :-)
>
> :             You have full control over the
> :  display and you can make the code files go anywhere you like when you 
> run
> :  pdflatex on your file.
>
> If you use docstrip with python, what packages do you use to highlight
> code and markup programming concepts (methods/classes/variables)?
> If I may ask ...
>
> -- 
> :-- Hans Georg

I don't use anything special, just the verbatim environment is fine for my 
purposes.  But you might like the listings package which iirc has syntax 
highlighting built-in for python. ah, yes:
http://en.wikibooks.org/wiki/LaTeX/Packages/Listings

There's also the 'fancyvrb' package:
http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb

good luck,
--Tim





More information about the Python-list mailing list