Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hyperref: underline links/urls w/ pdfborderstyle?

2,591 views
Skip to first unread message

Minsu

unread,
Jan 14, 2011, 6:00:27 PM1/14/11
to
Hi all,

I'd like to have underlined urls (with pdflatex, and visible on print-
out and/or monitor), and according the manual (or this:
http://en.wikibooks.org/wiki/Talk:LaTeX/Hyperlinks)
this should be done with
pdfborderstyle={/S/U/W 1}
or
pdfborderstyle={/S/U}
but -- no matter if package- or hypersetup-option -- as this doesn't
show any effect.

And, any pdfborderstyle-config (even pdfborderstyle={} for no border)
shows any change at all, same if I set colorlinks to true or false...

(NB: I've actually got no printer available, and I view my pdfs with
evince or acroread9)

Any ideas?
Minsu

GL

unread,
Jan 14, 2011, 7:00:08 PM1/14/11
to

This works for me:


\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{hyperref}

\hypersetup{colorlinks=false,pdfborderstyle={/S/U/W 1},pdfborder=0 0 1}

\begin{document}\makeatletter

\section{To See}\label{tosee}

\vskip2cm

\hyperref[tosee]{just to see}

\end{document}\endinput

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%\Hy@Match{%
% ^%
% ( */Type */Border%
% | */W +\HyPat@NonNegativeReal/%
% | */S */[SDBIU]%
% | */D *\[ *(\HyPat@NonNegativeReal/( \HyPat@NonNegativeReal/)?)?]%
% )* *$}

=> AFAIK, this is the only description of pdfborderstyle key
for hypersetup found in hyperref.pdf
;-)

Heiko Oberdiek

unread,
Jan 14, 2011, 6:32:13 PM1/14/11
to
GL <goua...@gmail.com> wrote:

> %\Hy@Match{%
> % ^%
> % ( */Type */Border%
> % | */W +\HyPat@NonNegativeReal/%
> % | */S */[SDBIU]%
> % | */D *\[ *(\HyPat@NonNegativeReal/( \HyPat@NonNegativeReal/)?)?]%
> % )* *$}
>
> => AFAIK, this is the only description of pdfborderstyle key
> for hypersetup found in hyperref.pdf
> ;-)

http://www.adobe.com/devnet/pdf/pdf_reference.html

And the README contains:

| Link border style
| -----------------
| Links can be underlined instead of the default rectangle or
| options "colorlinks", "frenchlinks". This is done by option
| pdfborderstyle={/S/U/W 1}
|
| Some remarks:
|
| * AR7/Linux seems to have a bug, that don't use the default
| value "1" for the width, but zero, thus that the underline
| is not visible without "/W 1". The same applies for
| dashed boxes, eg.:
| pdfborderstyle={/S/D/D[3 2]/W 1}
|
| * The syntax is described in the PDF specification, look for
| "border style", eg.
| Table 8.13 "Entries in a border style dictionary"
| (specification for version 1.6)
|
| * The border style is removed by
| pdfborderstyle={}
| This is automatically done if option colorlinks is enabled.
|
| * Be aware that not all PDF viewers support this feature, not
| even Acrobat Reader itself:
|
| Some support:
| * AR7/Linux: "underline" and "dashed", but the border width
| must be given.
| * xpdf 3.00: "underline" and "dashed"
|
| Unsupported:
| * AR5/Linux
| * ghostscript 8.50

--
Heiko Oberdiek

Minsu

unread,
Jan 14, 2011, 8:22:10 PM1/14/11
to
Running -- thanks guys! :D

I was missing that pdfborder-stuff.

Ok... will that lines also be printed? I read before, boxed links (==>
colorlinks=false) wouldn't...
Also, though I changed urlcolor=black, all my \url{...} and \href{...}
remain cyan.

GL

unread,
Jan 15, 2011, 3:36:41 AM1/15/11
to

urlcolor refers to the colorlinks option

use \hypersetup{urlbordercolor=...} (requires package xcolor)

\hypersetup{ ?bordercolor=... }

where ? = cite|file|url|link|menu|run

Denis Bitouzé

unread,
Jan 15, 2011, 4:14:13 AM1/15/11
to
Le samedi 15/01/11 à 00h32,
Heiko Oberdiek <heiko.o...@googlemail.com> a écrit :

> | Some support:
> [...]


> | * xpdf 3.00: "underline" and "dashed"

Well... with xpdf 3.02 and the following .tex file:

\documentclass{article}
\usepackage{hyperref}
\hypersetup{pdfborderstyle={/S/U/W 1}}
\begin{document}
\tableofcontents
\section{Foo}
\end{document}

the support seems to be rather /over/ than /under/line. Sigh...
--
Denis

Minsu

unread,
Jan 15, 2011, 4:51:08 AM1/15/11
to
@ GL: ah, great, thanks again.

@ Denis: your mwe is also missing the pdfborder-option....

Minsu

Denis Bitouzé

unread,
Jan 15, 2011, 5:07:20 AM1/15/11
to
Le samedi 15/01/11 à 01h51,
Minsu <Mins...@gmx.net> a écrit :

> @ Denis: your mwe is also missing the pdfborder-option....

It seems to be unnecessary with most of pdf-viewers on Linux (evince,
okular, epdfview, acroread) and, unfortunately, it doesn't change
anything for xpdf.
--
Denis

Heiko Oberdiek

unread,
Jan 15, 2011, 4:34:04 AM1/15/11
to
Denis Bitouzé <dbito...@spam.wanadoo.fr> wrote:

Then it must be a new bug in xpdf 3.02. xpdf 3.00 works fine.

--
Heiko Oberdiek

Denis Bitouzé

unread,
Jan 15, 2011, 11:44:32 AM1/15/11
to
Le samedi 15/01/11 à 10h34,

Heiko Oberdiek <heiko.o...@googlemail.com> a écrit :

> Then it must be a new bug in xpdf 3.02. xpdf 3.00 works fine.

OK, thanks. I will make a bug report.
--
Denis

0 new messages