Re: Quick question: how to do .index in groff?

2020-07-30 Thread B 9
"Denis M. Wilson" wrote: > Sorry, the macros I've written are .strchr and .strrchr. > > .index should not be too hard using direct method (KMP is too > complicated). I may have time to try, no promises... Thank you. I had a mistaken presumption that it was something people would've already solv

Re: Quick question: how to do .index in groff?

2020-07-25 Thread B 9
"Denis M. Wilson" wrote: > To implement .index as a macro one could consider using .substring > together with the Knuth-Morris-Pratt algorithm. I've done simpler > things eg the equivalent of The C library substr(). Thank you. Would you be willing to share your strstr() macro? I'm surprised nob

Re: Format-agnostic hyperlinks

2020-07-23 Thread B 9
John Gardner wrote: > > Does your package interpret the URL that's passed in? > > Nope, not at all. URLs are passed through verbatim; authors can always add > \: themselves, although toggling word-breakage is probably better achieved > using a "no-wrap" macro. I think that's the solution www.t

Quick question: how to do .index in groff?

2020-07-23 Thread B 9
Heirloom Troff has a handy string search function called .index which works like this: .index R xx string The position where string occurs in xx is stored in register R. It doesn't seem to work yet in Groff, but I'm hoping somebody has a macro that implements .index. Thanks, --b9

Re: Format-agnostic hyperlinks

2020-07-23 Thread B 9
John Gardner wrote: > Recent discussion on this list about PDF and HTML links galvanised an > earlier attempt of mine to implement hyperlinks in Troff in a device- and > package-agnostic manner: It's still very much a W.I.P., but > > .[ "here's what I've done so far" ]( > https://github.com/Alha

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

2020-07-10 Thread B 9
By the way, at least one authority backs up my intuition that the protocol should be usually omitted: The Modern Language Association. According to the MLA Handbook, URLs should always remove the "http://";. Excerpt from style.mla.org/urls-some-practical-advice/ MLA's Guidelines on Truncating

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

2020-07-10 Thread B 9
Ingo Schwarze wrote: > Yes, i do strongly object. You make good points, Ingo. Let me see if I can answer your concerns. > I think it is very bad practice to omit the protocol from an URI. > For one thing, it results in invalid URI syntax. I am only talking about the display. When hovering ove

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

2020-07-09 Thread B 9
Steve Izma wrote: > Anyway, my strategies for typesetting for a printed document: > [...] Since you had such excellent suggestions, I'd like your advice about something I've noticed: printed materials often omit the protocol when it is "https://"; or "http://";. That makes sense to me and I am i

Re: Hypertext solution

2020-07-09 Thread B 9
try it out on your documents. If you haven't used the WWW package before, it is quite simple: .URL "https://www.oeaw.ac.at/kal/agm/"; "Ancient Greek Melodies" . Thank you, —b9 B 9 wrote: > Thank you for testing it out, Nate! > > The missing open parenthesis

Re: Hypertext solution

2020-07-01 Thread B 9
Thank you for testing it out, Nate! The missing open parenthesis is a sign the www.tmac that came with groff 1.22.4 is being used, not my new version. Putting it in /etc/groff/ was all I needed to do to, but that may be because I'm on a Debian GNU/Linux system and /usr/share/groff/site-tmac is

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

2020-06-21 Thread B 9
Nate Bargmann wrote: > I concur with Deri as the link is not clickable in evince on Debian > Linux in this PDF. Oh, thank goodness. So, I'm not the only one. So, I guess that brings me back to my original question: Can groff make links clickable when rendering to PDF? And, I guess the answer is,

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

2020-06-19 Thread B 9
> This is my output (diff to your output follows): Thank you, Jan Stary. I am a bit confused because the intermediate output you sent doesn't have any PDF hypertext information in it. When I use 'gropdf' to parse it, the links aren't clickable. Same when I paste it into https://rawgit.com/Alhad

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

2020-06-19 Thread B 9
: 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

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

2020-06-18 Thread B 9
"James K. Lowden" wrote: > On Wed, 17 Jun 2020 08:59:17 +0200 > Jan Stary wrote: > > I don't think something like that belongs into mdoc(7) at all. > > It's a "semantic markup language for formatting manual pages". > > Let it be what is is, and has been for decades. > > I think there's an incor

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

2020-06-16 Thread B 9
Jan Stary wrote: > Attached please see the PDF output of groff 1.22.4 and mandoc 1.14.5; > neither of them adds a newline before or after the clickable link. What is the groff command line you are using? I tried groff 1.22.4 on a couple different machines and couldn't come up with a clickable li

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

2020-06-16 Thread B 9
On Tue, Jun 16, 2020, Steve Izma wrote: > Anyway, my strategies for typesetting for a printed document: I'm always impressed by people who know how to typeset AND how to write! Thank you for the clear and concise rules. Steve Izma wrote: > - don't set the URL at all in the body of the text but

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

2020-06-16 Thread B 9
Ingo Schwarze 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/

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

2020-06-15 Thread B 9
Jan Stary wrote: > You say mdoc; shouldn't the links be Lk? Good question. I had tried Lk first and it didn't seem work any better and was less well documented. The man page for 'mdoc' which comes with GNU/Linux systems (kernel.org/doc/man-pages) mentions UR and UE, but omits Lk. On the other ha

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

2020-06-14 Thread B 9
Hi! I've been writing up a lengthy man page using -mdoc and it's been great so far. I love that I can also easily create a beautiful PDF document using groff -Tpdf. But there is one problem I haven't solved: How can I make links which I've declared using .UR and .UE into actual clickable links in