| 1 | |
| 2 | |
| 3 | |
| 4 | EQN(1) UNIX Programmer's Manual EQN(1) |
| 5 | |
| 6 | |
| 7 | |
| 8 | N\bNA\bAM\bME\bE |
| 9 | eqn, neqn, checkeq - typeset mathematics |
| 10 | |
| 11 | S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS |
| 12 | e\beq\bqn\bn [ -\b-d\bdxy ] [ -\b-p\bpn ] [ -\b-s\bsn ] [ -\b-f\bfn ] [ file ] ... |
| 13 | c\bch\bhe\bec\bck\bke\beq\bq [ file ] ... |
| 14 | |
| 15 | D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN |
| 16 | _\bE_\bq_\bn is a troff(1) preprocessor for typesetting mathematics |
| 17 | on a Graphic Systems phototypesetter, _\bn_\be_\bq_\bn on terminals. |
| 18 | Usage is almost always |
| 19 | |
| 20 | eqn file ... | troff |
| 21 | neqn file ... | nroff |
| 22 | |
| 23 | If no files are specified, these programs reads from the |
| 24 | standard input. A line beginning with `.EQ' marks the start |
| 25 | of an equation; the end of an equation is marked by a line |
| 26 | beginning with `.EN'. Neither of these lines is altered, so |
| 27 | they may be defined in macro packages to get centering, |
| 28 | numbering, etc. It is also possible to set two characters |
| 29 | as `delimiters'; subsequent text between delimiters is also |
| 30 | treated as _\be_\bq_\bn input. Delimiters may be set to characters _\bx |
| 31 | and _\by with the command-line argument -\b-d\bd_\bx_\by or (more commonly) |
| 32 | with `delim _\bx_\by' between .EQ and .EN. The left and right |
| 33 | delimiters may be identical. Delimiters are turned off by |
| 34 | `delim off'. All text that is neither between delimiters |
| 35 | nor between .EQ and .EN is passed through untouched. |
| 36 | |
| 37 | The program _\bc_\bh_\be_\bc_\bk_\be_\bq reports missing or unbalanced delimiters |
| 38 | and .EQ/.EN pairs. |
| 39 | |
| 40 | Tokens within _\be_\bq_\bn are separated by spaces, tabs, newlines, |
| 41 | braces, double quotes, tildes or circumflexes. Braces {} |
| 42 | are used for grouping; generally speaking, anywhere a single |
| 43 | character like _\bx could appear, a complicated construction |
| 44 | enclosed in braces may be used instead. Tilde ~ represents |
| 45 | a full space in the output, circumflex ^ half as much. |
| 46 | |
| 47 | Subscripts and superscripts are produced with the keywords |
| 48 | s\bsu\bub\bb and s\bsu\bup\bp.\b. Thus _\bx _\bs_\bu_\bb _\bi makes _\bx_\bi, _\ba _\bs_\bu_\bb _\bi _\bs_\bu_\bp _\b2 produces |
| 49 | _\ba_\bi |
| 50 | 2 |
| 51 | , and _\be _\bs_\bu_\bp {_\bx _\bs_\bu_\bp _\b2 + _\by _\bs_\bu_\bp _\b2} gives _\be |
| 52 | _\bx2+_\by2 |
| 53 | . |
| 54 | |
| 55 | |
| 56 | Fractions are made with o\bov\bve\ber\br: _\ba _\bo_\bv_\be_\br _\bb yields |
| 57 | _\bb |
| 58 | |
| 59 | _\ba\b_. |
| 60 | |
| 61 | |
| 62 | s\bsq\bqr\brt\bt makes square roots: _\b1 _\bo_\bv_\be_\br _\bs_\bq_\br_\bt {_\ba_\bx _\bs_\bu_\bp _\b2 +_\bb_\bx+_\bc} |
| 63 | |
| 64 | results in |
| 65 | v\b/~~~~~~~~\b\b\b\b\b\b\b\b_\ba_\bx |
| 66 | 2 |
| 67 | +_\bb_\bx+_\bc |
| 68 | |
| 69 | 1\b\b\b\b\b_________ . |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | Printed 7/9/88 1 |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | EQN(1) UNIX Programmer's Manual EQN(1) |
| 83 | |
| 84 | |
| 85 | |
| 86 | The keywords f\bfr\bro\bom\bm and t\bto\bo introduce lower and upper limits on |
| 87 | |
| 88 | arbitrary things: |
| 89 | _\bn->oo |
| 90 | lim |
| 91 | 0 |
| 92 | _\b>\b_\b~ |
| 93 | _\bn |
| 94 | _\bx_\bi is made with _\bl_\bi_\bm _\bf_\br_\bo_\bm {_\bn-> _\bi_\bn_\bf } |
| 95 | |
| 96 | _\bs_\bu_\bm _\bf_\br_\bo_\bm _\b0 _\bt_\bo _\bn _\bx _\bs_\bu_\bb _\bi. |
| 97 | |
| 98 | Left and right brackets, braces, etc., of the right height |
| 99 | are made with l\ble\bef\bft\bt and r\bri\big\bgh\bht\bt:\b: _\bl_\be_\bf_\bt [ _\bx _\bs_\bu_\bp _\b2 + _\by _\bs_\bu_\bp _\b2 _\bo_\bv_\be_\br |
| 100 | |
| 101 | _\ba_\bl_\bp_\bh_\ba _\br_\bi_\bg_\bh_\bt ] ~=~_\b1 produces |
| 102 | |\b |
| 103 | |\b |
| 104 | | |
| 105 | _\bx |
| 106 | 2 |
| 107 | + |
| 108 | _\bo\b( |
| 109 | |
| 110 | _\by |
| 111 | 2 |
| 112 | __ |
| 113 | |\b |
| 114 | |\b |
| 115 | | |
| 116 | = 1. The r\bri\big\bgh\bht\bt clause |
| 117 | |
| 118 | is optional. Legal characters after l\ble\bef\bft\bt and r\bri\big\bgh\bht\bt are |
| 119 | braces, brackets, bars, c\bc and f\bf for ceiling and floor, and |
| 120 | "" for nothing at all (useful for a right-side-only |
| 121 | bracket). |
| 122 | |
| 123 | Vertical piles of things are made with p\bpi\bil\ble\be, l\blp\bpi\bil\ble\be, c\bcp\bpi\bil\ble\be, |
| 124 | |
| 125 | and r\brp\bpi\bil\ble\be: _\bp_\bi_\bl_\be {_\ba _\ba_\bb_\bo_\bv_\be _\bb _\ba_\bb_\bo_\bv_\be _\bc} produces |
| 126 | _\bc |
| 127 | _\bb |
| 128 | _\ba |
| 129 | |
| 130 | . There can |
| 131 | |
| 132 | be an arbitrary number of elements in a pile. l\blp\bpi\bil\ble\be left- |
| 133 | justifies, p\bpi\bil\ble\be and c\bcp\bpi\bil\ble\be center, with different vertical |
| 134 | spacing, and r\brp\bpi\bil\ble\be right justifies. |
| 135 | |
| 136 | Matrices are made with m\bma\bat\btr\bri\bix\bx: _\bm_\ba_\bt_\br_\bi_\bx { _\bl_\bc_\bo_\bl { _\bx _\bs_\bu_\bb _\bi _\ba_\bb_\bo_\bv_\be |
| 137 | |
| 138 | _\by _\bs_\bu_\bb _\b2 } _\bc_\bc_\bo_\bl { _\b1 _\ba_\bb_\bo_\bv_\be _\b2 } } produces |
| 139 | _\by2 |
| 140 | |
| 141 | _\bx_\bi |
| 142 | |
| 143 | |
| 144 | 2 |
| 145 | |
| 146 | 1 |
| 147 | |
| 148 | . In addition, |
| 149 | |
| 150 | there is r\brc\bco\bol\bl for a right-justified column. |
| 151 | |
| 152 | Diacritical marks are made with d\bdo\bot\bt, d\bdo\bot\btd\bdo\bot\bt, h\bha\bat\bt, t\bti\bil\bld\bde\be, |
| 153 | b\bba\bar\br, v\bve\bec\bc, d\bdy\bya\bad\bd, and u\bun\bnd\bde\ber\br: _\bx _\bd_\bo_\bt = _\bf(_\bt) _\bb_\ba_\br is _\bx\b.=_\bf(_\bt)\b\b\b\b~~~~, _\by |
| 154 | _\bd_\bo_\bt_\bd_\bo_\bt _\bb_\ba_\br ~=~ _\bn _\bu_\bn_\bd_\be_\br is _\by\b..\b\b~ = _\bn\b_, and _\bx _\bv_\be_\bc ~=~ _\by _\bd_\by_\ba_\bd is |
| 155 | _\bx\b->= _\by\b<-\b\b->\b. |
| 156 | |
| 157 | Sizes and font can be changed with s\bsi\biz\bze\be _\bn or s\bsi\biz\bze\be +\b+\b\b\b_\b__\bn, r\bro\bom\bma\ban\bn, |
| 158 | i\bit\bta\bal\bli\bic\bc, b\bbo\bol\bld\bd, and f\bfo\bon\bnt\bt _\bn. Size and fonts can be changed glo- |
| 159 | bally in a document by g\bgs\bsi\biz\bze\be _\bn and g\bgf\bfo\bon\bnt\bt _\bn, or by the |
| 160 | command-line arguments -\b-s\bs_\bn and -\b-f\bf_\bn. |
| 161 | |
| 162 | Normally subscripts and superscripts are reduced by 3 point |
| 163 | sizes from the previous size; this may be changed by the |
| 164 | command-line argument -\b-p\bp_\bn. |
| 165 | |
| 166 | Successive display arguments can be lined up. Place m\bma\bar\brk\bk |
| 167 | before the desired lineup point in the first equation; place |
| 168 | l\bli\bin\bne\beu\bup\bp at the place that is to line up vertically in subse- |
| 169 | quent equations. |
| 170 | |
| 171 | Shorthands may be defined or existing keywords redefined |
| 172 | with d\bde\bef\bfi\bin\bne\be: _\bd_\be_\bf_\bi_\bn_\be _\bt_\bh_\bi_\bn_\bg % _\br_\be_\bp_\bl_\ba_\bc_\be_\bm_\be_\bn_\bt % defines a new |
| 173 | token called _\bt_\bh_\bi_\bn_\bg which will be replaced by _\br_\be_\bp_\bl_\ba_\bc_\be_\bm_\be_\bn_\bt |
| 174 | |
| 175 | |
| 176 | |
| 177 | Printed 7/9/88 2 |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | EQN(1) UNIX Programmer's Manual EQN(1) |
| 185 | |
| 186 | |
| 187 | |
| 188 | whenever it appears thereafter. The % may be any character |
| 189 | that does not occur in _\br_\be_\bp_\bl_\ba_\bc_\be_\bm_\be_\bn_\bt. |
| 190 | |
| 191 | Keywords like _\bs_\bu_\bm (_\b>\b_\b~) _\bi_\bn_\bt () _\bi_\bn_\bf (oo) and shorthands like >= |
| 192 | (>\b_) -> (->), and != (=\b/) are recognized. Greek letters are |
| 193 | spelled out in the desired case, as in _\ba_\bl_\bp_\bh_\ba or _\bG_\bA_\bM_\bM_\bA. |
| 194 | Mathematical words like sin, cos, log are made Roman |
| 195 | automatically. _\bT_\br_\bo_\bf_\bf(1) four-character escapes like \(bs () |
| 196 | can be used anywhere. Strings enclosed in double quotes |
| 197 | "..." are passed through untouched; this permits keywords to |
| 198 | be entered as text, and can be used to communicate with |
| 199 | _\bt_\br_\bo_\bf_\bf when all else fails. |
| 200 | |
| 201 | S\bSE\bEE\bE A\bAL\bLS\bSO\bO |
| 202 | troff(1), tbl(1), ms(7), eqnchar(7) |
| 203 | B. W. Kernighan and L. L. Cherry, _\bT_\by_\bp_\be_\bs_\be_\bt_\bt_\bi_\bn_\bg _\bM_\ba_\bt_\bh_\be_\bm_\ba_\bt_\bi_\bc_\bs- |
| 204 | _\bU_\bs_\be_\br'_\bs _\bG_\bu_\bi_\bd_\be |
| 205 | J. F. Ossanna, _\bN_\bR_\bO_\bF_\bF/_\bT_\bR_\bO_\bF_\bF _\bU_\bs_\be_\br'_\bs _\bM_\ba_\bn_\bu_\ba_\bl |
| 206 | |
| 207 | B\bBU\bUG\bGS\bS |
| 208 | To embolden digits, parens, etc., it is necessary to quote |
| 209 | them, as in `bold "12.3"'. |
| 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 | |
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | Printed 7/9/88 3 |
| 244 | |
| 245 | |
| 246 | |