Revisiting man files to text editor: info pages

2004-01-04 Thread Antonio Rodriguez
There was a thread a while ago about reformatting man pages for pretty
viewing and printing. I wonder if there are any similar tricks or
ideas for the info pages. I didn't want to awake that sleeping
thread, so I started this with a similar name.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Revisiting man files to text editor: info pages

2004-01-04 Thread Bijan Soleymani
On Sun, Jan 04, 2004 at 02:05:26AM -0500, Antonio Rodriguez wrote:
 There was a thread a while ago about reformatting man pages for pretty
 viewing and printing. I wonder if there are any similar tricks or
 ideas for the info pages. I didn't want to awake that sleeping
 thread, so I started this with a similar name.

All info documentation is written in Texinfo format and then converted
to info, using a program called makeinfo. If you get your hands on the
Texinfo source you can run it through TeX and get dvi or PostScript output
or run it through makeinfo and get info or html. The FSF sells printed
copies of their manuals and they also have them online in various formats
(html, dvi, ps, pdf, etc).

If you don't feel like either getting the Texinfo sources, or downloading
the documentation in a different format, you could always use the
info2man package to convert the info documentation to a manpage and
then print that. But I believe that you would get much better results
from the Texinfo sources.

Bijan
-- 
Bijan Soleymani [EMAIL PROTECTED]
http://www.crasseux.com


signature.asc
Description: Digital signature


Re: Revisiting man files to text editor: info pages

2004-01-04 Thread Antonio Rodriguez
On Sun, Jan 04, 2004 at 02:40:49AM -0500, Bijan Soleymani wrote:
 On Sun, Jan 04, 2004 at 02:05:26AM -0500, Antonio Rodriguez wrote:
  There was a thread a while ago about reformatting man pages for pretty
  viewing and printing. I wonder if there are any similar tricks or
  ideas for the info pages. I didn't want to awake that sleeping
  thread, so I started this with a similar name.
 
 All info documentation is written in Texinfo format and then converted
 to info, using a program called makeinfo. If you get your hands on the
 Texinfo source you can run it through TeX and get dvi or PostScript output
 or run it through makeinfo and get info or html. The FSF sells printed
 copies of their manuals and they also have them online in various formats
 (html, dvi, ps, pdf, etc).
 
 If you don't feel like either getting the Texinfo sources, or downloading
 the documentation in a different format, you could always use the
 info2man package to convert the info documentation to a manpage and
 then print that. But I believe that you would get much better results
 from the Texinfo sources.
 
 Well, the reason for this post is that I had tried info2man with
 coreutils, and here is what I got
info2man /usr/share/info/coreutils.info.gz
info2pod: can't open /usr/share/info/coreutils.info: No such file or
directory
 etc, however, the file exists.
(bug in info2man, in coreutils, or my misunderstanding?)

I am running sid, with coreutils 5.0.91, which is much nicer
documented (personal taste) than 4.5.4 (it is the version whose
documentation can be downloaded from www.gnu.org)

Any ideas?



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Revisiting man files to text editor: info pages

2004-01-04 Thread Wayne Topa
Antonio Rodriguez([EMAIL PROTECTED]) is reported to have said:
 On Sun, Jan 04, 2004 at 02:40:49AM -0500, Bijan Soleymani wrote:
  On Sun, Jan 04, 2004 at 02:05:26AM -0500, Antonio Rodriguez wrote:
   There was a thread a while ago about reformatting man pages for pretty
   viewing and printing. I wonder if there are any similar tricks or
   ideas for the info pages. I didn't want to awake that sleeping
   thread, so I started this with a similar name.
  
  All info documentation is written in Texinfo format and then converted
  to info, using a program called makeinfo. If you get your hands on the
  Texinfo source you can run it through TeX and get dvi or PostScript output
  or run it through makeinfo and get info or html. The FSF sells printed
  copies of their manuals and they also have them online in various formats
  (html, dvi, ps, pdf, etc).
  
  If you don't feel like either getting the Texinfo sources, or downloading
  the documentation in a different format, you could always use the
  info2man package to convert the info documentation to a manpage and
  then print that. But I believe that you would get much better results
  from the Texinfo sources.
  
  Well, the reason for this post is that I had tried info2man with
  coreutils, and here is what I got
 info2man /usr/share/info/coreutils.info.gz
 info2pod: can't open /usr/share/info/coreutils.info: No such file or
 directory
  etc, however, the file exists.
 (bug in info2man, in coreutils, or my misunderstanding?)
 
 I am running sid, with coreutils 5.0.91, which is much nicer
 documented (personal taste) than 4.5.4 (it is the version whose
 documentation can be downloaded from www.gnu.org)
 
 Any ideas?

