View Full Version : Printing source code
Persoontje
25th November 2009, 11:56
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
squidge
25th November 2009, 16:16
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
Gnurou
28th November 2009, 13:24
Apply doxygen (http://www.stack.nl/~dimitri/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 (http://www-scf.usc.edu/~peterchd/doxygen/example/parser_8c-source.html) is a short example of source code printout.
wysota
30th November 2009, 08:28
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/latex/contrib/listings/listings.pdf
BTW. It's a good idea to write the thesis itself in LaTeX too.
Persoontje
2nd December 2009, 21:50
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.)
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.