1*95c635efSGarrett D'Amore.\" 2*95c635efSGarrett D'Amore.\" Permission to use, copy, modify, and distribute this software for any 3*95c635efSGarrett D'Amore.\" purpose with or without fee is hereby granted, provided that the above 4*95c635efSGarrett D'Amore.\" copyright notice and this permission notice appear in all copies. 5*95c635efSGarrett D'Amore.\" 6*95c635efSGarrett D'Amore.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 7*95c635efSGarrett D'Amore.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 8*95c635efSGarrett D'Amore.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 9*95c635efSGarrett D'Amore.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 10*95c635efSGarrett D'Amore.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 11*95c635efSGarrett D'Amore.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 12*95c635efSGarrett D'Amore.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 13*95c635efSGarrett D'Amore.\" 14*95c635efSGarrett D'Amore.\" 15*95c635efSGarrett D'Amore.\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> 16*95c635efSGarrett D'Amore.\" Copyright 2012 Nexenta Systems, Inc. All rights reserved. 17*95c635efSGarrett D'Amore.\" 18*95c635efSGarrett D'Amore.Dd Jul 19, 2014 19*95c635efSGarrett D'Amore.Dt EQN 5 20*95c635efSGarrett D'Amore.Os 21*95c635efSGarrett D'Amore.Sh NAME 22*95c635efSGarrett D'Amore.Nm eqn 23*95c635efSGarrett D'Amore.Nd eqn language reference for mandoc 24*95c635efSGarrett D'Amore.Sh DESCRIPTION 25*95c635efSGarrett D'AmoreThe 26*95c635efSGarrett D'Amore.Nm eqn 27*95c635efSGarrett D'Amorelanguage is an equation-formatting language. 28*95c635efSGarrett D'AmoreIt is used within 29*95c635efSGarrett D'Amore.Xr mdoc 5 30*95c635efSGarrett D'Amoreand 31*95c635efSGarrett D'Amore.Xr man 5 32*95c635efSGarrett D'Amore.Ux 33*95c635efSGarrett D'Amoremanual pages. 34*95c635efSGarrett D'AmoreIt describes the 35*95c635efSGarrett D'Amore.Em structure 36*95c635efSGarrett D'Amoreof an equation, not its mathematical meaning. 37*95c635efSGarrett D'AmoreThis manual describes the 38*95c635efSGarrett D'Amore.Nm 39*95c635efSGarrett D'Amorelanguage accepted by the 40*95c635efSGarrett D'Amore.Xr mandoc 1 41*95c635efSGarrett D'Amoreutility, which corresponds to the Second Edition eqn specification (see 42*95c635efSGarrett D'Amore.Sx SEE ALSO 43*95c635efSGarrett D'Amorefor references). 44*95c635efSGarrett D'Amore.Pp 45*95c635efSGarrett D'AmoreEquations within 46*95c635efSGarrett D'Amore.Xr mdoc 5 47*95c635efSGarrett D'Amoreor 48*95c635efSGarrett D'Amore.Xr man 5 49*95c635efSGarrett D'Amoredocuments are enclosed by the standalone 50*95c635efSGarrett D'Amore.Sq \&.EQ 51*95c635efSGarrett D'Amoreand 52*95c635efSGarrett D'Amore.Sq \&.EN 53*95c635efSGarrett D'Amoretags. 54*95c635efSGarrett D'AmoreEquations are multi-line blocks consisting of formulas and control 55*95c635efSGarrett D'Amorestatements. 56*95c635efSGarrett D'Amore.Sh EQUATION STRUCTURE 57*95c635efSGarrett D'AmoreEach equation is bracketed by 58*95c635efSGarrett D'Amore.Sq \&.EQ 59*95c635efSGarrett D'Amoreand 60*95c635efSGarrett D'Amore.Sq \&.EN 61*95c635efSGarrett D'Amorestrings. 62*95c635efSGarrett D'Amore.Em Note : 63*95c635efSGarrett D'Amorethese are not the same as 64*95c635efSGarrett D'Amore.Xr roff 5 65*95c635efSGarrett D'Amoremacros, and may only be invoked as 66*95c635efSGarrett D'Amore.Sq \&.EQ . 67*95c635efSGarrett D'Amore.Pp 68*95c635efSGarrett D'AmoreThe equation grammar is as follows, where quoted strings are 69*95c635efSGarrett D'Amorecase-sensitive literals in the input: 70*95c635efSGarrett D'Amore.Bd -literal -offset indent 71*95c635efSGarrett D'Amoreeqn : box | eqn box 72*95c635efSGarrett D'Amorebox : text 73*95c635efSGarrett D'Amore | \*q{\*q eqn \*q}\*q 74*95c635efSGarrett D'Amore | \*qdefine\*q text text 75*95c635efSGarrett D'Amore | \*qndefine\*q text text 76*95c635efSGarrett D'Amore | \*qtdefine\*q text text 77*95c635efSGarrett D'Amore | \*qgfont\*q text 78*95c635efSGarrett D'Amore | \*qgsize\*q text 79*95c635efSGarrett D'Amore | \*qset\*q text text 80*95c635efSGarrett D'Amore | \*qundef\*q text 81*95c635efSGarrett D'Amore | box pos box 82*95c635efSGarrett D'Amore | box mark 83*95c635efSGarrett D'Amore | \*qmatrix\*q \*q{\*q [col \*q{\*q list \*q}\*q ]* 84*95c635efSGarrett D'Amore | pile \*q{\*q list \*q}\*q 85*95c635efSGarrett D'Amore | font box 86*95c635efSGarrett D'Amore | \*qsize\*q text box 87*95c635efSGarrett D'Amore | \*qleft\*q text eqn [\*qright\*q text] 88*95c635efSGarrett D'Amorecol : \*qlcol\*q | \*qrcol\*q | \*qccol\*q | \*qcol\*q 89*95c635efSGarrett D'Amoretext : [^space\e\*q]+ | \e\*q.*\e\*q 90*95c635efSGarrett D'Amorepile : \*qlpile\*q | \*qcpile\*q | \*qrpile\*q | \*qpile\*q 91*95c635efSGarrett D'Amorepos : \*qover\*q | \*qsup\*q | \*qsub\*q | \*qto\*q | \*qfrom\*q 92*95c635efSGarrett D'Amoremark : \*qdot\*q | \*qdotdot\*q | \*qhat\*q | \*qtilde\*q | \*qvec\*q 93*95c635efSGarrett D'Amore | \*qdyad\*q | \*qbar\*q | \*qunder\*q 94*95c635efSGarrett D'Amorefont : \*qroman\*q | \*qitalic\*q | \*qbold\*q | \*qfat\*q 95*95c635efSGarrett D'Amorelist : eqn 96*95c635efSGarrett D'Amore | list \*qabove\*q eqn 97*95c635efSGarrett D'Amorespace : [\e^~ \et] 98*95c635efSGarrett D'Amore.Ed 99*95c635efSGarrett D'Amore.Pp 100*95c635efSGarrett D'AmoreWhite-space consists of the space, tab, circumflex, and tilde 101*95c635efSGarrett D'Amorecharacters. 102*95c635efSGarrett D'AmoreIf within a quoted string, these space characters are retained. 103*95c635efSGarrett D'AmoreQuoted strings are also not scanned for replacement definitions. 104*95c635efSGarrett D'Amore.Pp 105*95c635efSGarrett D'AmoreThe following text terms are translated into a rendered glyph, if 106*95c635efSGarrett D'Amoreavailable: alpha, beta, chi, delta, epsilon, eta, gamma, iota, kappa, 107*95c635efSGarrett D'Amorelambda, mu, nu, omega, omicron, phi, pi, psi, rho, sigma, tau, theta, 108*95c635efSGarrett D'Amoreupsilon, xi, zeta, DELTA, GAMMA, LAMBDA, OMEGA, PHI, PI, PSI, SIGMA, 109*95c635efSGarrett D'AmoreTHETA, UPSILON, XI, inter (intersection), union (union), prod (product), 110*95c635efSGarrett D'Amoreint (integral), sum (summation), grad (gradient), del (vector 111*95c635efSGarrett D'Amoredifferential), times (multiply), cdot (centre-dot), nothing (zero-width 112*95c635efSGarrett D'Amorespace), approx (approximately equals), prime (prime), half (one-half), 113*95c635efSGarrett D'Amorepartial (partial differential), inf (infinity), >> (much greater), << 114*95c635efSGarrett D'Amore(much less), \-> (left arrow), <\- (right arrow), += (plus-minus), != 115*95c635efSGarrett D'Amore(not equal), == (equivalence), <= (less-than-equal), and >= 116*95c635efSGarrett D'Amore(more-than-equal). 117*95c635efSGarrett D'Amore.Pp 118*95c635efSGarrett D'AmoreThe following control statements are available: 119*95c635efSGarrett D'Amore.Bl -tag -width Ds 120*95c635efSGarrett D'Amore.It Cm define 121*95c635efSGarrett D'AmoreReplace all occurrences of a key with a value. 122*95c635efSGarrett D'AmoreIts syntax is as follows: 123*95c635efSGarrett D'Amore.Pp 124*95c635efSGarrett D'Amore.D1 define Ar key cvalc 125*95c635efSGarrett D'Amore.Pp 126*95c635efSGarrett D'AmoreThe first character of the value string, 127*95c635efSGarrett D'Amore.Ar c , 128*95c635efSGarrett D'Amoreis used as the delimiter for the value 129*95c635efSGarrett D'Amore.Ar val . 130*95c635efSGarrett D'AmoreThis allows for arbitrary enclosure of terms (not just quotes), such as 131*95c635efSGarrett D'Amore.Pp 132*95c635efSGarrett D'Amore.D1 define Ar foo 'bar baz' 133*95c635efSGarrett D'Amore.D1 define Ar foo cbar bazc 134*95c635efSGarrett D'Amore.Pp 135*95c635efSGarrett D'AmoreIt is an error to have an empty 136*95c635efSGarrett D'Amore.Ar key 137*95c635efSGarrett D'Amoreor 138*95c635efSGarrett D'Amore.Ar val . 139*95c635efSGarrett D'AmoreNote that a quoted 140*95c635efSGarrett D'Amore.Ar key 141*95c635efSGarrett D'Amorecauses errors in some 142*95c635efSGarrett D'Amore.Nm 143*95c635efSGarrett D'Amoreimplementations and should not be considered portable. 144*95c635efSGarrett D'AmoreIt is not expanded for replacements. 145*95c635efSGarrett D'AmoreDefinitions may refer to other definitions; these are evaluated 146*95c635efSGarrett D'Amorerecursively when text replacement occurs and not when the definition is 147*95c635efSGarrett D'Amorecreated. 148*95c635efSGarrett D'Amore.Pp 149*95c635efSGarrett D'AmoreDefinitions can create arbitrary strings, for example, the following is 150*95c635efSGarrett D'Amorea legal construction. 151*95c635efSGarrett D'Amore.Bd -literal -offset indent 152*95c635efSGarrett D'Amoredefine foo 'define' 153*95c635efSGarrett D'Amorefoo bar 'baz' 154*95c635efSGarrett D'Amore.Ed 155*95c635efSGarrett D'Amore.Pp 156*95c635efSGarrett D'AmoreSelf-referencing definitions will raise an error. 157*95c635efSGarrett D'AmoreThe 158*95c635efSGarrett D'Amore.Cm ndefine 159*95c635efSGarrett D'Amorestatement is a synonym for 160*95c635efSGarrett D'Amore.Cm define , 161*95c635efSGarrett D'Amorewhile 162*95c635efSGarrett D'Amore.Cm tdefine 163*95c635efSGarrett D'Amoreis discarded. 164*95c635efSGarrett D'Amore.It Cm gfont 165*95c635efSGarrett D'AmoreSet the default font of subsequent output. 166*95c635efSGarrett D'AmoreIts syntax is as follows: 167*95c635efSGarrett D'Amore.Pp 168*95c635efSGarrett D'Amore.D1 gfont Ar font 169*95c635efSGarrett D'Amore.Pp 170*95c635efSGarrett D'AmoreIn 171*95c635efSGarrett D'Amore.Xr mandoc 1 , 172*95c635efSGarrett D'Amorethis value is discarded. 173*95c635efSGarrett D'Amore.It Cm gsize 174*95c635efSGarrett D'AmoreSet the default size of subsequent output. 175*95c635efSGarrett D'AmoreIts syntax is as follows: 176*95c635efSGarrett D'Amore.Pp 177*95c635efSGarrett D'Amore.D1 gsize Ar size 178*95c635efSGarrett D'Amore.Pp 179*95c635efSGarrett D'AmoreThe 180*95c635efSGarrett D'Amore.Ar size 181*95c635efSGarrett D'Amorevalue should be an integer. 182*95c635efSGarrett D'Amore.It Cm set 183*95c635efSGarrett D'AmoreSet an equation mode. 184*95c635efSGarrett D'AmoreIn 185*95c635efSGarrett D'Amore.Xr mandoc 1 , 186*95c635efSGarrett D'Amoreboth arguments are thrown away. 187*95c635efSGarrett D'AmoreIts syntax is as follows: 188*95c635efSGarrett D'Amore.Pp 189*95c635efSGarrett D'Amore.D1 set Ar key val 190*95c635efSGarrett D'Amore.Pp 191*95c635efSGarrett D'AmoreThe 192*95c635efSGarrett D'Amore.Ar key 193*95c635efSGarrett D'Amoreand 194*95c635efSGarrett D'Amore.Ar val 195*95c635efSGarrett D'Amoreare not expanded for replacements. 196*95c635efSGarrett D'AmoreThis statement is a GNU extension. 197*95c635efSGarrett D'Amore.It Cm undef 198*95c635efSGarrett D'AmoreUnset a previously-defined key. 199*95c635efSGarrett D'AmoreIts syntax is as follows: 200*95c635efSGarrett D'Amore.Pp 201*95c635efSGarrett D'Amore.D1 define Ar key 202*95c635efSGarrett D'Amore.Pp 203*95c635efSGarrett D'AmoreOnce invoked, the definition for 204*95c635efSGarrett D'Amore.Ar key 205*95c635efSGarrett D'Amoreis discarded. 206*95c635efSGarrett D'AmoreThe 207*95c635efSGarrett D'Amore.Ar key 208*95c635efSGarrett D'Amoreis not expanded for replacements. 209*95c635efSGarrett D'AmoreThis statement is a GNU extension. 210*95c635efSGarrett D'Amore.El 211*95c635efSGarrett D'Amore.Sh COMPATIBILITY 212*95c635efSGarrett D'AmoreThis section documents the compatibility of 213*95c635efSGarrett D'Amore.Xr mandoc 1 214*95c635efSGarrett D'Amore.Nm 215*95c635efSGarrett D'Amoreand the 216*95c635efSGarrett D'Amore.Xr troff 1 217*95c635efSGarrett D'Amore.Nm 218*95c635efSGarrett D'Amoreimplementation (including GNU troff). 219*95c635efSGarrett D'Amore.Pp 220*95c635efSGarrett D'Amore.Bl -dash -compact 221*95c635efSGarrett D'Amore.It 222*95c635efSGarrett D'AmoreThe text string 223*95c635efSGarrett D'Amore.Sq \e\*q 224*95c635efSGarrett D'Amoreis interpreted as a literal quote in 225*95c635efSGarrett D'Amore.Xr troff 1 . 226*95c635efSGarrett D'AmoreIn 227*95c635efSGarrett D'Amore.Xr mandoc 1 , 228*95c635efSGarrett D'Amorethis is interpreted as a comment. 229*95c635efSGarrett D'Amore.It 230*95c635efSGarrett D'AmoreIn 231*95c635efSGarrett D'Amore.Xr troff 1 , 232*95c635efSGarrett D'AmoreThe circumflex and tilde white-space symbols map to 233*95c635efSGarrett D'Amorefixed-width spaces. 234*95c635efSGarrett D'AmoreIn 235*95c635efSGarrett D'Amore.Xr mandoc 1 , 236*95c635efSGarrett D'Amorethese characters are synonyms for the space character. 237*95c635efSGarrett D'Amore.It 238*95c635efSGarrett D'AmoreThe 239*95c635efSGarrett D'Amore.Xr troff 1 , 240*95c635efSGarrett D'Amoreimplementation of 241*95c635efSGarrett D'Amore.Nm 242*95c635efSGarrett D'Amoreallows for equation alignment with the 243*95c635efSGarrett D'Amore.Cm mark 244*95c635efSGarrett D'Amoreand 245*95c635efSGarrett D'Amore.Cm lineup 246*95c635efSGarrett D'Amoretokens. 247*95c635efSGarrett D'Amore.Xr mandoc 1 248*95c635efSGarrett D'Amorediscards these tokens. 249*95c635efSGarrett D'AmoreThe 250*95c635efSGarrett D'Amore.Cm back Ar n , 251*95c635efSGarrett D'Amore.Cm fwd Ar n , 252*95c635efSGarrett D'Amore.Cm up Ar n , 253*95c635efSGarrett D'Amoreand 254*95c635efSGarrett D'Amore.Cm down Ar n 255*95c635efSGarrett D'Amorecommands are also ignored. 256*95c635efSGarrett D'Amore.El 257*95c635efSGarrett D'Amore.Sh SEE ALSO 258*95c635efSGarrett D'Amore.Xr mandoc 1 , 259*95c635efSGarrett D'Amore.Xr man 5 , 260*95c635efSGarrett D'Amore.Xr mandoc_char 5 , 261*95c635efSGarrett D'Amore.Xr mdoc 5 , 262*95c635efSGarrett D'Amore.Xr roff 5 263*95c635efSGarrett D'Amore.Rs 264*95c635efSGarrett D'Amore.%A Brian W. Kernighan 265*95c635efSGarrett D'Amore.%A Lorinda L. Cherry 266*95c635efSGarrett D'Amore.%T System for Typesetting Mathematics 267*95c635efSGarrett D'Amore.%J Communications of the ACM 268*95c635efSGarrett D'Amore.%V 18 269*95c635efSGarrett D'Amore.%P 151\(en157 270*95c635efSGarrett D'Amore.%D March, 1975 271*95c635efSGarrett D'Amore.Re 272*95c635efSGarrett D'Amore.Rs 273*95c635efSGarrett D'Amore.%A Brian W. Kernighan 274*95c635efSGarrett D'Amore.%A Lorinda L. Cherry 275*95c635efSGarrett D'Amore.%T Typesetting Mathematics, User's Guide 276*95c635efSGarrett D'Amore.%D 1976 277*95c635efSGarrett D'Amore.Re 278*95c635efSGarrett D'Amore.Rs 279*95c635efSGarrett D'Amore.%A Brian W. Kernighan 280*95c635efSGarrett D'Amore.%A Lorinda L. Cherry 281*95c635efSGarrett D'Amore.%T Typesetting Mathematics, User's Guide (Second Edition) 282*95c635efSGarrett D'Amore.%D 1978 283*95c635efSGarrett D'Amore.Re 284*95c635efSGarrett D'Amore.Sh HISTORY 285*95c635efSGarrett D'AmoreThe eqn utility, a preprocessor for troff, was originally written by 286*95c635efSGarrett D'AmoreBrian W. Kernighan and Lorinda L. Cherry in 1975. 287*95c635efSGarrett D'AmoreThe GNU reimplementation of eqn, part of the GNU troff package, was 288*95c635efSGarrett D'Amorereleased in 1989 by James Clark. 289*95c635efSGarrett D'AmoreThe eqn component of 290*95c635efSGarrett D'Amore.Xr mandoc 1 291*95c635efSGarrett D'Amorewas added in 2011. 292*95c635efSGarrett D'Amore.Sh AUTHORS 293*95c635efSGarrett D'AmoreThis 294*95c635efSGarrett D'Amore.Nm 295*95c635efSGarrett D'Amorereference was written by 296*95c635efSGarrett D'Amore.An Kristaps Dzonsons , 297*95c635efSGarrett D'Amore.Mt kristaps@bsd.lv . 298