Yep, gunzip /usr/share/info/coreutils.info.gz
-- 
Any program that runs right is obsolete.
___


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Revisiting man files to text editor: info pages

2004-01-04 Thread Antonio Rodriguez
On Sun, Jan 04, 2004 at 03:02:04AM -0500, Antonio Rodriguez wrote:
 On Sun, Jan 04, 2004 at 02:40:49AM -0500, Bijan Soleymani wrote:
  On Sun, Jan 04, 2004 at 02:05:26AM -0500, Antonio Rodriguez wrote:
   There was a thread a while ago about reformatting man pages for pretty
   viewing and printing. I wonder if there are any similar tricks or
   ideas for the info pages. I didn't want to awake that sleeping
   thread, so I started this with a similar name.
  
  All info documentation is written in Texinfo format and then converted
  to info, using a program called makeinfo. If you get your hands on the
  Texinfo source you can run it through TeX and get dvi or PostScript output
  or run it through makeinfo and get info or html. The FSF sells printed
  copies of their manuals and they also have them online in various formats
  (html, dvi, ps, pdf, etc).
  
  If you don't feel like either getting the Texinfo sources, or downloading
  the documentation in a different format, you could always use the
  info2man package to convert the info documentation to a manpage and
  then print that. But I believe that you would get much better results
  from the Texinfo sources.
  
  Well, the reason for this post is that I had tried info2man with
  coreutils, and here is what I got
 info2man /usr/share/info/coreutils.info.gz
 info2pod: can't open /usr/share/info/coreutils.info: No such file or
 directory
  etc, however, the file exists.
 (bug in info2man, in coreutils, or my misunderstanding?)
 
 I am running sid, with coreutils 5.0.91, which is much nicer
 documented (personal taste) than 4.5.4 (it is the version whose
 documentation can be downloaded from www.gnu.org)
 
 Any ideas?


After trying different options, the nicest looking version is obtained
by processing the source texinfo file:
1. get the source from http://ftp.gnu.org/pub/gnu/coreutils/
2. unpack it, dive into doc directory
3. texi2dvi coreutils.texi 

Thanks to all for the advices given. The variety is always
enlightening.
AR 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Revisiting man files to text editor: info pages

2004-01-04 Thread Bijan Soleymani
On Sun, Jan 04, 2004 at 01:01:10PM -0500, Antonio Rodriguez wrote:
 After trying different options, the nicest looking version is obtained
 by processing the source texinfo file:
 1. get the source from http://ftp.gnu.org/pub/gnu/coreutils/
 2. unpack it, dive into doc directory
 3. texi2dvi coreutils.texi 

Cool.

But I just realized that you can also get the texinfo sources from
the GNU website:
http://www.gnu.org/software/coreutils/manual/coreutils.html
http://www.gnu.org/software/coreutils/manual/texi/coreutils.texi.tar.gz

It's a 190k download instead of a 3 meg one. (Of course I have a high
speed connection, but still...)

Bijan
-- 
Bijan Soleymani [EMAIL PROTECTED]
http://www.crasseux.com


signature.asc
Description: Digital signature


Re: Revisiting man files to text editor: info pages

2004-01-04 Thread Antonio Rodriguez
On Sun, Jan 04, 2004 at 02:51:34PM -0500, Bijan Soleymani wrote:
 On Sun, Jan 04, 2004 at 01:01:10PM -0500, Antonio Rodriguez wrote:
  After trying different options, the nicest looking version is obtained
  by processing the source texinfo file:
  1. get the source from http://ftp.gnu.org/pub/gnu/coreutils/
  2. unpack it, dive into doc directory
  3. texi2dvi coreutils.texi 
 
 Cool.
 
 But I just realized that you can also get the texinfo sources from
 the GNU website:
 http://www.gnu.org/software/coreutils/manual/coreutils.html
 http://www.gnu.org/software/coreutils/manual/texi/coreutils.texi.tar.gz
 
 It's a 190k download instead of a 3 meg one. (Of course I have a high
 speed connection, but still...)
 
 Bijan

Me too (rr at cfl). The problem is that the one indicated by you for
download is about 1 year older. This was the major reason that
prompted me to ask.
Thanks.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-18 Thread Colin Watson
On Thu, Dec 18, 2003 at 02:14:48AM +0100, Jan Minar wrote:
 On Thu, Dec 18, 2003 at 12:50:54AM +, Colin Watson wrote:
  On Thu, Dec 18, 2003 at 12:41:41AM +, Colin Watson wrote:
   The '--pager cat' continues to be unnecessary here; $COLUMNS is still
   honoured. I prefer using the special-purpose $MANWIDTH for this, though.
   
   Narrowing the page does work even if man's output is a terminal.
  
  Looking at the code, a clarification: narrowing the page works if you
  use $MANWIDTH to do it, but not if you use $COLUMNS. It might be
 
 Neither works; man-db 2.3.20-18.woody.4.

Make sure you have no saved cat pages and try again? (A different line
length *should* bypass cat pages, but ...)

-- 
Colin Watson  [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-18 Thread Colin Watson
On Thu, Dec 18, 2003 at 02:09:27AM +0100, Jan Minar wrote:
 On Thu, Dec 18, 2003 at 12:41:41AM +, Colin Watson wrote:
  On Wed, Dec 17, 2003 at 10:14:54PM +0100, Jan Minar wrote:
   This actually should not work, you have to tell man(1) it should
   send the formatted manpage to stdout, instead of messing with the
   pager.
  
  This is incorrect; it is intended to work as Lou described, and it
  does work. man(1) checks whether its standard output is a terminal
  before
 
 Shame on me... I *did* try it, but, by mistake, not on the quick
 machine, but on the slow one--so after I waited for too long, I
 decided it doesn't work (still I think it didn't work this way
 always).

Actually I think I made a late-night error, sorry: it appears to be the
pager that does the terminal check, not man, so it will depend somewhat
on your pager. It does work at least back to potato, though.

(And it's definitely intended to work this way, so I think I'll change
man to make absolutely sure by doing the check itself as well.)

  Narrowing the page does work even if man's output is a terminal.
 
 You're talking unstable, ain't you ;-)  At least in man-db
 2.3.20-18.woody.4, it doesn't.

I'm not talking unstable, no; it works on my stable box.

As I say I think you must have saved cat pages. man-db  2.4.1 looked at
the width and tried to decide if it was close enough to just use a
saved cat page, where close enough meant between 66 and 80. I decided
this check was bogus and removed it in man-db 2.4.1.

This doesn't mean that $MANWIDTH was completely non-functional in
stable, though.

Cheers,

