How to print source code from the command line

Ken Shaffer Kenneth_C_Shaffer at comcast.net
Thu Jan 1 17:25:23 PST 2015


My favorite a2ps output is:
a2ps -C -MLetterdj -2
which gives me a tiny line number every 5 lines, and is 2 up,
(on a deskjet device, change for your printer).  All the other headers,
footers, and boarders are standard.
Ken
On Thu, 2015-01-01 at 13:54 -0800, Michael Shiloh wrote:
> To answer my own question:
> 
> 	sudo apt-get install a2ps
> 
> 	a2ps - format files for printing on a PostScript printer
> 	By default, the output is sent to the default printer.
> 
> works almost perfectly, with a bit of tweaking of my left margin. Of course
> now my printer is out of ink, wouldn't you know...
> 
> Michael
> 
> On Thu, Jan 01, 2015 at 12:32:22PM -0800, Michael Shiloh wrote:
> > Happy new year everyone. I hope you all had a safe and sane NYE.
> > 
> > I have some C code I'd like to send to my printer from the command line. In
> > the old days we'd use lpr, but it was always a bit fidly to get line breaks
> > and margins in the right places. 
> > 
> > Is there something more modern, perhaps something with extra features
> > like an option to add lines number or syntax highlighting?
> > 
> > I suppose a fancy new editor (like "sublime text" or "atom") might have a
> > print button, but there are times when I just want to print from the command
> > line. 
> > 
> > Surely there must be a way. It is, after all, 2015.
> > 
> > By they way, Bobbie, is there any reasone we don't set up a Google Group, just
> > for the purpose of using it as a mailing list? Or are there people on this
> > list who prefer not to use Google, which is very understandable?
> > 
> > Michael
> > 
> > 
> > On Tue, Dec 30, 2014 at 02:35:47PM -0800, Bobbie Sellers wrote:
> > > 
> > > 	Just cut this text when you want to send a message to the list.
> > 
> > -- 
> > Michael Shiloh
> > Associate Professor
> > Electronics, Programming, and Robotics
> > California College of the Arts
> > 
> > Teaching: www.teachmetomake.com/wordpress
> > 
> > Recently published:
> > 
> > 	Make: Getting Started with Arduino, 3rd Edition
> > 	By Massimo Banzi and Michael Shiloh
> > 	http://shop.oreilly.com/product/0636920029267.do
> 





More information about the sf-lug mailing list