Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'If you're a TeX fiend...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
If you're a TeX fiend...
Authored by: timkingman on Jun 23, '03 12:57:02PM
If you have groff (should be standard) and a TeX viewer, you should be able to use this bash function:
function mantex
{
  if [ ! -d /tmp/mantex ]
  then
    mkdir /tmp/mantex
  fi
  if [ -e /tmp/mantex/$1.dvi ]
  then
    open /tmp/mantex/$1.dvi
  else
    groff -m man -Tdvi `man -w $1` > /tmp/mantex/$1.dvi && open /tmp/mantex/$1.dvi
  fi
}

This function will save a copy of the generated TeX DVI file in /tmp/mantex, you may want to change that if you have very limited HD space. Also, there are some flaws with the version of groff that comes with OS X. Some of the generated output will be improperly-formatted. Recompiling the same version of groff may fix it, I'm not sure about newer versions.

If you don't use bash or like doing things the hard way, just run the line starting with groff, replacing $1 with the command you want to look up.

A TeX-crazy friend suggested this, and I used it for a few days before I grew tired of it. I've gone back to plain-old boring man pages.

[ Reply to This | # ]