-- 
Colin Watson  [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-18 Thread Jan Minar
On Thu, Dec 18, 2003 at 12:47:35PM +, Colin Watson wrote:
 On Thu, Dec 18, 2003 at 02:14:48AM +0100, Jan Minar wrote:
  On Thu, Dec 18, 2003 at 12:50:54AM +, Colin Watson wrote:
   On Thu, Dec 18, 2003 at 12:41:41AM +, Colin Watson wrote:
The '--pager cat' continues to be unnecessary here; $COLUMNS is still
honoured. I prefer using the special-purpose $MANWIDTH for this, though.

Narrowing the page does work even if man's output is a terminal.
   
   Looking at the code, a clarification: narrowing the page works if you
   use $MANWIDTH to do it, but not if you use $COLUMNS. It might be
  
  Neither works; man-db 2.3.20-18.woody.4.
 
 Make sure you have no saved cat pages and try again? (A different line
 length *should* bypass cat pages, but ...)

| $ ls /var/cache/man/cat1/
| pon.1.gz
| vlock.1.gz
| zsh.1.gz
| $ COLUMNS=30 man man
| [Standard-width appears]
| $ COLUMNS=30 man man | less
| [Yes, now it's 30-column wide]


pgp0.pgp
Description: PGP signature


Re: man files to text editor

2003-12-18 Thread Colin Watson
On Thu, Dec 18, 2003 at 03:30:04PM +0100, Jan Minar wrote:
 On Thu, Dec 18, 2003 at 12:47:35PM +, Colin Watson wrote:
  Make sure you have no saved cat pages and try again? (A different line
  length *should* bypass cat pages, but ...)
 
 | $ ls /var/cache/man/cat1/
 | pon.1.gz
 | vlock.1.gz
 | zsh.1.gz
 | $ COLUMNS=30 man man
 | [Standard-width appears]
 | $ COLUMNS=30 man man | less
 | [Yes, now it's 30-column wide]

I'd like to see 'COLUMNS=30 man -d man' then, please. (Private mail's
probably best.)

-- 
Colin Watson  [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



man files to text editor

2003-12-17 Thread Gruessle

Is there a way I can open man files in a text editor.
I like to print one but have not configured my printer jet.
So I will email it to my other pc.

-- 
Gruessle


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-17 Thread Lou Losee
* Gruessle [EMAIL PROTECTED] [2003-12-17 12:21]:
 
 Is there a way I can open man files in a text editor.
 I like to print one but have not configured my printer jet.
 So I will email it to my other pc.
 
Try man xxx | col -b  text-filename

it will give you a text version of the man page.

Lou


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-17 Thread David Z Maze
Gruessle [EMAIL PROTECTED] writes:

 Is there a way I can open man files in a text editor.

Emacs has a major mode for editing 'roff files, like man pages, if
that's what you're looking for.

 I like to print one but have not configured my printer jet.

'man -t' will produce postscript from a man page; see man(1).  This
might be easier to move around or manipulate or print on other
machines than the raw 'roff file.

-- 
David Maze [EMAIL PROTECTED]  http://people.debian.org/~dmaze/
Theoretical politics is interesting.  Politicking should be illegal.
-- Abra Mitchell


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-17 Thread Alf Werder
On Wed, 2003-12-17 at 18:22, Gruessle wrote:
 Is there a way I can open man files in a text editor.
 I like to print one but have not configured my printer jet.
 So I will email it to my other pc.

# man -T ps command

will produce the manual page for command in postcript format. Maybe
you prefer a plain text file (use 'latin1' or 'utf8' in place of 'ps')
or the tex device independent format (use 'dvi').

See man(1) and groff(1) for more information (look for -T in both manual
pages).

-alf


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-17 Thread Jan Minar
On Wed, Dec 17, 2003 at 01:07:35PM -0500, Lou Losee wrote:
 * Gruessle [EMAIL PROTECTED] [2003-12-17 12:21]:
  
  Is there a way I can open man files in a text editor.
  I like to print one but have not configured my printer jet.
  So I will email it to my other pc.
  
 Try man xxx | col -b  text-filename

This actually should not work, you have to tell man(1) it should send the
formatted manpage to stdout, instead of messing with the pager.
Replace `foo' with the desired program name.

$ man --pager cat foo | col -b  text-filename

Getting rid of the Latin-1 characters comes handy when mailing the
output, too.

$ man --pager cat --ascii foo | col -b  text-filename

Now we want the lines narrower than the default 80 characters (I guess
this won't work if man(1) is connected to the terminal, so the pipe is
vital here (that's why we use cat(1) as a pager--to force piping).

$ env COLUMNS=70 man --pager cat --ascii foo | col -b  text-filename

Finally, if you really want to mail it, without any further alterations,
try this (I just love to make shell one-liners ;-)):

$ env COLUMNS=70 man --pager cat --ascii foo | col -b | mail -s Subject
of your choice [EMAIL PROTECTED]

Cheers,
Jan.


pgp0.pgp
Description: PGP signature


Re: man files to text editor

2003-12-17 Thread Lou Losee
* Jan Minar [EMAIL PROTECTED] [2003-12-17 16:23]:
 On Wed, Dec 17, 2003 at 01:07:35PM -0500, Lou Losee wrote:
  * Gruessle [EMAIL PROTECTED] [2003-12-17 12:21]:
   
   Is there a way I can open man files in a text editor.
   I like to print one but have not configured my printer jet.
   So I will email it to my other pc.
   
  Try man xxx | col -b  text-filename
 
 This actually should not work, you have to tell man(1) it should send the
 formatted manpage to stdout, instead of messing with the pager.
 Replace `foo' with the desired program name.
 
 $ man --pager cat foo | col -b  text-filename
 

Well perhaps it should not work, but it does.  I have used the construct
for years now.  In chasing down the man pager, it appears to default to
'less'.

Try it you may like it - simple and quick.

Lou


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-17 Thread Jan Minar
On Wed, Dec 17, 2003 at 04:55:29PM -0500, Lou Losee wrote:
   Try man xxx | col -b  text-filename
  
  This actually should not work, you have to tell man(1) it should send the
  formatted manpage to stdout, instead of messing with the pager.
  Replace `foo' with the desired program name.
  
  $ man --pager cat foo | col -b  text-filename

 Well perhaps it should not work, but it does.  I have used the construct
 for years now.  In chasing down the man pager, it appears to default to
 'less'.

Actually, it depends on certain environment variables, few configfiles,
etc.  In the default Debian setup, it won't work.

 Try it you may like it - simple and quick.

I meant ``it shouldn't work for you''--of course I tried it first ;-)


pgp0.pgp
Description: PGP signature


Re: man files to text editor

2003-12-17 Thread Hugo Vanwoerkom
Lou Losee wrote:
* Gruessle [EMAIL PROTECTED] [2003-12-17 12:21]:

Is there a way I can open man files in a text editor.
I like to print one but have not configured my printer jet.
So I will email it to my other pc.
Try man xxx | col -b  text-filename

it will give you a text version of the man page.

Lou


T'is fantastic: works like a charm: never knew that!

Hugo.

--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-17 Thread cls
[This message has also been posted to linux.debian.user.]
In article [EMAIL PROTECTED], Lou Losee wrote:
 * Gruessle [EMAIL PROTECTED] [2003-12-17 12:21]:
 
 Is there a way I can open man files in a text editor.
 I like to print one but have not configured my printer jet.
 So I will email it to my other pc.
 
 Try man xxx | col -b  text-filename
 
 it will give you a text version of the man page.

That will work for small manpages.  But you will not like
what it does for big ones.  Here is a better way.

1.  Find the manpage source.

$ whereis bash
bash: /bin/bash /etc/bash.bashrc /usr/share/man/man1/bash.1.gz

2.  Typeset it in Postscript.

# apt-get install groff gs gv
$ zcat /usr/share/man/man1/bash.1.gz | groff -Tps -mandoc -  bash.1.ps

3.  Preview the Postscript.  Nice, eh?

$ gv bash.1.ps

4.  Make a PDF so you can print on MS-Windows, or just
send it to the printer.  (I have a Laserjet 4.  Maybe gs
has a driver for your printer.  Try echo devicenames == | gs)

$ gs -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -sOutputFile=bash-1.pdf bash.1.ps
$ gs -sDEVICE=ljet4 -dBATCH -dNOPAUSE -sOutputFile=/dev/lp0 bash.1.ps
$ rm bash.1.ps

Notice the MS-DOS friendly PDF file name.



Cameron


 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-17 Thread Ken Irving
On Wed, Dec 17, 2003 at 11:26:27PM +0100, Jan Minar wrote:
 On Wed, Dec 17, 2003 at 04:55:29PM -0500, Lou Losee wrote:
Try man xxx | col -b  text-filename
   
   This actually should not work, you have to tell man(1) it should send the
   formatted manpage to stdout, instead of messing with the pager.
   Replace `foo' with the desired program name.
   
   $ man --pager cat foo | col -b  text-filename
 
  Well perhaps it should not work, but it does.  I have used the construct
  for years now.  In chasing down the man pager, it appears to default to
  'less'.
 
 Actually, it depends on certain environment variables, few configfiles,
 etc.  In the default Debian setup, it won't work.

I think less is smart enough to know that it's being piped and so runs
as a filter, but it's probably not the default pager (since it's not 
installed by default on a base install).

Ken

 
  Try it you may like it - simple and quick.
 
 I meant ``it shouldn't work for you''--of course I tried it first ;-)



-- 
Ken Irving, Research Analyst, [EMAIL PROTECTED], 907-474-6152
Water and Environmental Research Center
Institute of Northern Engineering
University of Alaska, Fairbanks


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-17 Thread Colin Watson
On Wed, Dec 17, 2003 at 10:14:54PM +0100, Jan Minar wrote:
 On Wed, Dec 17, 2003 at 01:07:35PM -0500, Lou Losee wrote:
  * Gruessle [EMAIL PROTECTED] [2003-12-17 12:21]:
   Is there a way I can open man files in a text editor.
   I like to print one but have not configured my printer jet.
   So I will email it to my other pc.
  
  Try man xxx | col -b  text-filename
 
 This actually should not work, you have to tell man(1) it should send the
 formatted manpage to stdout, instead of messing with the pager.

This is incorrect; it is intended to work as Lou described, and it does
work. man(1) checks whether its standard output is a terminal before
starting a pager. If it isn't, which is the case when you do 'man ... |
...', it simply sends the formatted output to stdout.

 Getting rid of the Latin-1 characters comes handy when mailing the
 output, too.
 
 $ man --pager cat --ascii foo | col -b  text-filename

--ascii is kind of a hack, and I'd like to get rid of it eventually or
implement it in terms of other things. I tend to say 'LANG=C man
-Tascii' for this.

 Now we want the lines narrower than the default 80 characters (I guess
 this won't work if man(1) is connected to the terminal, so the pipe is
 vital here (that's why we use cat(1) as a pager--to force piping).
 
 $ env COLUMNS=70 man --pager cat --ascii foo | col -b  text-filename

The '--pager cat' continues to be unnecessary here; $COLUMNS is still
honoured. I prefer using the special-purpose $MANWIDTH for this, though.

Narrowing the page does work even if man's output is a terminal.

Cheers,

-- 
Colin Watson (man-db maintainer)  [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-17 Thread Colin Watson
On Wed, Dec 17, 2003 at 11:14:09AM -0800, [EMAIL PROTECTED] wrote:
 That will work for small manpages.  But you will not like
 what it does for big ones.  Here is a better way.
 
 1.  Find the manpage source.
 
 $ whereis bash
 bash: /bin/bash /etc/bash.bashrc /usr/share/man/man1/bash.1.gz
 
 2.  Typeset it in Postscript.
 
 # apt-get install groff gs gv
 $ zcat /usr/share/man/man1/bash.1.gz | groff -Tps -mandoc -  bash.1.ps

FWIW, in testing and unstable you shouldn't need the groff package for
this (just groff-base). It was kind of a mistake that the PostScript
device ended up in the non-base package, but I didn't manage to get the
fix into woody.

Cheers,

-- 
Colin Watson  [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-17 Thread Colin Watson
On Thu, Dec 18, 2003 at 12:41:41AM +, Colin Watson wrote:
 On Wed, Dec 17, 2003 at 10:14:54PM +0100, Jan Minar wrote:
  Now we want the lines narrower than the default 80 characters (I guess
  this won't work if man(1) is connected to the terminal, so the pipe is
  vital here (that's why we use cat(1) as a pager--to force piping).
  
  $ env COLUMNS=70 man --pager cat --ascii foo | col -b  text-filename
 
 The '--pager cat' continues to be unnecessary here; $COLUMNS is still
 honoured. I prefer using the special-purpose $MANWIDTH for this, though.
 
 Narrowing the page does work even if man's output is a terminal.

Looking at the code, a clarification: narrowing the page works if you
use $MANWIDTH to do it, but not if you use $COLUMNS. It might be
possible to argue that this is a bug, although I'm not sure; I borrowed
that particular section of code from the implementation of man(1) in Red
Hat.

-- 
Colin Watson  [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: man files to text editor

2003-12-17 Thread Jan Minar
On Thu, Dec 18, 2003 at 12:41:41AM +, Colin Watson wrote:
 On Wed, Dec 17, 2003 at 10:14:54PM +0100, Jan Minar wrote:
   Try man xxx | col -b  text-filename
  
  This actually should not work, you have to tell man(1) it should send the
  formatted manpage to stdout, instead of messing with the pager.
 
 This is incorrect; it is intended to work as Lou described, and it does
 work. man(1) checks whether its standard output is a terminal before

Shame on me... I *did* try it, but, by mistake, not on the quick
machine, but on the slow one--so after I waited for too long, I decided
it doesn't work (still I think it didn't work this way always).

 Narrowing the page does work even if man's output is a terminal.

You're talking unstable, ain't you ;-)  At least in man-db
2.3.20-18.woody.4, it doesn't.

Thank you for your insightfulness.


pgp0.pgp
Description: PGP signature


Re: man files to text editor

2003-12-17 Thread Jan Minar
On Thu, Dec 18, 2003 at 12:50:54AM +, Colin Watson wrote:
 On Thu, Dec 18, 2003 at 12:41:41AM +, Colin Watson wrote:
  On Wed, Dec 17, 2003 at 10:14:54PM +0100, Jan Minar wrote:
   Now we want the lines narrower than the default 80 characters (I guess
   this won't work if man(1) is connected to the terminal, so the pipe is
   vital here (that's why we use cat(1) as a pager--to force piping).
   
   $ env COLUMNS=70 man --pager cat --ascii foo | col -b  text-filename
  
  The '--pager cat' continues to be unnecessary here; $COLUMNS is still
  honoured. I prefer using the special-purpose $MANWIDTH for this, though.
  
  Narrowing the page does work even if man's output is a terminal.
 
 Looking at the code, a clarification: narrowing the page works if you
 use $MANWIDTH to do it, but not if you use $COLUMNS. It might be

Neither works; man-db 2.3.20-18.woody.4.


pgp0.pgp
Description: PGP signature


Re: man files to text editor

2003-12-17 Thread Osamu Aoki
On Wed, Dec 17, 2003 at 10:14:54PM +0100, Jan Minar wrote:
 On Wed, Dec 17, 2003 at 01:07:35PM -0500, Lou Losee wrote:
  * Gruessle [EMAIL PROTECTED] [2003-12-17 12:21]:
   
   Is there a way I can open man files in a text editor.
   I like to print one but have not configured my printer jet.
   So I will email it to my other pc.
   
  Try man xxx | col -b  text-filename
 
 This actually should not work, you have to tell man(1) it should send the
 formatted manpage to stdout, instead of messing with the pager.
 Replace `foo' with the desired program name.
 
 $ man --pager cat foo | col -b  text-filename
 
 Getting rid of the Latin-1 characters comes handy when mailing the
 output, too.
 
 $ man --pager cat --ascii foo | col -b  text-filename
 
 Now we want the lines narrower than the default 80 characters (I guess
 this won't work if man(1) is connected to the terminal, so the pipe is
 vital here (that's why we use cat(1) as a pager--to force piping).
 
 $ env COLUMNS=70 man --pager cat --ascii foo | col -b  text-filename
 
 Finally, if you really want to mail it, without any further alterations,
 try this (I just love to make shell one-liners ;-)):
 
 $ env COLUMNS=70 man --pager cat --ascii foo | col -b | mail -s Subject
 of your choice [EMAIL PROTECTED]

None of them comes out as nice as my way :-)

$ man -Tps man |ps2pdf - -  man.pdf

Move it to samba share and access it from the windows.

Use acrobat reader and print it with faster windows printer driver.

Nicer fonts too.

Osamu


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]