From: Deri <deri@chuzzlewit.myzen.co.uk>
To: Alejandro Colomar <alx.manpages@gmail.com>,
"G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: groff <groff@gnu.org>, linux-man <linux-man@vger.kernel.org>
Subject: Re: groff 1.23.0.rc2 status report (was: [BUG] gropdf, tbl: Completely broken table)
Date: Mon, 19 Dec 2022 12:58:21 +0000 [thread overview]
Message-ID: <3244180.VqM8IeB0Os@pip> (raw)
In-Reply-To: <20221219053245.j5omcuyxd7rnj4qt@illithid>
On Monday, 19 December 2022 05:32:45 GMT G. Branden Robinson wrote:
> Number three:
>
> bug #62933: [man] produce hyperlinks in PDF output
> https://savannah.gnu.org/bugs/index.php?62933
>
> We've got man page cross-reference hyperlinks but, weirdly, not regular
> URL support in groff_man(7). To my dismay this doesn't appear to be
> trivial. Whoever came up with the "pdfhref" macro had Unix
> command-line-itis, and constructed an interface that looked like that
> instead of something you might use in a *roff document.
Hi Branden,
To be fair, he had little choice since the api was designed by adobe:-
https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/pdfs/
acrobatsdk_pdfmark.pdf
> The problem is
> that it expects the URL and, particularly, the link text to be macro
> arguments. This is a violent impedance mismatch with the way groff
> man(7)'s email and web macros were set up to work; they format the link
> text in a diversion. Diversions and strings are not the same thing.
> (Try putting diversion contents into a device control command and you
> will rapidly be deafened by the screams of a thousand damned "can't
> output node in transparent throughput" souls.)
The .URL, .MTO and .FTO macros in www.tmac should be easy to convert to using
.pdfhref, the difficult one is the .UR/.UE pair from an.tmac you are talking
about.
In order to solve this to get all man pages as fully linked pdfs - I cheated!
I used a sort of pre-gropdf which changed the mail and email links to pdfhref
calls. So I don't think I can help much with this. However, this is the code I
use to "clean" a string, may be helpful:-
. ds pdf:cleaned \\$*
. ev pdfcln
. tr \[em]-
. nf
. box pdf:clean
. nop \\$*
. fl
. box
. chop pdf:clean
. asciify pdf:clean
. length pdf:clean:len \\*[pdf:clean]
. ds pdf:cleaned \\*[pdf:clean]
. rm pdf:clean
. ev
. tr \[em]\[em]
There may be much better ways of doing it!
> So to solve this I have
> to learn crazy stuff about PDFmark hotspots and how their boundaries are
> computed, and then the thought of what happens when the link text
> crosses a trap boundary (like a page break) causes the blood to drain
> from my face.
Don't worry, the gropdf man page says:-
If you are using page traps to produce headings, footings, etc., you need to
use these in case a ‘hotspot’ crosses a page boundary, otherwise any text
output by the heading or footing macro will be marked as part of the ‘hot
spot’. To stop this happening just place ‘.pdfmarksuspend’ and
‘.pdfmarkrestart’ at the start and end of the page trap macro, respectively.
(These are just convenience macros which emit the \X code. These macros must
only be used within page traps.)
If you look at om.tmac you will see these used in the FOOTER macro. I'm not
sure how -mpdfmark handles it since these are gropdf extensions.
Cheers
Deri
> At some point I may have to tell Regis I need to phone a
> friend,[3] and I'll crawl to Deri the PDF wizard to knock some clues
> into my head.
>
> Then, though the bug doesn't say this, I have to do it all over again
> for mdoc(7), because that doesn't have support for this, either. On the
> bright side, I have a much better grasp of mdoc(7)'s internals than I
> used to, and pretty much everything to do with page location traps is
> the same now anyway, thanks to my incessant meddling^W^W^Wthe problems I
> had to solve to get batch-rendering working.
>
next prev parent reply other threads:[~2022-12-19 12:58 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220906191320.447t5awx3rcb5d5b@illithid>
[not found] ` <a7b8c6b3-a8e8-6ab7-6cf4-118446849a9c@gmail.com>
[not found] ` <dca0e251-7481-7f1e-4077-0ddee070a357@gmail.com>
[not found] ` <20220906204245.hzhq2s7yha6zzgrh@illithid>
[not found] ` <30e80fe0-f0ce-d6cd-ee40-28692e5a5f82@gmail.com>
[not found] ` <5c1e8620-e4ff-c79a-1d4e-11f797276726@gmail.com>
[not found] ` <20221116234049.GA1229865@if>
[not found] ` <f306a83a-306d-e3d0-5d25-bf07da3da59f@gmail.com>
2022-11-17 0:28 ` Chapters of the manual (was: Bug#1018737: /usr/bin/rst2man: rst2man: .TH 5th field shouldn't be empty) Alejandro Colomar
2022-12-11 16:40 ` Ping^1: " Alejandro Colomar
2022-12-11 19:05 ` Michael Haardt
2022-12-11 19:21 ` Alejandro Colomar
2022-12-11 21:10 ` Michael Haardt
2022-12-12 0:34 ` Douglas McIlroy
2022-12-12 11:39 ` Alejandro Colomar
2022-12-12 8:58 ` Ralph Corderoy
2022-12-12 13:19 ` G. Branden Robinson
2022-12-12 13:57 ` Andries E. Brouwer
2022-12-12 13:39 ` Colin Watson
2022-12-12 13:48 ` Alejandro Colomar
[not found] ` <1719285.QkHrqEjB74@pip>
[not found] ` <01989003-349f-fb6b-f460-89106b82bc34@gmail.com>
[not found] ` <2176657.1BCLMh4Saa@pip>
2022-12-17 11:51 ` Ping^1: " Alejandro Colomar
2022-12-17 13:19 ` [BUG] gropdf, tbl: Completely broken table (was: Ping^1: Chapters of the manual (was: Bug#1018737: ...)) Alejandro Colomar
2022-12-17 16:08 ` G. Branden Robinson
2022-12-17 21:26 ` Deri
2022-12-18 11:25 ` Alejandro Colomar
2022-12-18 5:49 ` [BUG] gropdf, tbl: Completely broken table Ralph Corderoy
2022-12-18 11:01 ` Alejandro Colomar
2022-12-18 11:46 ` [BUG] gropdf, tbl: Completely broken table (was: Ping^1: Chapters of the manual (was: Bug#1018737: ...)) Alejandro Colomar
2022-12-19 5:32 ` groff 1.23.0.rc2 status report (was: [BUG] gropdf, tbl: Completely broken table) G. Branden Robinson
2022-12-19 12:58 ` Deri [this message]
2022-12-19 16:39 ` Alejandro Colomar
2022-12-19 16:59 ` patching suffixes(7) (was: groff 1.23.0.rc2 status report) G. Branden Robinson
2022-12-19 19:10 ` Alejandro Colomar
2022-12-19 19:54 ` prehistory branch (was: patching suffixes(7) (was: groff 1.23.0.rc2 status report)) Alejandro Colomar
2022-12-19 20:05 ` Alejandro Colomar
2022-12-20 3:40 ` patching suffixes(7) (was: groff 1.23.0.rc2 status report) G. Branden Robinson
2022-12-20 10:12 ` Alejandro Colomar
2022-12-19 16:51 ` groff 1.23.0.rc2 status report (was: [BUG] gropdf, tbl: Completely broken table) G. Branden Robinson
2022-12-17 21:37 ` Ping^1: Chapters of the manual (was: Bug#1018737: /usr/bin/rst2man: rst2man: .TH 5th field shouldn't be empty) Deri
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3244180.VqM8IeB0Os@pip \
--to=deri@chuzzlewit.myzen.co.uk \
--cc=alx.manpages@gmail.com \
--cc=g.branden.robinson@gmail.com \
--cc=groff@gnu.org \
--cc=linux-man@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox