# Plain TeX and different hyperlink styles in dvi and pdf

I use the harvmac macros to write papers with plain TeX, and harvmac loads the hyperbasics file to enable hyperlinks.

However I can't figure out why the hyperlinks have a different appearance in the dvi and the PDF files and I can't find where the defaults are defined so that I can change them. Furthermore, I get different styles for the hyperlinks in the pdf depending on how I compile to get the PDF.

With the MWE below, the dvi file from tex MWE.tex has a blue hyperlink with no surrounding box (see image below), whereas the outcome of dvips -z MWE.dvi; ps2pdf14 MWE.ps has a black hyperlink inside a blue box. The outcome of xetex MWE.tex has invisible hyperlinks (black equation number, no surrounding box).

I'd like to understand where these style definitions come from, since I prefer the DVI style and I'd like the PDF to be the same (blue equation number, no surrounding box). The macros from hyperbasics.tex do not seem to define any default, so out of luck I like the DVI style, but not the PDF style.

So, how can I get the blue equation number with no box in the PDF file?

MWE:

\input harvmac

\newsec{Some title}

One equation:
\eqn\ps{ A = 0}
Reference: See equation \ps.

\bye


In the DVI file:

In the PDF file:

-
At least the dvi mystery is now solved. There is a -linkstyle option for xdvi (the program I use for dvi preview). But I couldn't find a similar option for evince to explain the PDF appearance. That would also not explain why the pdf generated with xetex and through dvips+ps2pdf14 have different styles since I use evince for both. –  Mafra Dec 2 '12 at 11:30

You get the same result with the hypertex driver of the LaTeX package hyperref. The hyperTeX specials define some very basic HTML markup, e.g.:

s:[1/1]:: html:<a name="page.1">
s:[1/1]:: html:</a>
s:[1/1]:: html:<a name="Doc-Start">
s:[1/1]:: html:</a>
s:[1/1]:: html:<a name="section*.1">
s:[1/1]:: html:</a>
s:[1/1]:: html:<a href="#section.1">
s:[1/1]:: html:</a>
s:[1/1]:: html:<a name="section.1">
s:[1/1]:: html:</a>
s:[1/1]:: html:<a href="#section.1">
s:[1/1]:: html:</a>
s:[1/1]:: html:<a href="http://www.example.org/">
s:[1/1]:: html:</a>


This is the output of dvii, the TeX source file:

\documentclass{article}
\usepackage[hypertex]{hyperref}
\begin{document}
\tableofcontents
\section{Hello World}
\label{sec:hello}
See section \ref{sec:hello}.
\url{http://www.example.org/}
\end{document}


The hyperTeX specials do not provide configuration options and do not know about PDF. Thus the link outcome is in control of the DVI program:

• xdvi underlines in blue.
• dvips -z uses blue boxes.

## Configuration of xdvi

There are three options to configure the link outcome, from the manual page of xdvi:

-linkcolor
(Blue2' by default). Hyperlinks are unvisited  be­
fore  you  click on them, or after the DVI file has
been reloaded.  The value should be either a  valid
X color name (such as DarkGoldenrod4) or a hexadec­
imal color string (such as #8b6508).Seealso -visit­

(.LinkStyle)  Determines  the style in which hyper­
links are  displayed.  Possible  values  and  their
meanings are:

2       No underlining, color text with link color
3       Underline and display text colored with

The  values for link color are specified by the op­
(which see).

(.visitedLinkColor) Color used for  visited  hyper­
visited once you click on them. As  for  linkColor,
the  value should be either a valid X color name or


## Configuration of dvips

The border and color are hardcoded, from hps.c:

p->color[0] = 0;
p->color[1] = 0; /* Blue links */
p->color[2] = 1;
p->border[0] = 1; /* horizontal corner radius */
p->border[1] = 1; /* vertical corner radius */
p->border[2] = 1; /* box line width */
p->border[3] = 3; /* dash on size */
p->border[4] = 3;  /* dash off size */


As result dvips -z writes the links of the example above as:

(#section.1) [[134 682 210 694] [1 1 1 [3 3]] [0 0 1]] pdfm
(#section.1) [[185 628 190 640] [1 1 1 [3 3]] [0 0 1]] pdfm
[[197 628 318 640] [1 1 1 [3 3]] [0 0 1]] (http://www.example.com/) pdfm


To get different colors, either the definition of pdfm needs to be changed in hps.pro or the redefinition can be done at later time by manipulating the arguments for pdfm and replacing the arrays for the border and the color.

Or in short, dvips -z cannot be configured without hacking internals.

-