Possible Duplicate:
syntax_highlight <source_file> | lpr
I have about 20 Python scripts that I wish to print as PDF. I wish to print them the way GEdit would allow me to, with:
- Syntax Highlighting
- Line Numbering
- Page Headers
Is there any way I can achieve this through the terminal or in any other way which allows for batch printing?
One way is to write a small script to wrap it within alltt
or verbatim
and compile it with LaTex. But this seems like an overkill.
I have read the question on SuperUser.SE but all the solutions print the code as if it were a story book; no syntax highlighting or any of the above mentioned requirements. Another similar question on SuperUser.SE uses Mac OSX Automator.
FILENAMEHERE
with$1
in a nicely prepared template LaTeX file doesn't seem like overkill to me; especially given the special packages for source code (see these answers attex.stackexchange.com
). – sr_ Apr 17 '12 at 14:59