Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I use the cli a lot and print off documents that I have created in vim or a simple man page that I want a hard copy. However, the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2010
    Location
    Virginia
    Posts
    9

    Format print output of lp command


    Hello,

    I use the cli a lot and print off documents that I have created in vim or a simple man page that I want a hard copy. However, the actual print out looks terrible: the lines are not left justified. I am not able to discern a pattern but I figure there is one. Are there any tricks on making man pages or vim docs print out more appealing?

    Also, I am not sure what category "Printing problems" go into so if this is not the correct one, please let me know so I can move it to the appropriate one.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,530
    See the groff man page. The groff command is the successor to troff and nroff, unix text formatting programs. In any case, it allows you to embed formatting commands in your text file so that it produces the output you want. TEX is another option that has more professional output capabilities, but is more complex and difficult to learn.

    As for man pages, use the --preformat option and pipe the output to lpr. IE: man --preformat subject | lpr ...
    FWIW, man uses groff mostly for formatting. See the man config file /etc/man.config.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •