-
Printing source code
Hi,
I'm writing an application for a thesis for school. We'd like to include a printout of the source code when we hand in our thesis.
Because there a lot of source code files, printing each on individually would take a lot of time. Does anybody know if there's a program to format and print source code files? (on Linux or Windows) Or another handy way :P
-
Re: Printing source code
The easiest way would be to just concatenate the entire lot and print that. It'll save on paper too.
cat *.c >output
cat *.h >>output
-
Re: Printing source code
Apply doxygen to your sources. You can then produce a very nice PDF with all your source code files correctly indented and formatted. Plus if you want it can also generate API documentation, inheritance graphs, etc.
Here is a short example of source code printout.
-
Re: Printing source code
From what I know either vim or emacs (I don't remember which one) provides nice code pretty-printing capabilities. Otherwise if you want your code to look professional, use LaTeX with the listings package.
http://ctan.org/tex-archive/macros/l...s/listings.pdf
BTW. It's a good idea to write the thesis itself in LaTeX too.
-
Re: Printing source code
Yes, I already had written my thesis in LaTeX. And that was really much better than with Word :D
Anyway, I ended up with manually creating a LaTex file (and using lstlistings), so I could remove the comments and the beginning of each file, sort the files on subject (GUI, math etc.)