On Tuesday, 21 January 2025 19:29:22 GMT G. Branden Robinson wrote: > Okay. I don't know what "expandos" means in this context; can you (or a > mom(7) maven) point me to the part of Peter's docs that explains it?
Hi Branden, In section 3.3 of mom-pdf.pdf it says:- If the hotlink text ends in "*" , the asterisk is replaced by the text of the destination point, assuming it’s a heading. If the hotlink text ends in "+" , the replacement text is surrounded by quotes. Using our HEADING example, above, the following invocation of PDF_LINK would produce a click- able link to the introduction: .PDF_LINK intro PREFIX ( SUFFIX ). "see: +" In the text, the link would look like this: (see: “1. Introduction”). And then in section 3.4 it says "accepts the same expandos, "+" and "*".". In ms terms this works:- .NH 1 intro \" NB re-purposing 2nd NH parameter as a destination name (except if it is "S) Introduction .XS Introduction .XE Or the spdf.tmac version which combines heading and TOC entry:- .NH 1 .XN -N intro Introduction Both form create a named destination "intro" which has a value of "Introduction". In either case specifying a hotspot link with:- .XR intro ) ( Would create a clickable link (see: "1. Introduction"). The extra text "see: " comes from my simplified formatting (compared to spdf), since I use the string in \*[spdf:txt] to format the hotlink text which defaults to "see: +" if you don't set it to something else. If you add onto the XR call "explained in *" the hotspot becomes "(explained in 1. Introduction)". Attached is the pdfmark.pdf using our last pdfmark.ms (with some minor additions to control the page numbering in the overview panel) using this command:- pdfmom --roff -ms -M.. -mpdfms -U cover.ms pdfmark2.ms > pdfmark2.pdf So not using pdfroff and -mspdf just changes to ms contained in pdfms.tmac. Not perfect, but produces quite acceptable pdfs. Cheers Deri
pdfmark2.pdf
Description: Adobe PDF document