eqn (software)
This article includes a list of references, related reading or external links, but its sources remain unclear because it lacks inline citations. (September 2018) (Learn how and when to remove this template message) 
This article needs additional citations for verification. (September 2018) (Learn how and when to remove this template message) 
Part of the troff suite of Unix document layout tools, eqn is a preprocessor that formats equations for printing. A similar program, neqn, accepted the same input as eqn, but produced output tuned to look better in nroff. The eqn program was created in 1974 by Brian Kernighan and Lorinda Cherry. It was implemented using yacc compilercompiler.^{[1]}
Original author(s)  Brian Kernighan, Lorinda Cherry 

Developer(s)  AT&T Bell Laboratories 
Initial release  June 1974 
Operating system  Unix, Unixlike 
Type  Command 
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 contextfree grammar, together with operator precedence and operator associativity rules. The eqn language is similar to the mathematical component of TeX, which appeared several years later, but is simpler and less complete.
An independent compatible implementation of the eqn preprocessor has been developed by GNU 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, a specialised compiler for UNIX man pages, also contains a standalone eqn parser/formatter.
Syntax examplesEdit
Here is how some examples^{[citation needed]} would be written in eqn (with equivalents in TeX for comparison):
TeX  eqn  formula 

a^2

a sup 2


\sum_{k=1}^N k^2

sum from { k = 1 } to N { k sup 2 }


x = {b \pm \sqrt{b^2  4ac} \over 2a}

x={b + sqrt{b sup 2  4ac}} over 2a

Spaces are important in eqn; tokens are delimited only by whitespace characters, tildes ~, braces {} and doublequotes "". Thus f(pi r sup 2)
results in , whereas f( pi r sup 2 )
is needed to give the intended .
ReferencesEdit
 ^ "UNIX Special: Profs Kernighan & Brailsford". Computerphile. September 30, 2015.
BibliographyEdit
 Kernighan, Brian W.; Cherry, Lorinda L. (1975). "A System for Typesetting Mathematics". Communications of the ACM. 18 (3): 151–157. doi:10.1145/360680.360684.
External linksEdit
 Typesetting Mathematics, User's Guide (Second Edition)
 UNIX man page for neqn(1) at the Wayback Machine (archived August 8, 2007)
This Unixrelated article is a stub. You can help Wikipedia by expanding it. 