aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2025-08-24 11:53:38 -0500
committerDan Cross <crossd@gmail.com>2025-10-10 13:44:47 -0400
commite5b5757e640371974d2e70144c8e59c6a5b613f6 (patch)
treee88312a944602526b026aefde095fd3a3590906f
parent19263a10717840901efc6b1cc2f802e7f5173c55 (diff)
tmac/tmac.an*: support `lq`, `rq` strings
The `lq` and `rq` strings are not a groffism, but _almost_ universally portable to man(7) renderers. They originate in 4BSD (1980).[1] They entered Unix System V with SVR4 (1988 or 1989).[2] mandoc(1) has supported them since its inception.[3] * tmac/tmac.an: * tmac/tmac.antimes: Do it. Use U+201C and U+201D if the output device is "utf", otherwise define them as `` and ''. Don't define them as `"` because that breaks when interpolating the strings in macro arguments.[4] [1] https://minnie.tuhs.org/cgi-bin/utree.pl?file=4BSD/usr/lib/tmac/tmac.an.new [2] https://github.com/ryanwoodsmall/oldsysv/blob/e68293af91e2dc39f5f29c20d7e429f9e0cabc75/sysvr4/svr4/ucbcmd/troff/troff.d/tmac.d/an#L46 [3] https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/mandoc/predefs.in?rev=1.1&content-type=text/x-cvsweb-markup [4] https://www.gnu.org/software/groff/manual/groff.html.node/Calling-Macros.html "For the (neutral) double quote, you have recourse to an obscure syntactical feature of AT&T troff. ..."
-rw-r--r--tmac/tmac.an8
-rw-r--r--tmac/tmac.antimes8
2 files changed, 16 insertions, 0 deletions
diff --git a/tmac/tmac.an b/tmac/tmac.an
index 7948a153..dfd653b2 100644
--- a/tmac/tmac.an
+++ b/tmac/tmac.an
@@ -478,6 +478,8 @@
.nr )V 11 \}
.if t \{.ds R ®
.ds S \s\n()S
+.ds lq “
+.ds rq ”
..\}
.if n \{.ie \nL<=0 .nr )L 11i
.el \{.nr )L \nLu
@@ -491,6 +493,12 @@
.nr )O 0\}
.ds R (Reg.)
.ds S
+.ds lq ``
+.ds rq ''
+.\" Insert definitions for non-utf troff-mode devices here.
+.if '\*(.T'utf' \{.ds lq “
+.ds rq ”
+.\}
..\}
.if \nT .nr LL 80n
.if \nV>1 \{
diff --git a/tmac/tmac.antimes b/tmac/tmac.antimes
index 123ea514..b2843713 100644
--- a/tmac/tmac.antimes
+++ b/tmac/tmac.antimes
@@ -450,6 +450,8 @@
.nr)V 12 \}
.ift \{.ds R \(rg
.dsS \s\n()S
+.ds lq “
+.ds rq ”
..\}
.ifn \{.nr )L 11i
.nrLL 6.5i
@@ -461,6 +463,12 @@
.nr)O 0\}
.dsR (Reg.)
.dsS
+.ds lq ``
+.ds rq ''
+.\" Insert definitions for non-utf troff-mode devices here.
+.if '\*(.T'utf' \{.ds lq “
+.ds rq ”
+.\}
..\}
.if\nT .nr LL 80n
.if\nV>1 \{