Printing Source Code

There are times when you want to print out some source code onto paper to make it easier to review. However, source code tends to be full of whitespace, so printing it as-is wastes a lot of the page.

Using trueprint and ps2pdf, we can generate something a little more convenient without sacrificing too much readability.

$ trueprint -C --I --n -G2 -2 filename.c | ps2pdf - output.pdf

There’s probably better ways these days, but this has held up over time.


linux

81 Words

2019-02-16 02:32 +0000