summaryrefslogtreecommitdiff
path: root/macros/latex209/contrib/misc/newequation.sty
blob: cd0714c4d8a3fc796925c7547651b985bba04813 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
% newequation.sty
%
% 12 Jan 91  Created.
%            clayton@thumper.bellcore.com
%
% newequation.sty defines the \newequation command, which defines
% new equation environments.  The command format is
%
%    \newequation{name}{format}
%
% where "name" is the name of the new equation environment and "format"
% is the format of the equation number.  For example,
%
%    \newequation{define}{(D\arabic{define})}
%
% The new environment follows Latex's numbered sections convention:
% there's a counter called "name" and a command called \the"name" with
% "format" as its initial definition.  See section 5.3 in the Latex
% user's guide for more on numbering.

\def \newequation#1#2{
   \@definecounter{#1}
   \@namedef{the#1}{\hbox{#2}}
   \@namedef{#1}{$$\refstepcounter{#1}}
   \@namedef{end#1}{
      \eqno \csname the#1\endcsname $$\global\@ignoretrue
      }
   }