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: Tue, 16 Jun 2020 02:36:40 -0700
User-agent: s-nail v14.9.11

Ingo Schwarze <schwarze@usta.de> wrote:

> >> You say mdoc; shouldn't the links be Lk?
> 
> In mdoc(7): yes, absolutely.
> Use .Lk in mdoc(7), .UR is not supported by mdoc(7) at all.

Thank you, Ingo, for letting me know that. I'll use Lk if I can figure
out how to get it to format my text so it looks as nice as UR/UE, but
I'm not sure it can. The BSD documentation for mdoc states that groff
misformats Lk, so perhaps that is the problem.

There are three issues. First, Lk always adds a new line so I can't
have a reference in the middle of a sentence. Second, it always adds a
colon after the link text, so it changes my grammatical meaning.
Third, and worst of all, it then prints out the entire URL without
wrapping, exceeding the right margin for long URLs.

So, if I set a 32 column width as a demonstration and use Lk like so:

        The main home page for the x86 port of Madness is
        .Lk http://www.frijid.net/madness/madness.html \
        http://www.frijid.net/\:madness/\:madness.html

It comes out as:
        |<---------------------------32->|
        The main home page for the
        x86 port of Madness is
        http://www.frijid.net/madness/
        madness.html:
        http://www.frijid.net/madness/madness.html
        |<---------------------------32->|

Note that these problems with Lk occur in both the nroff and PDF
output from groff.


> Besides, mdoc(7) has nothing to do with Linux.  For that reason,
> we recently convinced the Linux man pages project to delete that
> bad page, and they did. 

I had thought it funny that the mdoc man page was part of the kernel
documentation! I hope groff is adding a replacment mdoc(7) page. I
felt like those two pages were quite complementary. mdoc(7) was a well
organized, easy to understand quick reference guide that gave the most
important information first. For a troff-novice like me, it was a good
way to get a handle on how to use mdoc without having to learn
everything. I might have given up before even starting without it. On
the other hand, groff_mdoc(7) is the "complete reference manual" which
was helpful when I wanted to lookup something specific.


> > Do you have any insight on making a macro, whether via Lk or UR/UE,
> > that will create PDF links?
> 
> One person already recommended a way to make normal .Lk in mdoc(7)
> and normal .UR in man(7) produce PDF links with groff,

Who? When? I tried searching the mail archives but came up with nothing.


> but i suggest a different perspective. Decide what it is that you
> really want: if you want excellent typography from an mdoc(7)
> document, use groff(1) PDF output.

Just nroff and PDF with very basic links. No need for HTML at the moment.

--b9




reply via email to

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