From: Alejandro Colomar <alx@kernel.org>
To: branden@debian.org, linux-man@vger.kernel.org,
Deri James <deri@chuzzlewit.myzen.co.uk>
Subject: man-pages PDF book's an.tmac
Date: Fri, 22 Mar 2024 18:12:04 +0100 [thread overview]
Message-ID: <Zf275AdkitaeCq3E@debian> (raw)
[-- Attachment #1: Type: text/plain, Size: 3876 bytes --]
Hi,
We have a huge an.tmac copy in the Linux man-pages scripts, for
generating the PDF book.
$ wc -l scripts/LinuxManBook/an.tmac
1611 scripts/LinuxManBook/an.tmac
However, it's mostly identical to groff-1.23.0's an.tmac.
$ diff -u1 -w scripts/LinuxManBook/an.tmac /usr/share/groff/1.23.0/tmac/an.tmac
--- scripts/LinuxManBook/an.tmac 2023-12-01 01:27:03.344759060 +0100
+++ /usr/share/groff/1.23.0/tmac/an.tmac 2024-03-12 07:07:16.000000000 +0100
@@ -205,21 +205,5 @@
.
-.de an*cln
-. ds \\$1
-. als an*cln:res \\$1
-. shift
-. ds an*cln:res \\$*\"
-. ds an*cln:char \\*[an*cln:res]
-. stringdown an*cln:res
-. substring an*cln:char 0 0
-. if '\\*[an*cln:char]'\%' .substring an*cln:res 1
-. rm an*cln:char
-..
-.
.\" Write a bookmark/anchor/link target $2 at hierarchical depth $1.
.de an*bookmark
-. if \\n[an*is-output-pdf] \{\
-. if (\\n[.$]>2) .an*cln an*page-ref-nm \\$3\"
-. ie (\\$1=1) .pdfbookmark -T "\\*[an*page-ref-nm]" \\$1 \\$2
-. el .pdfbookmark \\$1 \\$2
-. \}
+. if \\n[an*is-output-pdf] .pdfbookmark \\$1 \\$2
..
@@ -311,7 +295,3 @@
. el \{.ie '\\$2'2' .ds an-extra3 \\*[an*section2]\"
-. el \{.ie '\\$2'2type' .ds an-extra3 \\*[an*section2type]\"
. el \{.ie '\\$2'3' .ds an-extra3 \\*[an*section3]\"
-. el \{.ie '\\$2'3const' .ds an-extra3 \\*[an*section3const]\"
-. el \{.ie '\\$2'3head' .ds an-extra3 \\*[an*section3head]\"
-. el \{.ie '\\$2'3type' .ds an-extra3 \\*[an*section3type]\"
. el \{.ie '\\$2'4' .ds an-extra3 \\*[an*section4]\"
@@ -323,3 +303,3 @@
. el .ds an-extra3 \" empty
-. \}\}\}\}\}\}\}\}\}\}\}\}
+. \}\}\}\}\}\}\}\}
. \}
@@ -442,3 +422,3 @@
. if !\\n[an*was-TH-bookmark-emitted] \{\
-.\" . an*bookmark 2 \E*[an*page-ref-string]
+. an*bookmark 1 \E*[an*page-ref-string]
. nr an*was-TH-bookmark-emitted 1
@@ -480,4 +460,2 @@
. ds an-pageref \\*[an*topic-abbv](\\*[an*section])\"
-. an*cln an*page-ref-bm-nm \\*[an*topic]_\\*[an*section]\"
-. stringdown an*page-ref-bm-nm
. nr an-header-width \\w'\\*[an-pageref]\\*[an-extra3]\\*[an-pageref]'
@@ -719,4 +697,4 @@
. if \\n[CS] .stringup an-section-heading
-. an*bookmark 3 "\\*[an-section-heading]"
-\&\\*[an-section-heading]
+. an*bookmark 2 \E*[an-section-heading]
+. nop \&\\*[an-section-heading]
. \}
@@ -745,3 +723,3 @@
. ds an*subsection-heading \\$*\"
-. an*bookmark 4 "\\*[an*subsection-heading]"
+. an*bookmark 3 \E*[an*subsection-heading]
. nop \&\\$*
@@ -1193,18 +1171,4 @@
.de1 MR
-. if ((\\n[.$] < 2) : (\\n[.$] > 4)) \
-. an-style-warn .\\$0 expects 2 to 4 arguments, got \\n[.$]
-. ie \\n[an*is-output-pdf] \{\
-. nh
-. ds an*title \\\\$4
-. if '\\\\*[an*title]'' .ds an*title \\\\$1
-. ie \\n(.$=1 \
-. I \\$1
-. el \{\
-. an*cln an*page-ref-nm \\*[an*title]_\\$2
-. ie d pdf:look(\\*[an*page-ref-nm]) .pdfhref L -D \\*[an*page-ref-nm] -A "\\$3" -- \fI\\$1\fP(\\$2)
-. el .IR \\$1 (\\$2)\\$3
-. \}
-. hy \\n(mJ
-. \}
-. el \{\
+. if ((\\n[.$] < 2) : (\\n[.$] > 3)) \
+. an-style-warn .\\$0 expects 2 or 3 arguments, got \\n[.$]
. ds an*url man:\\$1(\\$2)\" used everywhere but macOS
@@ -1231,3 +1195,2 @@
. nop \&\\$3
-. \}
. hy \\n[an*hyphenation-mode]
@@ -1333,3 +1296,3 @@
.
-.ds an*body-family \n[.fam] \" Times
+.ds an*body-family T \" Times
.ds an*example-family C \" Courier
I was wondering if we need to keep it, or if we could remove it, or at
least trim it to just a few lines. Maybe some things can be upstreamed,
or maybe they are already upstream.
Thanks,
Alex
--
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
reply other threads:[~2024-03-22 17:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=Zf275AdkitaeCq3E@debian \
--to=alx@kernel.org \
--cc=branden@debian.org \
--cc=deri@chuzzlewit.myzen.co.uk \
--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