#!/bin/sh # MFOUR="m4 -B 8192" MFOUR="m4" (cat << 'END' undefine(`eval') undefine(`index') undefine(`format') undefine(`include') undefine(`substr') undefine(`paste') define(KEYWORD,`') define(COMMENT,`') define(TITLE,`
$1') define(ALIAS,`dnl') define(BEGIN_ARGUMENTS,`
$1
$1
$1
')dnl
define(ITALIC,`$1')dnl
define(BOLD,`$1')dnl
define(PARA,`')dnl define(LDOTS,`...') define(EQUALS,`=') define(LT,``<'') define(GT,``>'') define(LE,``<='') define(GE,``>='') define(OVER,`$1 / $2') define(SUP,`{$1}^{$2}^') define(SUB,`{{$1}_{$2}_}') define(CHOOSE,`{\left(\begin{array}{c} $1 \\ $2 \end{array} \right)}') define(PAREN,`{\left( $1 \right)}') define(SP,`') define(greekAlpha,`Α') define(greekGamma,`Γ') define(greekalpha,`α') define(greekpi,`π') define(greekmu,`μ') define(greeksigma,`σ') define(greeklambda,`λ') define(boldgreekbeta,`\bold{β}') define(boldgreekepsilon,`\bold{ε}') define(LOG,`\log') define(SQRT,`\sqrt{$1}') define(EQBOLD,`\bold{$1}') define(EQN,`$1') define(DEQN,`
$2
$1
') END # Fix up the input to protect things that m4 is sensitive about. sed ' /^ALIAS/,/^EXAMPLES/s/^ *// /^ARGUMENTS/,/^EXAMPLES/s/^ *// /^DESCRIPTION/,/^EXAMPLES/s/^ *// s/unix/M4_unix/g s/#/M4_HASH/g s/\\(/M4_LP/g s/\\(/M4_LP/g s/\\)/M4_RP/g s/`/M4_LQ/g s/'\''/M4_RQ/g s/,/M4_COMMA/g s/ @@ /,/g s/@@/,/g s/ifelse/M4_IFELSE/g ' $*) | $MFOUR |sed ' /^$/d s/^BLANK$// s/DOTS/\.\.\./g s/M4_unix/unix/g s/M4_HASH/#/g s/M4_LP/(/g s/M4_RP/)/g s/M4_LQ/`/g s/M4_RQ/'\''/g s/M4_COMMA/,/g s/M4_IFELSE/ifelse/g ' echo ''