Skip to content

Instantly share code, notes, and snippets.

@phargogh
Created February 5, 2020 03:16
Show Gist options
  • Save phargogh/bba06909f3641cd2538527e9e8d60065 to your computer and use it in GitHub Desktop.
Save phargogh/bba06909f3641cd2538527e9e8d60065 to your computer and use it in GitHub Desktop.
Convert a manpage to PDF
#!/bin/bash
#
# Convert a program's manpage to PDF.
# Assumes that the program has a manpage for it and that ps2pdf14 is installed (part of a latex package).
#
# Example usage:
# $ ./man2pdf bash
${1?"Usage: $0 PROGRAMNAME"}
man -t $1 | ps2pdf14 - $1_manpage.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment