groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 05/06: eqn(1): Add quadratic formula example.


From: G. Branden Robinson
Subject: [groff] 05/06: eqn(1): Add quadratic formula example.
Date: Tue, 30 May 2023 12:17:45 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 162682b54a5e98e0a789bd5ff1df44bf5622a81e
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue May 30 09:06:28 2023 -0500

    eqn(1): Add quadratic formula example.
    
    Also fix style nit: vary wording.
---
 src/preproc/eqn/eqn.1.man | 50 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 49 insertions(+), 1 deletion(-)

diff --git a/src/preproc/eqn/eqn.1.man b/src/preproc/eqn/eqn.1.man
index dadd13232..5b0485e73 100644
--- a/src/preproc/eqn/eqn.1.man
+++ b/src/preproc/eqn/eqn.1.man
@@ -156,7 +156,7 @@ reads the standard input stream.
 .P
 Unless the
 .B \-R
-option is given,
+option is used,
 .I @g@eqn
 searches for the file
 .I eqnrc
@@ -2083,6 +2083,54 @@ delim off
 .RE
 .
 .
+.P
+The quadratic formula illustrates use of fractions and radicals,
+and affords an opportunity to use the full space token
+.BR \[ti] .
+.
+.
+.RS
+.P
+.EX
+\&.EQ
+x = { \- b \[ti] \[rs][+\-] \[ti] sqrt { b sup 2 \- 4 a c } } \
+over { 2 a }
+\&.EN
+.EE
+.if t \{\
+.
+.
+.P
+.RS
+.EQ
+x = { - b ~ \[+-] ~ sqrt { b sup 2 - 4 a c } } over { 2 a }
+.EN
+.RE
+.\}
+.RE
+.
+.
+.P
+We could alternatively define the plus-minus sign as a binary operator.
+.
+The default parameters put 0.06 em less space on either side of that
+symbol,
+this being the difference between the
+.B medium_space
+used by binary operators and the width of the full space.
+.
+.
+.RS
+.P
+.EX
+\&.EQ
+chartype "binary" \[rs][+-]
+x = { \- b \[rs][+\-] sqrt { b sup 2 \- 4 a c } } over { 2 a }
+\&.EN
+.EE
+.RE
+.
+.
 .\" ====================================================================
 .SH "See also"
 .\" ====================================================================



reply via email to

[Prev in Thread] Current Thread [Next in Thread]