Program for C source --> TeX formatted C source

Program for C source --> TeX formatted C source

Post by Timothy L. Na » Thu, 06 Aug 1992 05:17:12



    A few days ago, I got tired of the printed output I got from just
doing "cat foo.c > /dev/lp1".  So I wrote a little program that inserts
the proper formatting commands so that I can pump my source code through
TeX and dvilj2p to get a nice printout.  It takes in a file foo and a
header file containing TeX macros (making it easy to change things like
page layout, fonts, etc.) and produces the file foo.tex.  It can also
apply different styles to different sections of code (comments in
italics, global stuff in bold, etc.).

    I would like to know if anyone is interested in using this.  The
code needs to be cleaned up a little (Everything right now is hard-coded
to my preferences), and I don't want to waste my time doing that if
nobody want to use it.  Please respond by email, not by posting to
comp.os.linux (No need to waste bandwith on this).  If there's enough
interest, I clean up the code and upload it to the usual FTP sites.

BTW, if there's already a program or TeX macro file that does this,
please tell me; I hate reinventing things :-)

_____________________________________________________________________________

 Tim Nali            \  "We are the music makers, and we are the dreamers of

 
 
 

Program for C source --> TeX formatted C source

Post by Duty Programm » Mon, 10 Aug 1992 14:18:50



|> doing "cat foo.c > /dev/lp1".  So I wrote a little program that inserts
|> the proper formatting commands so that I can pump my source code through
|> TeX and dvilj2p to get a nice printout.  It takes in a file foo and a
|>
|> BTW, if there's already a program or TeX macro file that does this,
|> please tell me; I hate reinventing things :-)

There certainly is: tgrind. From the README:

This is a pretty printer similar to 4bsd's "vgrind" except it uses
TeX instead of troff.  It was written by Van Jacobson of Lawrence

It's available from csc-sun.math.utah.edu as /pub/tex/pub/tgrind/tgrind.tar.Z,
also at ee.lbl.gov and psuvax1.cs.psu.edu.

rab
--
------------------------------------------------------------------------

School of Physics                 | Phone : +61 3 344 5081
University of Melbourne           | Fax   : +61 3 347 4783
Parkville Victoria AUSTRALIA 3052 | Telex : AA35185