Saturday, December 1, 2012

Plain TeX and hyperlinks with harvmac

I use plain TeX with a slightly modified version of harvmac for writing papers. 

Harvmac enables hyperlinks by loading hyperbasics.tex, so the dvi file generated with tex file.tex contains nice hyperlinks. I always wanted to have hyperlinks in the PDF too, but the result of dvipdf file.dvi unfortunately has no hyperlinks. Today I found out the procedure after some googling;

  tex file.tex
 dvi2ps -z file.dvi
 ps2pdf14 file.ps

After these steps the PDF file contains hyperlinks. However they are slightly annoying because of  ugly blue boxes around them. But anyway, the links are nevertheless useful to check that the equations are being referred correctly etc.

Incidentally, compiling the TeX file with xetex generates a PDF file with invisible hyperlinks. One becomes aware that the hyperlink is there only when passing the mouse over some reference. Since I know beforehand what's supposed to be hyperlinks, that's not a problem. In fact, that's a virtue because the blue boxes around links spoil the efforts to make the paper look typographically nice.

No comments: