groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Groff macro to make .UR and .UE links clickable in PDF?


From: B 9
Subject: Re: Groff macro to make .UR and .UE links clickable in PDF?
Date: Fri, 19 Jun 2020 06:08:44 -0700
User-agent: s-nail v14.9.11

John Gardner <gardnerjohng@gmail.com> wrote:

> Steve's list left out one other URL-handling strategy: omit them altogether
> if they aren't needed

Yes, that is often the best solution when hyperlinks aren't available.
How does one do that in groff?

I've tried three things so far: UR/UE, Lk, and pdfhref. The first two
always put the URL in the text. Pdfhref has the opposite problem, it
omits *everything*, including the link text on output devices that
don't support hyperlinks. For example, the following outputs nothing
in nroff, when I'd like it to say "adventure(6),":

Input: 
    .pdfhref W -D "man:/6/adventure" -A , -- adventure(6)


> *@B 9:* If you're interested in PDF and hyperlinking, you might find this
> <https://rawgit.com/Alhadis/Roff.js/web-demo/index.html> useful
> <https://github.com/Alhadis/Roff.js>. :-)

Thank you! Although the formatting seems slightly off, it is
interesting and useful. For one thing, it lets me see that the groff
on my system (1.22.4) is definitely not generating hyperlinks for Lk.

Jan Stary (or anyone): would you please post the output of 'groff -Z
-mdoc -Tpdf' for the example input which converted Lk to hyperlinks?
I'd like to paste it into Alhadis's Roff.js and see where my groff is
going wrong. I'm including my output below.

--b9

----------------------------------------------------------------------
INPUT:

.Dd June 16, 2020
.Dt LINKS 1
.Os
.Sh NAME
.Nm links
.Nd typeset links in mdoc documents
.Sh DESCRIPTION
The home page is
.Lk http://www.frijid.net/madness/madness.html
so go visit it now.

----------------------------------------------------------------------
B9's OUTPUT FROM groff -Z -mdoc -Tpdf

x T pdf
x res 72000 1 1
x init
p1
x font 5 TR
f5
s10000
V48000
H72000
md
DFd
tLINKS
h1666
t(1)
h123879
tBSD
wh2500
tGeneral
wh2500
tCommands
wh2500
tManual
h123879
tLINKS
h1666
t(1)
n12000 0
x font 36 TB
f36
V96000
H72000
tN
H79020
tAME
n12000 0
x font 8 CB
f8
V108000
H102000
tlinks
wf5
h2500
Cem
wh12500
ttypeset
wh2500
tlinks
wh2500
tin
wh2500
tmdoc
wh2500
tdocuments
n12000 0
f36
V132000
H72000
tDESCRIPTION
n12000 0
f5
V144000
H102000
tThe
wh2500
thome
wh2500
tpage
wh2500
tis
wf36
h2500
thttp://www
H222950
t.frijid.net/madness/madness.html
wf5
h2500
tso
wh2500
tgo
wh2500
tvisit
wh2500
tit
wh2500
tno
H428830
tw
H435400
t.
n12000 0
V750000
H72000
tBSD
h186635
tJune
h2500
t16,
wh2500
t2020
h201085
t1
n12000 0
x trailer
V792000
x stop

----------------------------------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]