Re: Printing man pages

2006-03-02 Thread Jean-Rene David
* Reid Thompson [2006.03.02 14:15]:
> man groff | enscript  -p - | ps2pdf - groff.pdf

One less step:

man -Tps groff | ps2pdf - groff.pdf

I find the output prettier too.

-- 
JR

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Printing man pages

2006-03-02 Thread George
On Thu, Mar 02, 2006 at 02:11:09PM -0500, Reid Thompson wrote:
> Reid Thompson wrote:
> >George wrote:
> >>[...]
> >man groff | enscript  -p - | ps2pdf - groff.pdf

I am thoroughly impressed.  For man pages, I think this is optimal as
the default enscript font setting is fixed pitch, and enscript provides
a huge number of options to further customise things.  Come to think of
it, it's probably better all round, and definitely easier than LaTeX for
those one-off jobs.  

Odd, though, that the original A4 setting in
/usr/share/groff/1.18.1/font/devps/DESC seems not to affect the output.
Maybe I should read up on it in my newly-generated PDF?

> wrapped in a script ...
> man2pdf
> #!/bin/bash
> 
> man $1 | enscript  -p - | ps2pdf - ${1}.pdf
> 
> echo "Created ${1}.pdf"

What, no error checking?  ;-)

Thanks for the help.

-- 
George

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Printing man pages

2006-03-02 Thread Reid Thompson

Reid Thompson wrote:

George wrote:

Generating a PDF from the grep man page, for example, using:

   man -t `man -w grep` | ps2pdf - grep.pdf

which, by default, is actually

   /usr/bin/groff -Tps -mandoc `man -w grep` | ps2pdf - grep.pdf

results in a fairly unattractive PDF file.  The man page title is
dropped from the output, and the top margin is borked.

On the other hand, using

   /usr/bin/groff -Thtml -mandoc `man -w grep` > grep.html

yields something more satisfactory, but not in a format for printing.

I'm finding that reading through the groff man page(s) is like
[obligatory hippo joke], so I'm hoping I'm missing something obvious.

Thanks.

  

man groff | enscript  -p - | ps2pdf - groff.pdf

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


wrapped in a script ...
man2pdf
#!/bin/bash

man $1 | enscript  -p - | ps2pdf - ${1}.pdf

echo "Created ${1}.pdf"
-

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Printing man pages

2006-03-02 Thread Reid Thompson

George wrote:

Generating a PDF from the grep man page, for example, using:

   man -t `man -w grep` | ps2pdf - grep.pdf

which, by default, is actually

   /usr/bin/groff -Tps -mandoc `man -w grep` | ps2pdf - grep.pdf

results in a fairly unattractive PDF file.  The man page title is
dropped from the output, and the top margin is borked.

On the other hand, using

   /usr/bin/groff -Thtml -mandoc `man -w grep` > grep.html

yields something more satisfactory, but not in a format for printing.

I'm finding that reading through the groff man page(s) is like
[obligatory hippo joke], so I'm hoping I'm missing something obvious.

Thanks.

  

man groff | enscript  -p - | ps2pdf - groff.pdf

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Printing man pages

2006-03-02 Thread George
On Thu, Mar 02, 2006 at 02:08:03PM +, Tony Richardson wrote:
> George  sbcglobal.net> writes:
 ^^

Brilliant idea.  I think I'll steal it, and hope others do the same.

> > Generating a PDF from the grep man page, for example, using:
> > 
> >man -t `man -w grep` | ps2pdf - grep.pdf
> > 
> > which, by default, is actually
> > 
> >/usr/bin/groff -Tps -mandoc `man -w grep` | ps2pdf - grep.pdf
> > 
> > results in a fairly unattractive PDF file.  The man page title is
> > dropped from the output, and the top margin is borked.
> 
> Sounds like it might be an incorrect media size setting.
> The default groff PostScript media size is A4.  Changing the
> papersize setting in /usr/share/groff/1.18.1/font/devps/DESC
> to "letter" may help.

Bingo!

It's funny that the thought occurred to me, too.  I came across another
A4 setting somewhere recently and remember being extremely annoyed at
seeing a non-US-centric setting.  The lack of chauvanism was refreshing,
but not so much as to make me feel less annoyed.

Thanks very much for the help.

-- 
George

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Printing man pages

2006-03-02 Thread Tony Richardson
George  sbcglobal.net> writes:
> Generating a PDF from the grep man page, for example, using:
> 
>man -t `man -w grep` | ps2pdf - grep.pdf
> 
> which, by default, is actually
> 
>/usr/bin/groff -Tps -mandoc `man -w grep` | ps2pdf - grep.pdf
> 
> results in a fairly unattractive PDF file.  The man page title is
> dropped from the output, and the top margin is borked.

Sounds like it might be an incorrect media size setting.
The default groff PostScript media size is A4.  Changing the
papersize setting in /usr/share/groff/1.18.1/font/devps/DESC
to "letter" may help.

Tony Richardson




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Printing man pages

2006-03-01 Thread George
Generating a PDF from the grep man page, for example, using:

   man -t `man -w grep` | ps2pdf - grep.pdf

which, by default, is actually

   /usr/bin/groff -Tps -mandoc `man -w grep` | ps2pdf - grep.pdf

results in a fairly unattractive PDF file.  The man page title is
dropped from the output, and the top margin is borked.

On the other hand, using

   /usr/bin/groff -Thtml -mandoc `man -w grep` > grep.html

yields something more satisfactory, but not in a format for printing.

I'm finding that reading through the groff man page(s) is like
[obligatory hippo joke], so I'm hoping I'm missing something obvious.

Thanks.

-- 
George

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/