eqn - Linux


eqn is a powerful text processing tool designed to format mathematical equations for typesetting. It converts mathematical expressions written in a simplified syntax into typeset equations suitable for inclusion in LaTeX documents or other scientific publications.


eqn [options] [file...]


  • -d, –debug: Print debugging information.
  • -e, –error-stop: Stop processing on the first error encountered.
  • -f, –format=FORMAT: Specify output format (default: latex).
  • -h, –help: Display help and usage information.
  • -l, –line-length=LENGTH: Set maximum line length for output (default: 79).
  • -m, –macro=NAME: Define a macro.
  • -p, –preprocessor=PREPROCESSOR: Specify preprocessor to use (default: tex).
  • -q, –quiet: Suppress diagnostic output.
  • -v, –version: Display version information.


Simple equation:

eqn x^2 - y^2

Complex equation with macros:

macro d(f,x)  diff(f,x)
macro t(x)    theta(x)

d(t(x),x) + t(x) = 0

Common Issues

  • Syntax errors: eqn is sensitive to syntax errors. Ensure proper equation formatting and balanced parentheses.
  • Unsupported symbols: eqn may not recognize certain special symbols or mathematical functions. Use macros or escape sequences to define them.
  • Long equations: eqn imposes a line length limit. Use line breaks or explicit continuation characters to handle long equations.


eqn can be used in conjunction with other tools for advanced tasks:

  • LaTeX: Use eqn to generate math expressions for inclusion in LaTeX documents.
  • ASCII art: Convert equations to ASCII art for display in text-based environments.
  • Image generation: Export equations as graphical images for presentations or documentation.

Related Commands

  • tex: LaTeX typesetting system
  • latex: Command-line interface to LaTeX
  • asy: Asymptote vector graphics language for scientific diagrams