GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  EQN (7)

NAME

eqn - eqn language reference for mandoc

CONTENTS

Description
Equation Structure
Compatibility
See Also
History
Authors

DESCRIPTION

The eqn language is an equation-formatting language. It is used within mdoc(7) and man(7) Unix manual pages. It describes the structure of an equation, not its mathematical meaning. This manual describes the eqn language accepted by the mandoc(1) utility, which corresponds to the Second Edition eqn specification (see SEE ALSO for references).

Equations within mdoc(7) or man(7) documents are enclosed by the standalone '.EQ' and '.EN' tags. Equations are multi-line blocks consisting of formulas and control statements.

EQUATION STRUCTURE

Each 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-sensitive 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
        | 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. If within a quoted string, these space characters are retained. Quoted strings are also not scanned for replacement definitions.

The following text terms are translated into a rendered glyph, if available: 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, UPSILON, XI, inter (intersection), union (union), prod (product), int (integral), sum (summation), grad (gradient), del (vector differential), times (multiply), cdot (centre-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 following control statements are available:
define
  Replace all occurrences of a key with a value. Its syntax is as follows:

The first character of the value string, c, is used as the delimiter for the value val. This allows for arbitrary enclosure of terms (not just quotes), such as

It is an error to have an empty key or val. Note that a quoted key causes errors in some eqn implementations and should not be considered portable. It is not expanded for replacements. Definitions may refer to other definitions; these are evaluated recursively when text replacement occurs and not when the definition is created.

Definitions can create arbitrary strings, for example, the following is a legal construction.

define foo ’define’
foo bar ’baz’

Self-referencing definitions will raise an error. The ndefine statement is a synonym for define, while tdefine is discarded.

gfont Set the default font of subsequent output. Its syntax is as follows:

In mandoc, this value is discarded.

gsize Set the default size of subsequent output. Its syntax is as follows:

The size value should be an integer.

set Set an equation mode. In mandoc, both arguments are thrown away. Its syntax is as follows:

The key and val are not expanded for replacements. This statement is a GNU extension.

undef Unset a previously-defined key. Its syntax is as follows:

Once invoked, the definition for key is discarded. The key is not expanded for replacements. This statement is a GNU extension.

COMPATIBILITY

This section documents the compatibility of mandoc eqn and the troff eqn implementation (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 of eqn allows for equation alignment with the mark and lineup tokens. mandoc discards these tokens. The back n, fwd n, up n, and down n commands are also ignored.

SEE ALSO

mandoc(1), man(7), mandoc_char(7), mdoc(7), roff(7)
.Rs System for Typesetting Mathematics
.Re
.Rs Typesetting Mathematics, User’s Guide
.Re
.Rs Typesetting Mathematics, User’s Guide (Second Edition)
.Re

HISTORY

The eqn utility, a preprocessor for troff, was originally written by Brian W. Kernighan and Lorinda L. Cherry in 1975. The GNU reimplementation 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.

AUTHORS

This eqn reference was written by
.An Kristaps Dzonsons ,
.Mt kristaps@bsd.lv .
Search for    or go to Top of page |  Section 7 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.