Eqn (software)
   HOME

TheInfoList



OR:

Part of the
troff troff (), short for "typesetter roff", is the major component of a document processing system developed by Bell Labs for the Unix operating system. troff and the related nroff were both developed from the original roff. While nroff was inten ...
suite of
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
document layout tools, eqn is a
preprocessor In computer science, a preprocessor (or precompiler) is a program that processes its input data to produce output that is used as input in another program. The output is said to be a preprocessed form of the input data, which is often used by so ...
that formats equations for printing. A similar program, neqn, accepted the same input as eqn, but produced output tuned to look better in
nroff nroff (short for "new roff") is a text-formatting program on Unix and Unix-like operating systems. It produces output suitable for simple fixed-width printers and terminal windows. It is an integral part of the Unix help system, being used to fo ...
. The eqn program was created in 1974 by
Brian Kernighan Brian Wilson Kernighan (; born 1942) is a Canadian computer scientist. He worked at Bell Labs and contributed to the development of Unix alongside Unix creators Ken Thompson and Dennis Ritchie. Kernighan's name became widely known through co-au ...
and
Lorinda Cherry Lorinda Cherry ( Landgraf; November 18, 1944 – February 2022) was an American computer scientist and programmer. Much of her career was spent at Bell Labs, where she was for many years a member of the original Unix Lab. Cherry developed severa ...
. It was implemented using
yacc Yacc (Yet Another Compiler-Compiler) is a computer program for the Unix operating system developed by Stephen C. Johnson. It is a Look Ahead Left-to-Right Rightmost Derivation (LALR) parser generator, generating a LALR parser (the part of a com ...
compiler-compiler. The input language used by eqn allows the user to write mathematical expressions in much the same way as they would be spoken aloud. The language is defined by a
context-free grammar In formal language theory, a context-free grammar (CFG) is a formal grammar whose production rules are of the form :A\ \to\ \alpha with A a ''single'' nonterminal symbol, and \alpha a string of terminals and/or nonterminals (\alpha can be empt ...
, together with
operator precedence In mathematics and computer programming, the order of operations (or operator precedence) is a collection of rules that reflect conventions about which procedures to perform first in order to evaluate a given mathematical expression. For exampl ...
and
operator associativity In programming language theory, the associativity of an operator is a property that determines how operators of the same precedence are grouped in the absence of parentheses. If an operand is both preceded and followed by operators (for example ...
rules. The eqn language is similar to the mathematical component of
TeX Tex may refer to: People and fictional characters * Tex (nickname), a list of people and fictional characters with the nickname * Joe Tex (1933–1982), stage name of American soul singer Joseph Arrington Jr. Entertainment * ''Tex'', the Italian ...
, which appeared several years later, but is simpler and less complete. An independent compatible implementation of the eqn preprocessor has been developed by
GNU GNU () is an extensive collection of free software (383 packages as of January 2022), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operat ...
as part of groff, the GNU version of troff. The GNU implementation extends the original language by adding a number of new keywords such as ''smallover'' and ''accent''.
mandoc mandoc (historically called mdocml) is a utility used for formatting man pages in BSD Operating Systems (e.g. NetBSD), specifically those written in the ''mdoc'' and ''man'' macro languages. Unlike the groff and older troff and nroff tools tha ...
, a specialised compiler for UNIX
man pages A man page (short for manual page) is a form of software documentation usually found on a Unix or Unix-like operating system. Topics covered include computer programs (including library and system calls), formal standards and conventions, and ev ...
, also contains a standalone eqn parser/formatter.


History

Eqn was done by using
yacc Yacc (Yet Another Compiler-Compiler) is a computer program for the Unix operating system developed by Stephen C. Johnson. It is a Look Ahead Left-to-Right Rightmost Derivation (LALR) parser generator, generating a LALR parser (the part of a com ...
parser generator.


Syntax examples

Here is how some examples would be written in eqn (with equivalents in TeX for comparison): Spaces are important in eqn; tokens are delimited only by
whitespace character In computer programming, whitespace is any character or series of characters that represent horizontal or vertical space in typography. When rendered, a whitespace character does not correspond to a visible mark, but typically does occupy an area ...
s, tildes ~, braces and double-quotes "". Thus f(pi r sup 2) results in f(pi r^, whereas f( pi r sup 2 ) is needed to give the intended f(\pi r^2).


References


Bibliography

*


External links


Typesetting Mathematics, User's Guide (Second Edition)
* * eqn Plan 9 commands {{Unix-stub