eqn(1)
eqn(1) โ General Commands Manual ๐ธ
Okay bestie, welcome to the eqn man page. This is part 1, and it's literally the math-typesetting baddie of the groff world. No cap, she's iconic. Let's go. ๐
โจ NAME โจ
eqn - format mathematics (equations) for groff or MathML. That's the whole serve: equations in, gorgeous math out. ๐
๐ธ SYNOPSIS ๐ธ
Bestie, here's the call signature, exactly as written (do not come for me about the hyphen break, it's in the source):
eqn [-CNrR] [-d xy] [-f global-italic-font] [-m minimum-type-size]
[-M eqnrc-directory] [-p super/subscript-size-reduction] [-s global-
type-size] [-T device] [file ...]
eqn --help
eqn -v
eqn --version
๐ DESCRIPTION ๐
The GNU implementation of eqn is part of the groff(7) document formatting system. Okay so eqn is a troff(1) preprocessor that translates expressions in its own languageโembedded in roff(7) inputโinto mathematical notation typeset by troff(1). It copies each file's contents to the standard output stream, translating each equation between lines starting with .EQ and .EN, or within a pair of user-specified delimiters. Normally, eqn is not executed directly by the user, but invoked by specifying the -e option to groff(1). While GNU eqn's input syntax is highly compatible with AT&T eqn, the output eqn produces cannot be processed by AT&T troff; GNU troff (or a troff implementing relevant GNU extensions) must be used. If no file operands are present, or if file is โ-โ, eqn reads the standard input stream. Periodt.
Unless the -R option is used, eqn searches for the file eqnrc in the directories given with the -M option first, then in /usr/share/groff/site-tmac, and finally in the standard macro directory /usr/share/groff/1.24.1/tmac. If it exists and is readable, eqn processes it before any input. The way that search order matters? iykyk. ๐
This man page primarily discusses the differences between GNU eqn and AT&T eqn. Most of the new features of the GNU eqn input language are based on TeX. There are some references to the differences between TeX and GNU eqn below; these may safely be ignored if you do not know TeX. Four points are worth note. Vibe check:
- GNU
eqnemits Presentation MathML output when invoked with the โ-T MathMLโ option. - GNU
eqndoes not support terminal devices well, though it may suffice for simple inputs. - GNU
eqnsets the input token โ...โ as an ellipsis on the text baseline, not the three centered dots of AT&Teqn. Set an ellipsis on the math axis with the GNU extension macrocdots. - GNU
eqn'sdelimprimitive does not treat an โonโ argument as a pair of equation delimiters.
๐งฎ Anatomy of an equation ๐งฎ
eqn input consists of tokens. Consider a form of Newton's second law of motion for constant mass. The input
.EQ
F =
m a
.EN
becomes F=ma. Each of F, =, m, and a is a token. Spaces and newlines are interchangeable; they separate tokens but do not break lines or produce space in the output. Lowkey elegant.
Beyond their primary functions, the following input characters separate tokens as well.
{ }โ Braces perform grouping. Whereas โe sup a bโ expresses โ(e to the a) times bโ, โe sup { a b }โ means โe to the (a times b)โ. When immediately preceded by a โleftโ or โrightโ primitive, a brace loses its special meaning.^ ~โ are the half space and full space, respectively. Use them to tune the appearance of the output.
Tab and leader characters separate tokens as well as advancing the drawing position to the next tab stop, but are seldom used in eqn input. When they occur, they must appear at the outermost lexical scope. This roughly means that they can't appear within braces that are necessary to disambiguate the input; eqn will diagnose an error in this event. (See subsection โMacrosโ below for additional token separation rules.) Not me warning you about lexical scope, but here we are. ๐
Other tokens are primitives, macros, an argument to either of the foregoing, or components of an equation.
Primitives are fundamental keywords of the eqn language. They can configure an aspect of the preprocessor's state, as when setting a โglobalโ font selection or type size (gifont and gsize), or declaring or deleting macros (โdefineโ and undef); these are termed commands. Other primitives perform formatting operations on the tokens around them (as with fat, over, sqrt, or up).
Equation components include mathematical variables, constants, numeric literals, and operators. eqn remaps some input character sequences to groff special character escape sequences for economy in equation entry and to ensure that glyphs from an unstyled font are used; see groff_char(7). Here's the remap tea:
+ \[pl] ' \[fm]
- \[mi] <= \[<=]
= \[eq] >= \[>=]
Macros permit primitives, components, and other macros to be collected and used together as a single token. Predefined macros make convenient the preparation of eqn input in a form resembling its spoken expression; for example, consider cos, hat, inf, and lim. Slay.
๐ Spacing and typeface ๐
GNU eqn imputes a type to each equation component, adjusting the space around it accordingly. Recognized types follow; most affect spacing only, whereas the โletterโ subtype of โordinaryโ also assigns a style. The type list is giving typography main character energy:
ordinaryโ character such as โ1โ, โaโ, or โ!โletterโ character to be italicized by defaultdigitโ n/a
operatorโ large operator such as โฮฃโbinaryโ binary operator such as โ+โrelationโ relational operator such as โ=โopeningโ opening bracket such as โ(โclosingโ closing bracket such as โ)โpunctuationโ punctuation character such as โ,โinnerโ sub-formula contained within bracketssuppressโ component to which automatic spacing is not applied
Two primitives apply types to equation components.
type t eโ Apply type t to expression e.chartype t textโ Assign each character in (unquoted) text type t, persistently.
eqn sets up spacings and styles as if by the following commands. This is the factory setting, bestie:
chartype "letter" abcdefghiklmnopqrstuvwxyz
chartype "letter" ABCDEFGHIKLMNOPQRSTUVWXYZ
chartype "letter" \[*a]\[*b]\[*g]\[*d]\[*e]\[*z]
chartype "letter" \[*y]\[*h]\[*i]\[*k]\[*l]\[*m]
chartype "letter" \[*n]\[*c]\[*o]\[*p]\[*r]\[*s]
chartype "letter" \[*t]\[*u]\[*f]\[*x]\[*q]\[*w]
chartype "binary" *\[pl]\[mi]
chartype "relation" <>\[eq]\[<=]\[>=]
chartype "opening" {([
chartype "closing" })]
chartype "punctuation" ,;:.
chartype "suppress" ^~
eqn assigns all other ordinary and special roff characters, including numerals 0โ9, the โordinaryโ type. (The โdigitโ type is not used, but is available for customization.) In keeping with common practice in mathematical typesetting, lowercase, but not uppercase, Greek letters are assigned the โletterโ type to style them in italics. The macros for producing ellipses, โ...โ, cdots, and ldots, use the โinnerโ type.
๐ฆ Primitives ๐ฆ
eqn supports without alteration the AT&T eqn primitives above, back, bar, bold, define, down, fat, font, from, fwd, gfont, gsize, italic, left, lineup, mark, matrix, ndefine, over, right, roman, size, sqrt, sub, sup, tdefine, to, under, and up. Not a single one skipped, periodt.
โจ New primitives โจ
We describe the GNU extension primitives โtypeโ and chartype in subsection โSpacing and typefaceโ above; โsetโ and โresetโ in subsection โCustomizationโ below; and gbfont, gifont, and grfont in subsection โFontsโ below. In the following synopses, X can be any character not appearing in the parameter thus bracketed.
e1 accent e2โ Set e2 as an accent over e1.eqnassumes that e2 is at the appropriate height for a lowercase letter without an ascender, and shifts it vertically based on e1's height. For example,eqndefineshatas follows:accent { roman "^" }.dotdot,dot,tilde,vec, anddyadare also defined using theaccentprimitive.big eโ Enlarge the expression e; semantics like those of CSS โlargeโ are intended. Introffoutput, the type size is increased by 5 scaled points. MathML output emits the following:<mstyle mathsize='big'>.copy file,include fileโ Interpolate the contents of file, omitting lines beginning with.EQor.EN. file is sought relative to the current working directory.ifdef name X anything Xโ If name is defined as a primitive or macro, interpret anything.nosplit textโ As "text", but since text is not quoted it is subject to macro expansion; it is not split up and the spacing between characters not adjusted per subsection โSpacing and typefaceโ above.e opprimeโ Asprime, but set the prime symbol as an operator on e. In the input โA opprime sub 1โ, the โ1โ is tucked under the prime as a subscript to the โAโ (as is conventional in mathematical typesetting), whereas whenprimeis used, the โ1โ is a subscript to the prime character. The precedence ofopprimeis the same as that ofbarand โunderโ, and higher than that of other primitives exceptaccentanduaccent. In unquoted text, a neutral apostrophe (') that is not the first character on the input line is treated likeopprime.sdefine name X anything Xโ As โdefineโ, but name is not recognized as a macro if called with arguments.e1 smallover e2โ Asover, but reduce the type size of e1 and e2, and put less vertical space between e1 and e2 and the fraction bar. Theoverprimitive corresponds to the TeX\overprimitive in displayed equation styles;smallovercorresponds to\overin non-display (โinlineโ) styles.space nโ Set extra vertical spacing around the equation, replacing the default values, where n is an integer in hundredths of an em. If positive, n increases vertical spacing before the equation; if negative, it does so after the equation. This primitive provides an interface togroff's\xescape sequence, but with the opposite sign convention. It has no effect if the equation is part of apic(1)picture.special troff-macro eโ okay so this one is the plot twist ๐ โ it builds you a whole object by calling troff-macro one. Inside that macro, the troff string0sholds the eqn output fore, and the registers0w,0h,0d,0skern, and0skewcarry the width, height, depth, subscript kern, and skew ofe, respectively. (Quick glossary bestie: the subscript kern of an object tells you how much a subscript on that object should be "tucked in" โ like, nudged to the left relative to a non-subscripted glyph of the same size. And the skew of an object is how far to the right of the object's center an accent over it should land. ๐)
Your macro has to do three things, no skipping: modify 0s so it outputs the result you actually want, return the drawing position to the text baseline at the beginning of e, and update all those registers we just mentioned to match the new dimensions of the result. That's the assignment, periodt.
Say you want a construct that "cancels" an expression by drawing a diagonal line through it. Iconic. Behold:
.de Ca
. ds 0s \
\Z'\\*(0s'\
\v'\\n(0du'\
\D'l \\n(0wu -\\n(0hu-\\n(0du'\
\v'\\n(0hu'
..
.EQ
special Ca "x \[mi] 3 \[pl] x" ~ 3
.EN
Not me using the \[mi] and \[pl] special characters instead of + and - ๐ญ โ because they're part of the argument to a troff macro, so eqn does not transform them into mathematical glyphs for us. That's the whole reason, fr fr.
Okay and here's a more complicated construct that draws a box around an expression โ the bottom of the box rests on the text baseline. We define the eqn macro box to wrap the call of the troff macro Bx:
.de Bx
.ds 0s \
\Z'\\h'1n'\\*[0s]'\
\v'\\n(0du+1n'\
\D'l \\n(0wu+2n 0'\
\D'l 0 -\\n(0hu-\\n(0du-2n'\
\D'l -\\n(0wu-2n 0'\
\D'l 0 \\n(0hu+\\n(0du+2n'\
\h'\\n(0wu+2n'
.nr 0w +2n
.nr 0d +1n
.nr 0h +1n
..
.EQ
define box ' special Bx $1 '
box(foo) ~ "bar"
.EN
split "text"โ does the same thing astext, but since text is quoted it does not get subjected to macro expansion. It's split up and the spacing between characters gets adjusted per the subsection "Spacing and typeface" up above. ๐e1 uaccent e2โ setse2as an accent undere1. The vibe here:e2is assumed to be at the appropriate height for a letter with no descender, and eqn vertically shifts it depending on whethere1actually has a descender. Also,utildeis predefined usinguaccentas a tilde accent sitting below the baseline. Cute. ๐undef nameโ yeets the definition of macro or primitive name, leaving it undefined. That's it, that's the whole job.vcenter eโ vertically centerseabout the math axis, which is that horizontal line that fraction bars and characters like "+" and "โ" line up on. MathML already behaves this way, so eqn just ignores this primitive when it's producing that output format. And the built-insummacro? It's defined as if by the following:
define sum ! { type "operator" vcenter size +5 \(*S } !
โจ Extended primitives โจ
GNU eqn extends the syntax of some AT&T eqn primitives, which introduces one deliberate incompatibility. Not a bug, bestie, it's a choice. ๐
delim onโ GNU eqn treats an "on" argument to thedelimprimitive specially: it restores any delimiters that were previously disabled with "delim off". If delimiters haven't been specified at all, neither command does anything. Few eqn documents are expected to use "o" and "n" as left and right delimiters respectively โ but if yours does, swap them, or pick different ones. ๐col n { ... },ccol n { ... },lcol n { ... },rcol n { ... },pile n { ... },cpile n { ... },lpile n { ... },rpile n { ... }โ the integer valuen, measured in hundredths of an em, uses the formatter's\xescape sequence to bump up the vertical spacing between rows; eqn ignores it when producing MathML. Negative values are accepted but have no effect. And if more than onenshows up in a matrix or a pile, the largest one wins. Periodt.
๐ Customization ๐
When eqn generates troff input, the appearance of your equations is controlled by a whole big pile of parameters. They have no effect when generating MathML, because that path delegates typesetting to a MathML rendering engine. You configure these parameters with the set and reset primitives. ๐ธ
set p nโ assigns parameterpthe integer valuen;nis interpreted in units of hundredths of an em unless otherwise stated. Example time:
set x_height 45
That says eqn should assume the font's x-height is 0.45 ems. Easy.
reset pโ restores the default value of parameterp. The undo button, basically. ๐ซถ
Available parameters p are as follows; defaults are shown in parentheses. We intend these descriptions to be expository rather than rigorous โ iykyk, don't come for us about the math. ๐ง
minimum_sizeโ sets a floor for the type size (in scaled points) at which equations are set (5).fat_offsetโ thefatprimitive emboldens an equation by overprinting two copies of the equation horizontally offset by this amount (4). When producing MathML output, components to whichfat_offsetapplies instead use the following.
<mstyle mathvariant='double-struck'>
over_hangโ a fraction bar is longer by twice this amount than the maximum of the widths of the numerator and denominator; in other words, it overhangs the numerator and denominator by at least this amount (0).accent_widthโ whenbarorunderis applied to a single character, the line is this long (31). Normally,barorunderproduces a line whose length is the width of the object it applies to โ but in the case of a single character, that tends to produce a line that looks way too long. So we have this knob instead.delimiter_factorโ extensible delimiters produced with theleftandrightprimitives have a combined height and depth of at least this many thousandths of twice the maximum amount by which the sub-equation that the delimiters enclose extends away from the axis (900).delimiter_shortfallโ extensible delimiters produced with theleftandrightprimitives have a combined height and depth not less than the difference of twice the maximum amount by which the sub-equation that the delimiters enclose extends away from the axis and this amount (50).null_delimiter_spaceโ this much horizontal space is inserted on each side of a fraction (12).script_spaceโ the width of subscripts and superscripts is increased by this amount (5).thin_spaceโ this amount of space is automatically inserted after punctuation characters (17).medium_spaceโ this amount of space is automatically inserted on either side of binary operators (22).thick_spaceโ this amount of space is automatically inserted on either side of relations (28).half_spaceโ configures the width of the space produced by the^token (17).full_spaceโ configures the width of the space produced by the~token (28).x_heightโ the height of lowercase letters without ascenders, such as "x" (45).axis_heightโ the height above the baseline of the center of characters such as "+" and "โ" (26). It is important that this value is correct for the font you are using. Like, actually important. ๐default_rule_thicknessโ this should be set to the thickness of the\[ru]character, or the thickness of horizontal lines produced with the\Descape sequence (4).num1โ theoverprimitive shifts up the numerator by at least this amount (70).num2โ thesmalloverprimitive shifts up the numerator by at least this amount (36).denom1โ theoverprimitive shifts down the denominator by at least this amount (70).denom2โ thesmalloverprimitive shifts down the denominator by at least this amount (36).sup1โ normally superscripts are shifted up by at least this amount (42).sup2โ superscripts within superscripts or upper limits or numerators ofsmalloverfractions are shifted up by at least this amount (37). Conventionally, this is less thansup1.sup3โ superscripts within denominators or square roots or subscripts or lower limits are shifted up by at least this amount (28). Conventionally, this is less thansup2.sub1โ subscripts are normally shifted down by at least this amount (20).sub2โ when there is both a subscript and a superscript, the subscript is shifted down by at least this amount (23).sup_dropโ the baseline of a superscript is no more than this much below the top of the object on which the superscript is set (38).sub_dropโ the baseline of a subscript is at least this much below the bottom of the object on which the subscript is set (5).big_op_spacing1โ the baseline of an upper limit is at least this much above the top of the object on which the limit is set (11).big_op_spacing2โ the baseline of a lower limit sits at least this far below the bottom of the object that limit is attached to (17).big_op_spacing3โ the bottom of an upper limit sits at least this far above the top of the object that limit is attached to (20).big_op_spacing4โ the top of a lower limit sits at least this far below the bottom of the object that limit is attached to (60).big_op_spacing5โ this much vertical space gets added above and below limits (10).baseline_sepโ the baselines of the rows in a pile or matrix are normally this far apart (140). Usually it equals the sum ofnum1anddenom1.shift_downโ the midpoint between the top baseline and the bottom baseline in a matrix or pile gets shifted down by this much from the axis (26). Usually it equalsaxis_height.column_sepโ this much space gets added between columns in a matrix (100).matrix_side_sepโ this much space gets added on each side of a matrix (17).draw_linesโ if this is non-zero, eqn draws lines using the troff\Descape sequence instead of the\lescape sequence and the\[ru]special character. Theeqnrcfile sets the default: 1 on ps, html, and the X11 devices, otherwise 0.body_heightโ the presumed height of an equation above the text baseline; eqn adds any excess as extra pre-vertical line spacing using troff's\xescape sequence (85).body_depthโ the presumed depth of an equation below the text baseline; eqn adds any excess as extra post-vertical line spacing using troff's\xescape sequence (35).nroffโ if this is non-zero, thenndefinebehaves likedefineandtdefinegets ignored; otherwisetdefinebehaves likedefineandndefinegets ignored. Theeqnrcfile sets the default: 1 on ascii, latin1, and utf8 devices, otherwise 0.
Macros ๐
okay bestie, listen โ in GNU eqn, macros can take arguments. Here's the tea: a word defined by any of the define, ndefine, or tdefine primitives and then immediately followed by a left parenthesis counts as a parameterized macro call. Everything after that, up to a matching right parenthesis, gets treated as comma-separated arguments. And in this one context only, commas and parentheses also work as token separators. A macro argument is not terminated by a comma that sits inside parentheses nested within it. In a macro definition, $n, where n is between 1 and 9 inclusive, is replaced by the nth argument โ and if there are fewer than n arguments, it gets replaced by nothing. poof. gone. ๐จ
Predefined macros ๐
GNU eqn has your back with the predefined macros that AT&T eqn offers: and, approx, arc, cos, cosh, del, det, dot, dotdot, dyad, exp, for, grad, half, hat, if, inter, Im, inf, int, lim, ln, log, max, min, nothing, partial, prime, prod, Re, sin, sinh, sum, tan, tanh, tilde, times, union, vec, ==, !=, +=, ->, <-, <<, >>, and ....
The lowercase classical Greek letters are all here too: alpha, beta, chi, delta, epsilon, eta, gamma, iota, kappa, lambda, mu, nu, omega, omicron, phi, pi, psi, rho, sigma, tau, theta, upsilon, xi, and zeta. For the uppercase forms, spell them with an initial capital letter (Alpha) or go full capitals (ALPHA). the range, the serve, everything. ๐
GNU eqn also goes above and beyond with cdot, cdots, and utilde (all discussed above ๐
), plus dollar, which sets a dollar sign, and ldots, which sets an ellipsis on the text baseline.
Fonts โจ
eqn uses up to three typefaces to set an equation: italic (oblique), roman (upright), and bold (heavy). Give each one a groff typeface using the GNU extension primitives grfont, gifont, and gbfont. The defaults are the styles R, I, and B (applied to the current font family). The chartype primitive (peep it above) sets a character's type, and that type decides which face sets it. The โletterโ type is set in italics; everything else is set in roman. And use the bold primitive to select an (upright) bold style.
gbfontf โ Select f as the bold font.gifontf โ Select f as the italic font. GNU eqn recognizesgfontas a synonym for AT&T compatibility.grfontf โ Select f as the roman font.
roff interface ๐ฆ
The string 10 stores the most recently formatted equation. The register MK stores the horizontal drawing position of the most recently assigned mark. Avoid using these names for any other purpose, okay? they're taken. ๐
GNU eqn internally employs register, string, macro, and diversion names beginning with the numeral 0. (AT&T eqn used identifiers starting with the numeral 1.) So a document that's getting preprocessed with GNU eqn should not use any such identifiers. no cap.
โจ OPTIONS โจ
--help displays a usage message, while -v and --version show version information; all of them exit afterward. short and sweet. ๐
-Cโ Recognize.EQand.ENeven when followed by a character other than space or newline.-dxy โ Specify delimiters x for the left end and y for the right end of equations that aren't bracketed by.EQ/.EN. x and y don't have to be distinct. Anydelim xystatements in the source file override this option.-fF โ is equivalent togifont F.-mn โ is equivalent toset minimum_size n.-Mdir โ Search dir foreqnrcbefore those listed in section โDescriptionโ above.-Nโ Prohibit newlines within delimiters, which lets eqn recover better from missing closing delimiters.-pn โ Set sub- and superscripts n points smaller than the surrounding text. This option is deprecated. eqn normally sets sub- and superscripts at 70% of the type size of the surrounding text.-rโ Reduce the type size of super- and subscripts at most once relative to the base type size.-Rโ Don't loadeqnrc.-sn โ is equivalent togsize n. This option is deprecated.-Tdev โ Prepare output for the device dev. This option defines a macro dev with the value1;eqnrcthereby provides definitions appropriate to the device. However, if dev isMathML, eqn produces output in that language rather than roff, and does not loadeqnrc. The default device isps.
๐ EXIT STATUS ๐
eqn exits with status 0 on successful operation, status 2 if the program can't interpret its command-line arguments, and status 1 if it encounters an error during operation. that's it, that's the whole vibe check.
๐ธ FILES ๐ธ
/usr/share/groff/1.24.1/tmac/eqnrcโ initializes the preprocessor for troff output. Any valid eqn input is accepted.
๐ MATHML OUTPUT LIMITATIONS ๐
MathML's design assumes that it can't know the exact physical characteristics of the media and devices it'll be rendered on. It does not support control of motions and sizes to the same degree troff does. it's giving limited. ๐ญ
- GNU eqn's rendering parameters (see section โCustomizationโ above) have no effect on generated MathML.
- The
special,up,down,fwd, andbackprimitives cannot be implemented, and yield a MathML<merror>message instead. - The
vcenterprimitive is silently ignored, since centering on the math axis is the MathML default. - Characters that eqn sets extra large in troff output โ notably the integral sign โ may appear too small and need to have their
<mstyle>wrappers adjusted by hand.
Just like when producing troff output, eqn generates MathML that leaves the .EQ and .EN tokens in place, but emits nothing corresponding to delim delimiters. They can, however, be recognized as character sequences that begin with <math>, end with </math>, and do not cross line boundaries. handy. ๐ฅ
๐ CAVEATS ๐
Tokens must be double-quoted in eqn input if they are not to be recognized as names of macros or primitives, or if they're meant to be interpreted by troff. Especially the short ones, like pi and PI, which can collide with troff identifiers. For instance, the eqn command gifont PI does not select the gropdf(1) or grops(1) device's Palatino italic font as the global italic face; you have to use gifont "PI" instead. the quotes are not optional, bestie.
Delimited equations are set at the type size current at the beginning of the input line โ not necessarily the one immediately preceding the opening delimiter. sneaky. ๐ซถ
Unlike TeX, eqn does not inherently distinguish displayed and inline equation styles; see the smallover primitive above. However, macro packages frequently define EQ and EN macros such that the equation within is displayed. These macros may accept arguments permitting the equation to be labeled or captioned; check the package's documentation.
โญ BUGS โญ
eqn abuses terminology โ its โequationsโ can be inequalities, bare expressions, or unintelligible gibberish. But there's no changing it now. iconic behavior honestly. ๐
When producing terminal output, GNU eqn renders lowercase Greek letters in roman instead of italic style.
When producing MathML output, the mark and lineup features don't work. These could, in theory, be implemented with <maligngroup> elements.
When producing MathML output, each digit of a numeric literal gets a separate <mn></mn> pair, and decimal points are tagged with <mo> </mo>. This is allowed by the specification, but inefficient.
โจ Examples โจ
Okay bestie, let's actually see her in action. First up: a trigonometric identity, the classic little queen ๐
.EQ
sin ( alpha + beta ) = sin alpha cos beta + cos alpha sin beta
.EN
Serving math realness, no cap.
Sometimes your math lives inside your sentences (iykyk, the running-text girlies), and setting up delimiters makes that way nicer. Witness:
.EQ
delim $$
.EN
Having cached a table of logarithms,
the property $ln ( x y ) = ln x + ln y$ sped calculations.
See how the $$ delimiting just โจenablesโจ inline math mid-paragraph? Obsessed.
Now the quadratic formula, because why not โ this one's the main character, and she uses fractions, radicals, and the full space token ~:
.EQ
x = { - b ~ \[+-] ~ sqrt { b sup 2 - 4 a c } } over { 2 a }
.EN
Literally iconic. ๐
OR โ plot twist โ we could go define the plus-minus sign as a binary operator instead. Now listen, here's the tea: automatic spacing puts 0.06 em less space on either side of the plus-minus than ~ does. Why? Because that's the difference between the widths of the medium_space parameter (the one binary operators use) and the width of the full space. Not me knowing this โจ
And independently of all that, we can define a macro frac for setting fractions, because we contain multitudes:
.EQ
chartype "binary" \[+-]
define frac ! { $1 } over { $2 } !
x = frac(- b \[+-] sqrt { b sup 2 - 4 a c }, 2 a)
.EN
Look at her go ๐ฆ
๐ See also ๐
Go read more, bestie, these are the sources:
- โTypesetting MathematicsโUser's Guideโ (2nd edition), by Brian W. Kernighan and Lorinda L. Cherry, 1978, AT&T Bell Laboratories Computing Science Technical Report No. 17.
- The TeXbook, by Donald E. Knuth, 1984, Addison-Wesley Professional. Appendix G discusses many of the parameters from the section โCustomizationโ above in greater detail. ๐
groff_char(7)documents a variety of special character escape sequences useful in mathematical typesetting. See subsections โLogical symbolsโ, โMathematical symbolsโ, and โGreek glyphsโ in particular. ๐groff(1),troff(1),pic(1),groff_font(5)
And that's a wrap on eqn(1), my love ๐ This whole page is from groff 1.24.1, dated 2026-04-22 โ so if you're citing her, cite her right, periodt. Now go typeset something gorgeous. You got this. ๐ซถโจ
๐ฆ where this page comes from
- ubuntu stonking: groff-base 1.24.1-1
- Copyright 1989-2014 Free Software Foundation, Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms