After learning Java in the spring of '96 I was wanting a utility which would convert Java source to a nicely typeset and formatted output file. I could not find such a creature, and hence decided to write a small utility to do just that.

The most useful aspects, besides the sparse font highlighting, are the -toc and -head switches which turn on table of contents generation and header generation, respectively. Most useful for multiple file dumps.

$ java2latex -h
      

for basic usage information. You can use wildcards for filenames if your shell will expand them -- java2latex WON'T expand wildcards itself. You should redirect output to some file. This is the LaTeX (2.09) source which will need to be compiled. You will also need the fullpage.sty input file installed on your system. If you don't, simply remove that line from the source.

A typical usage might be the following:

$ java2latex -toc -head *.java >javasrc.ltx
$ latex javasrc.ltx
(lots of latex output here -- ignore warnings)
$ dvips javasrc.dvi
      

The source, in flex, is available here. You can try, but I don't think it will work with ordinary lex. Feel free to modify the source as needed. I've placed it in the public domain. If you need it, you can also get the Makefile (it's pretty trivial).

Of course, there are some known bugs. At this time they are:

If you have other bugs to report, or suggestions to improve the program, I'd love to hear them. Just send me mail and I'll see what I can do.


Home Mail Since 6/12/96: Counter

Last modified: Tue Aug 27 13:32:47 PDT