All of lore.kernel.org
 help / color / mirror / Atom feed
* man-pages PDF book's an.tmac
@ 2024-03-22 17:12 Alejandro Colomar
  0 siblings, 0 replies; only message in thread
From: Alejandro Colomar @ 2024-03-22 17:12 UTC (permalink / raw)
  To: branden, linux-man, Deri James

[-- 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 --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-22 17:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-22 17:12 man-pages PDF book's an.tmac Alejandro Colomar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.