[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mandoc-tech
Subject:    eqn(7) "delim" is undocumented (maybe)
From:       "Anthony J. Bentley" <anthony () anjbe ! name>
Date:       2019-12-08 8:42:37
Message-ID: 38466-1575794557.527458 () DkTY ! Emny ! Ld6w
[Download RAW message or body]

Hi,

I can't find anyplace that documents eqn(7)'s "delim" statement (even
groff's eqn(1) doesn't really). This is widely used in the X11 manuals
and others for inline math. For example, glTexGenfv(3):

 .EQ
 delim $$
 .EN
 ...
 This function can be used, for example, to texture-map terrain using sea level
 as a reference plane
 (defined by $p sub 1$, $p sub 2$, $p sub 3$, and $p sub 4$).

I gave a shot at documenting it in the diff below... of course, open to
improvements in both correctness and clarity.

As an aside, I expected these two examples to render the same, but they
don't. Should they look the same, or am I misunderstanding how eqn(7)
works?

.\" "delim off sin(<pi>)"
.EQ
delim $$
delim off
.EN
$sin { pi }$

.\" "$sin { pi }$"
.EQ
delim $$
.EN
.EQ
delim off
.EN
$sin { pi }$


Index: eqn.7
===================================================================
RCS file: /cvs/src/share/man/man7/eqn.7,v
retrieving revision 1.11
diff -u -p -r1.11 eqn.7
--- eqn.7	23 Apr 2019 17:52:12 -0000	1.11
+++ eqn.7	8 Dec 2019 08:41:25 -0000
@@ -67,6 +67,10 @@ these are not the same as
 macros, and may only be invoked as
 .Sq \&.EQ .
 .Pp
+Inline equations are delimited by characters set by a
+.Cm delim
+statement.
+.Pp
 The equation grammar is as follows, where quoted strings are
 case-sensitive literals in the input:
 .Bd -literal -offset indent
@@ -178,6 +182,23 @@ statement is a synonym for
 while
 .Cm tdefine
 is discarded.
+.It Cm delim
+Set the two characters used to delimit inline equations.
+Its syntax is as follows:
+.Pp
+.D1 Cm delim Ar param
+.Pp
+.Ar param
+is a two-character string,
+the first and second character of which delimit the start and end of inline
+equations throughout the document.
+Alternately,
+.Ar param
+may be the special string
+.Cm off ,
+which disables any previously declared delimiters, or
+.Cm on ,
+which reenables previously defined delimiters that have been turned off.
 .It Cm gfont
 Set the default font of subsequent output.
 Its syntax is as follows:
--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic