BlackWindBooks.com | Newsletter! | risingthumb.xyz | achtung.risingthumb.xyz | github.com/RisingThumb | site map

risingthumb.xyz Look ma! No hands!

Pman : Manual pages, formatting, roff and PDFs

Not to be confused with pacman. Its a short script I wrote in order to view man pages in my pdf client. Wait, what's a man page I hear you ask?

man ls

This command, "man" will read a roff file and format it appropiately so you can read it. A roff file, is just a plaintext file formatted in a nice way. How nice? Every change in formatting in your text is a line, but this isn't an article about roff. The thing about roff to know, is it was used in the old UNIX days and that man pages are written in them.

The script "pman" in question is this:

#!/bin/sh
man -Tpdf "$@" | zathura - ;

The flag "-T" informs Troff what to convert the troff document into. "pdf" tells us to conver the Troff document to a pdf(I presume by converting to PS, then to PDF, but I may be incorrect). We must then pipe it into a pdf reader, in this case I use zathura as that's my preferred PDF reader.

Other options can be used for -T, including html, ps and dvi(not that you'd want to use the latter 2). HTML and PDF options are useful to me, as it means man pages can be printed or uploaded to the internet as a reference. In fact, I wouldn't be surprised if using this, is how most manual pages are done on the web!

Some points to clear up before I move on, and some alternative tools to mention. Firstly, Groff? Troff? Roff? Roff is the original, followed by Troff, followed By Groff(GNU Roff). The differences are minor between them, since they are just continuations and developments upon what was laid down previously. In fact, it's arguable that Roff laid the foundation for programs such as Donald Knuth's TeX program that is used widely in academia.

The alternative tool is "info" another GNU program. I am not a fan of it, as it's effectively a full on TUI for reading and searching manuals, as opposed to a simpler CLI that "man" is. Within emacs, I am aware of a program known as "W.O. Man" which stands for "Without Man", which is another program for reading manual pages.

Do you want to learn more about the "man" command in zathura? Run this:

man -Tpdf man | zathura -;

Published on 2022/10/19

Articles from blogs I follow around the net

BAT-EYES #54

UNSAFE CREATIVE DREAMS "Everybody, I’m not really blind," was what TAB2 had been about to say, before he realized there was no point in belaboring the obvious. What was more, nobody would have cared. It turned out he’d held his tongue slightly pas…

via I'm not really Stanley Lieber. February 20, 2025

reblog: Juegos multidimensionales: Postura mía (soy GeneXer) sobre por qué a pesar de...

Juegos multidimensionales: Postura mía (soy GeneXer) sobre por qué a pesar de...: Suscribo y cito entrecomillado de parte de un comentario hecho por un usuario de meneame a un artículo del periódico el País titulado “Ec...:::Feed:::

via Filozofia February 17, 2025

A holistic perspective on intellectual property, part 1

I’d like to write about intellectual property in depth, in this first of a series of blog posts on the subject. I’m not a philosopher, but philosophy is the basis of reasonable politics so buckle up for a healthy Friday afternoon serving of it. To understand …

via Drew DeVault's blog February 13, 2025

Generated by openring