# FreeBSD Manual Pages

EQN(7) FreeBSD Miscellaneous Information Manual EQN(7)NAMEeqn-- eqn language reference for mandocDESCRIPTIONTheeqnlanguage is an equation-formatting language. It is used within mdoc(7) and man(7) UNIX manual pages. It describes thestructureof an equation, not its mathematical meaning. This manual describes theeqnlanguage accepted by the mandoc(1) utility, which corresponds to the Sec- ond Editioneqnspecification (seeSEEALSOfor references). Equations within mdoc(7) or man(7) documents are enclosed by the stand- alone `.EQ' and `.EN' tags. Equations are multi-line blocks consisting of formulas and control statements.EQUATION STRUCTUREEach equation is bracketed by `.EQ' and `.EN' strings.Note: these are not the same as roff(7) macros, and may only be invoked as `.EQ'. The equation grammar is as follows, where quoted strings are case-sensi- tive literals in the input: eqn : box | eqn box box : text | "{" eqn "}" | "define" text text | "ndefine" text text | "tdefine" text text | "gfont" text | "gsize" text | "set" text text | "undef" text | "sqrt" box | box pos box | box mark | "matrix" "{" [col "{" list "}"]* "}" | pile "{" list "}" | font box | "size" text box | "left" text eqn ["right" text] col : "lcol" | "rcol" | "ccol" | "col" text : [^space\"]+ | \".*\" pile : "lpile" | "cpile" | "rpile" | "pile" pos : "over" | "sup" | "sub" | "to" | "from" mark : "dot" | "dotdot" | "hat" | "tilde" | "vec" | "dyad" | "bar" | "under" font : "roman" | "italic" | "bold" | "fat" list : eqn | list "above" eqn space : [\^~ \t] White-space consists of the space, tab, circumflex, and tilde characters. It is required to delimit tokens consisting of alphabetic characters and it is ignored at other places. Braces and quotes also delimit tokens. If within a quoted string, these space characters are retained. Quoted strings are also not scanned for keywords, glyph names, and expansion of definitions. To print a literal quote character, it can be prepended with a backslash or expressed with the \(dq escape sequence. Subequations can be enclosed in braces to pass them as arguments to oper- ation keywords, overriding standard operation precedence. Braces can be nested. To set a brace verbatim, it needs to be enclosed in quotes. The following text terms are translated into a rendered glyph, if avail- able: alpha, beta, chi, delta, epsilon, eta, gamma, iota, kappa, lambda, mu, nu, omega, omicron, phi, pi, psi, rho, sigma, tau, theta, upsilon, xi, zeta, DELTA, GAMMA, LAMBDA, OMEGA, PHI, PI, PSI, SIGMA, THETA, UP- SILON, XI, inter (intersection), union (union), prod (product), int (in- tegral), sum (summation), grad (gradient), del (vector differential), times (multiply), cdot (center-dot), nothing (zero-width space), approx (approximately equals), prime (prime), half (one-half), partial (partial differential), inf (infinity), >> (much greater), << (much less), <- (left arrow), -> (right arrow), +- (plus-minus), != (not equal), == (equivalence), <= (less-than-equal), and >= (more-than-equal). The char- acter escape sequences documented in mandoc_char(7) can be used, too. The following control statements are available:defineReplace all occurrences of a key with a value. Its syntax is as follows:definekeycvalcThe first character of the value string,c, is used as the delim- iter for the valueval. This allows for arbitrary enclosure of terms (not just quotes), such asdefinefoo'barbaz'definefoocbarbazcIt is an error to have an emptykeyorval. Note that a quotedkeycauses errors in someeqnimplementations and should not be considered portable. It is not expanded for replacements. Defi- nitions may refer to other definitions; these are evaluated re- cursively when text replacement occurs and not when the defini- tion is created. Definitions can create arbitrary strings, for example, the fol- lowing is a legal construction. define foo 'define' foo bar 'baz' Self-referencing definitions will raise an error. Thendefinestatement is a synonym fordefine, whiletdefineis discarded.gfontSet the default font of subsequent output. Its syntax is as fol- lows:gfontfontIn mandoc, this value is discarded.gsizeSet the default size of subsequent output. Its syntax is as fol- lows:gsize[+|-]sizeThesizevalue should be an integer. If prepended by a sign, the font size is changed relative to the current size.setSet an equation mode. In mandoc, both arguments are thrown away. Its syntax is as follows:setkeyvalThekeyandvalare not expanded for replacements. This state- ment is a GNU extension.undefUnset a previously-defined key. Its syntax is as follows:definekeyOnce invoked, the definition forkeyis discarded. Thekeyis not expanded for replacements. This statement is a GNU exten- sion. Operation keywords have the following semantics:aboveSeepile.barDraw a line over the preceding box.boldSet the following box using bold font.ccolLikecpile, but for use inmatrix.cpileLikepile, but with slightly increased vertical spacing.dotSet a single dot over the preceding box.dotdotSet two dots (dieresis) over the preceding box.dyadSet a dyad symbol (left-right arrow) over the preceding box.fatA synonym forbold.fontSet the second argument using the font specified by the first ar- gument; currently not recognized by the mandoc(1)eqnparser.fromSet the following box below the preceding box, using a slightly smaller font. Used for sums, integrals, limits, and the like.hatSet a hat (circumflex) over the preceding box.italicSet the following box using italic font.lcolLikelpile, but for use inmatrix.leftSet the first argument as a big left delimiter before the second argument. As an optional third argument,rightcan follow. In that case, the fourth argument is set as a big right delimiter after the second argument.lpileLikecpile, but subequations are left-justified.matrixFollowed by a list of columns enclosed in braces. All columns need to have the same number of subequations. The columns are set as a matrix. The difference compared to multiple subsequentpileoperators is that in amatrix, corresponding subequations in all columns line up horizontally, while eachpiledoes vertical spacing independently.overSet a fraction. The preceding box is the numerator, the follow- ing box is the denominator.pileFollowed by a list of subequations enclosed in braces, the sube- quations being separated byabovekeywords. Sets the subequa- tions one above the other, each of them centered. Typically used to represent vectors in coordinate representation.rcolLikerpile, but for use inmatrix.rightSeeleft;rightcannot be used withoutleft. To set a big right delimiter without a big left delimiter, the following construc- tion can be used:left""boxrightdelimiterromanSet the following box using the default font.rpileLikecpile, but subequations are right-justified.sizeSet the second argument with the font size specified by the first argument; currently ignored by mandoc(1). By prepending a plus or minus sign to the first argument, the font size can be se- lected relative to the current size.sqrtSet the square root of the following box.subSet the following box as a subscript to the preceding box.supSet the following box as a superscript to the preceding box. As a special case, if asupclause immediately follows asubclause as inmainboxsubsubboxsupsupboxboth are set with respect to the samemainbox, that is,supboxis set abovesubbox.tildeSet a tilde over the preceding box.toSet the following box above the preceding box, using a slightly smaller font. Used for sums and integrals and the like. As a special case, if atoclause immediately follows afromclause as inmainboxfromfromboxtotoboxboth are set below and above the samemainbox.underUnderline the preceding box.vecSet a vector symbol (right arrow) over the preceding box. The binary operationsfrom,to,sub, andsupgroup to the right, that is,mainboxsupsupboxsubsubboxis the same asmainboxsup{supboxsubsubbox} and different from {mainboxsupsupbox}subsubbox. By contrast,overgroups to the left. In the following list, earlier operations bind more tightly than later operations: 1.dyad,vec,under,bar,tilde,hat,dot,dotdot2.fat,roman,italic,bold,size3.sub,sup4.sqrt5.over6.from,toCOMPATIBILITYThis section documents the compatibility of mandoceqnand the troffeqnimplementation (including GNU troff).-The text string `\"' is interpreted as a literal quote in troff. In mandoc, this is interpreted as a comment.-In troff, The circumflex and tilde white-space symbols map to fixed- width spaces. In mandoc, these characters are synonyms for the space character.-The troff implementation ofeqnallows for equation alignment with themarkandlineuptokens. mandoc discards these tokens. Thebackn,fwdn,upn, anddownncommands are also ignored.SEE ALSOmandoc(1), man(7), mandoc_char(7), mdoc(7), roff(7) Brian W. Kernighan and Lorinda L. Cherry, "System for Typesetting Mathematics",CommunicationsoftheACM, 18, 151-157, March, 1975. Brian W. Kernighan and Lorinda L. Cherry,TypesettingMathematics,User'sGuide, 1976. Brian W. Kernighan and Lorinda L. Cherry,TypesettingMathematics,User'sGuide(SecondEdition), 1978.HISTORYThe eqn utility, a preprocessor for troff, was originally written by Brian W. Kernighan and Lorinda L. Cherry in 1975. The GNU reimplementa- tion of eqn, part of the GNU troff package, was released in 1989 by James Clark. The eqn component of mandoc(1) was added in 2011.AUTHORSThiseqnreference was written by Kristaps Dzonsons <kristaps@bsd.lv>. FreeBSD 13.0 September 4, 2017 FreeBSD 13.0

NAME | DESCRIPTION | EQUATION STRUCTURE | COMPATIBILITY | SEE ALSO | HISTORY | AUTHORS

Want to link to this manual page? Use this URL:

<https://www.freebsd.org/cgi/man.cgi?query=eqn&sektion=7&manpath=FreeBSD+12.0-RELEASE>