I'm looking through some of Wordpress' core code and would like to print it out to review.

I'm looking for a tool that

  • defaults to a monospace font
  • can wrap long lines
  • possibly print line numbers in the left column
  • maximize space usage on a page (i.e. would be nice if it didn't start with 2" margins)

What I've tried already:

  • Textmate: Unable to change screen and print font size independently. I don't want to have to switch back and forth
  • TextEdit: Options don't seem very helpful
  • MS Word: Have to paste the input, change line spacing and font. Painful.
  • Coda: Has the most options. Closest to what I want so far. Does not seem to save my print preferences as defaults though.
link|improve this question

1  
Syntax highlighting (i.e. color) if a known programming language? – Daniel Beck Nov 30 '11 at 6:45
You might want to try to use the compiler that you usually use. Visual studio does a good job, I imagine your compiler (one of them maybe) might do the same. – soandos Nov 30 '11 at 6:54
feedback

1 Answer

up vote 1 down vote accepted

I would use enscript --line-numbers -f fontname --word-wrap --margins=… filename

On my Linux systems enscript filename, by default, prints the file to my default printer (which understands Postscript - I don't buy any other sort).

In OS X, you can print to a PDF file using pstopdf:

enscript --line-numbers -p - --word-wrap Session.java | pstopdf -i -o ~/out.pdf

You can tweak global or personal settings for enscript to make those options standard so you just enter a command enscript filename. You may be able to set up an option in your favourite text editor that invokes external command enscript for you.

link|improve this answer
See here for an OS X workflow with enscript. Hope you don't mind the edit. – slhck Nov 30 '11 at 11:50
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.