SIMPLE SOLUTIONS

# EQN(1) - Linux man page online | User commands

Format equations for troff or MathML.

Chapter
10 February 2018
EQN(1) General Commands Manual EQN(1)

## NAME

eqn - format equations for troff or MathML

## SYNOPSIS

eqn [-rvCNR] [-d xy] [-T name] [-M dir] [-f F] [-s n] [-p n] [-m n] [files...]

## DESCRIPTION

This manual page describes the GNU version of eqn, which is part of the groff document formatting system. eqn compiles descriptions of equations embedded within troff input files into commands that are understood by troff. Normally, it should be invoked using the -e option of groff. The syntax is quite compatible with Unix eqn. The output of GNU eqn cannot be processed with Unix troff; it must be processed with GNU troff. If no files are given on the command line, the standard input is read. A filename of - causes the standard input to be read. eqn searches for the file eqnrc in the directories given with the -M option first, then in /usr/lib/groff/site-tmac, /usr/share/groff/site-tmac, and finally in the standard macro directory /usr/share/groff/1.22.3/tmac. If it exists, eqn processes it before the other input files. The -R option prevents this. GNU eqn does not provide the functionality of neqn: it does not support low-resolution, typewriter-like devices (although it may work adequately for very simple input).

## OPTIONS

It is possible to have whitespace between a command line option and its parameter. -dxy Specify delimiters x and y for the left and right end, respectively, of in-line equations. Any delim statements in the source file overrides this. -C Recognize .EQ and .EN even when followed by a character other than space or new‐ line. Also, the statement ‘delim on’ is not handled specially. -N Don't allow newlines within delimiters. This option allows eqn to recover better from missing closing delimiters. -v Print the version number. -r Only one size reduction. -mn The minimum point-size is n. eqn does not reduce the size of subscripts or super‐ scripts to a smaller size than n. -Tname The output is for device name. Normally, the only effect of this is to define a macro name with a value of 1; eqnrc uses this to provide definitions appropriate for the output device. However, if the specified device is “MathML”, the output is MathML markup rather than troff commands, and eqnrc is not loaded at all. The default output device is ps. -Mdir Search dir for eqnrc before the default directories. -R Don't load eqnrc. -fF This is equivalent to a gfont F command. -sn This is equivalent to a gsize n command. This option is deprecated. eqn normally sets equations at whatever the current point size is when the equation is encoun‐ tered. -pn This says that subscripts and superscripts should be n points smaller than the sur‐ rounding text. This option is deprecated. Normally eqn sets subscripts and super‐ scripts at 70% of the size of the surrounding text.

## FILES

/usr/share/groff/1.22.3/tmac/eqnrc Initialization file.

## MATHML MODE LIMITATIONS

MathML is designed on the assumption that it cannot know the exact physical characteris‐ tics of the media and devices on which it will be rendered. It does not support fine con‐ trol of motions and sizes to the same degree troff does. Thus: * eqn parameters have no effect on the generated MathML. * The special, up, down, fwd, and back operations cannot be implemented, and yield a MathML ‘<merror>’ message instead. * The vcenter keyword is silently ignored, as centering on the math axis is the MathML default. * Characters that eqn over troff sets extra large – notably the integral sign – may appear too small and need to have their ‘<mstyle>’ wrappers adjusted by hand. As in its troff mode, eqn in MathML mode leaves the .EQ and .EN delimiters in place for displayed equations, but emits no explicit delimiters around inline equations. They can, however, be recognized as strings that begin with ‘$’ and end with ‘$’ and do not cross line boundaries. See the BUGS section for translation limits specific to eqn.

## BUGS

Inline equations are set at the point size that is current at the beginning of the input line. In MathML mode, the mark and lineup features don't work. These could, in theory, be implemented with ‘<maligngroup>’ elements. In MathML mode, each digit of a numeric literal gets a separate ‘<mn></mn>’ pair, and dec‐ imal points are tagged with ‘<mo></mo>’. This is allowed by the specification, but inef‐ ficient.