Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

If man -t ls | ps2pdf - > ls.pdf is useful for outputting the ls man page via ps2pdf to pdf, what about info pages?

I've tried something like the following but with no success:

info -o info | ps2pdf - > info.pdf

All this does is output a blank pdf file called info.pdf and output the body into a text file.

share|improve this question
    
That's good enough for me. It appears that info2man is in the Debian repositories so if you want to formulate that as an answer with example, I'll mark as correct. I can work it out without an example, but it may help anyone who stumbles upon this question. –  Simon Hoare Jan 29 '13 at 10:56
    
It's also in Fedora 17 and Ubuntu according to pkgs.org –  Simon Hoare Jan 29 '13 at 10:57
1  
info -o - info | /usr/bin/groff -mandoc -Tpdf > info.pdf except it does not handle any formatting at all... not sure if there is a way to preserve that directly with the info command –  frostschutz Jan 29 '13 at 12:14
    
Thanks but it's the formatting I was after. I might stick with the text files for info then as, while they are not pdf, they are at least laid out correctly. –  Simon Hoare Jan 29 '13 at 12:18
    
According to gnu.org/software/texinfo/manual/info-stnd/… you should go looking for the tex sources of those info pages...? –  frostschutz Jan 29 '13 at 12:22

3 Answers 3

up vote 8 down vote accepted

Ah, info brings along the texi2ps and texi2pdf programs.

So if you find the info source (info.texi) you can generate beautiful (or bloated, depending on your point of view) PDF using:

texi2pdf info.texi
share|improve this answer
1  
Thanks. Don't get me wrong, I love the terminal. I just don't enjoy reading man/info pages there. –  Simon Hoare Jan 29 '13 at 13:29
    
Ok, since I didn't specifically request an example, I'm going to give you the points. –  Simon Hoare Jan 30 '13 at 8:18

Info is a specialized format with few formatting capabilities, it's basically man with hyperlinks. Most info files are generated from a Texinfo source with the makeinfo command. Texinfo is designed to accommodate a wide range of outputs, both hypertext and printed, with basic or pretty formatting. Supported output formats include info, HTML, DVI, PostScript and PDF.

The PDF may already be present in the same package as the info file or in a separate package (depending on how much your distributing).

If it isn't, install a Texinfo setup and get the source of the package. You can then process the Texinfo source with texi2pdf, and you'll get a manual in PDF format with nicer formatting.

share|improve this answer
    
Thanks but if it isn't a 1 or 2-step process the advantage is lost. I was just quite impressed that a single expression could turn a man page into an attractive formatted pdf document. –  Simon Hoare Jan 30 '13 at 8:03

I'd go with this freecode.com/projects/info2man as I don't know if you can output info directly. It's in the Debian and Ubuntu repositories, at least. Simply give your class file (.ci) extension as the argument to info2man.

share|improve this answer
    
AUR also has it. –  schaiba Jan 29 '13 at 10:59
    
Could you provide an example. I've tried info2man /path/to/info-page (as per the info2man manual page) but do I need other arguments? Where does this output to? –  Simon Hoare Jan 29 '13 at 11:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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