summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/gene/eqname
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/gene/eqname
Initial commit
Diffstat (limited to 'macros/latex/contrib/gene/eqname')
-rw-r--r--macros/latex/contrib/gene/eqname/eqname.sty37
1 files changed, 37 insertions, 0 deletions
diff --git a/macros/latex/contrib/gene/eqname/eqname.sty b/macros/latex/contrib/gene/eqname/eqname.sty
new file mode 100644
index 0000000000..2f51958e7a
--- /dev/null
+++ b/macros/latex/contrib/gene/eqname/eqname.sty
@@ -0,0 +1,37 @@
+%%% LaTeX document style option eqname.sty
+%%% Gerd Neugebauer 4/92
+%%% gene (at) gerd-neugebauer (dot) de
+%%%
+%%% Copyright 1992, 1994, 2010 Gerd Neugebauer
+%%% You may freely use, modify and/or distribute this file.
+%%%
+%%% This style option allows named equations as follows
+%%%
+%%% 1 + 1 = 2 (17)
+%%% 1 + 2 = 3 (bingo)
+%%% 1 + 3 = 4 (18)
+%%%
+%%% This can be produced by
+%%%
+%%% \begin{eqnarray}
+%%% 1+1=2 \label{e1}\\
+%%% 1+2=3 \eqname{bingo}\label{e2}\\
+%%% 1+3=4 \label{e3}
+%%% \end{eqnarray}
+%%%
+%%% Note: The \label has to go after the \eqname command.
+%%%
+%%% Bugs & Problems:
+%%% This style option does not work with leqno.sty
+%%%
+%%%----------------------------------------------------------------------------
+
+\newif\if@eqname
+\def\@eqname{}
+\def\@eqnnum{{\reset@font\rm
+ (\if@eqname\@eqname%
+ \addtocounter{equation}{-1}%
+ \global\let\@currentlabel=\theequation%
+ \global\@eqnamefalse%
+ \else\theequation\fi)}}
+\def\eqname#1{\xdef\@eqname{#1}\global\@eqnametrue\gdef\@currentlabel{#1}}