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
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.