Newsgroups: fj.comp.texhax
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!wnoc-sfc-news!wnoc-kyo-news!hakozaki.karrn!hakata!kudpc!kuis-news!kuamp!imamura
From: imamura@kuamp.kyoto-u.ac.jp (Toshiyuki Imamura)
Subject: Mathtech.sty-2.1e release.
Content-Type: text/plain; charset=ISO-2022-JP
X-Newsreader: mnews [version 1.19PL2] 1996-01/26(Fri)
Sender: usenet@kuamp.kyoto-u.ac.jp (0000-NewsAdmin(0000))
Lines: 950
Organization: Div. of Applied Systems Science, Kyoto Univ., JAPAN
Message-ID: <Dns62n.D24@kuamp.kyoto-u.ac.jp>
Mime-Version: 1.0
X-Nntp-Posting-Host: randy.kuamp.kyoto-u.ac.jp
Date: Tue, 5 Mar 1996 06:01:35 GMT
Xref: galaxy.trc.rwcp.or.jp fj.comp.texhax:7637
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.comp.texhax&nb=7637&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

$B:#B<!w5~Bg$G$9!#(B

mathtech.sty$B$N(Bversion2.1e$B$r%j%j!<%9$7$^$9!#(B
2.1e$B$N(Be$B$O(BLaTeX2e$BBP1~$r0UL#$7$F$^$9$N$G(B2e$B%f!<%6$NJ}$b$I$&$>!#(B

1.5->2.0$B$O@5<0$J8x3+$O$7$^$;$s$G$7$?$,(B
1.5->2.0$B$O%P%0%U%#%C%/%9(B+$B0lIt(B2e$BBP1~(B
2.0->2.1e$B$GK\3JE*$J(B2e$BBP1~$H(B(subeqn/eqn/)cases$B4D6-$N(B
$B3HD%$,$J$5$l$F$$$^$9!#(B

----cut here----cut here----cut here----cut here----cut here----cut here----
%
%M A T H T E C H . S T Y
%
% MATHEMATICAL THESIS TECHNICAL-STYLE option
%
%     Version 2.10e released 29 Feb 1996
%     Version 2.03released 16 Feb 1996
%     Version 2.02released 01 Feb 1996
%     Version 2.01released 25 Jan 1996
%     Version 2.0 released 19 Jan 1996
%     Version 1.52released 17 Nov 1995
%     Version 1.51released 17 Nov 1995
%     Version 1.5 released 10 Nov 1995
%     Version 1.4 released 14 Mar 1995
%     Version 1.3 released 01 Mar 1995
%     Version 1.2 released 06 Feb 1995
%     Version 1.1 released 13 Sep 1994
%     Version 1.0 released 23 Jul 1993
%
%  for LaTeX 209 / LaTeX2e and 2e-209 compati-mode
%
% Copyright (C) 1993 by Toshiyuki Imamura, imamura@kuamp.kyoto-u.ac.jp
%
%This style option defines the mathematical technical macros,
%
%numberwithin command
%
%equation  and equation* environment
%eqnarray and subeqnarray and sub equation environment
%
%eqncases, subeqncases and cases environment
%
%textin command
%
%newfunction, newoperator and newrelation command
%
%lefteqno, righteqno  and fleqn
%
%and the slanted capital Greek, and resizable dots command.
%
%Vdots, Hdots, Ddots, Qdots
%
%
%
% Thanks to
%Tetsuo Iwakuma   <bear@hashi1.civil.tohoku.ac.jp>
%Kouzou Tsukiyama <tukiyama@shimane-u.ac.jp>
%Donald Arseneau  <asnd@triumf.ca>
%HAYASE Shigenori <t50616@hongo.ecc.u-tokyo.ac.jp>
%Hidekazu Ooguma  <kuma@suri.it.okayama-u.ac.jp>
%
\typeout{********************************************^^J%
         * MATHTECH.STY Ver2.10e\space\space\space\space\space\space\space 29 Feb 1996. *^^J%
         *  \space\space\space\space\space\space\space\space\space\space%
           by imamura@kuamp.kyoto-u.ac.jp *^^J%
         ********************************************}
\newif\iftwo@e@used
\@ifundefined{nfss@catcodes}
 {\typeout{MATHTECH.STY detects; your tex-fmt is LaTeX209.}%
  \two@e@usedfalse}%
 {\typeout{MATHTECH.STY detects; your tex-fmt is LaTeX2e(209 compati-mode).}%
  \ProvidesPackage{mathtech}[1996/02/29 ver2.10e]%
  \two@e@usedtrue}%
%
\@ifundefined{numberwithin}{% check for AmS-LaTeX
 \def\numberwithin#1#2{%
 \@addtoreset{#1}{#2}%
 \expandafter\def\csname the#1\endcsname{\csname the#2\endcsname.\arabic{#1}}}
}{}%
%
\numberwithin{equation}{section}
%
% New equation, multilinable math with centering align.
% New subequation, numbering with subeqno.
%
\newcounter{subequation}[equation]
\def\thesubequation{%
 \theequation\kern.8pt\hbox to1ex{\hss\alph{subequation}\hss}}
%

\def\equation{%
 \stepcounter{equation}%
 \def\@eqnstepcounter{\stepcounter{equation}}%
 \def\@eqndowncounter{\addtocounter{equation}{-1}}%
 \def\sub@eqnstepcounter{\stepcounter{subequation}}%
 \def\sub@eqndowncounter{\addtocounter{subequation}{-1}}%
 \let\@eqnnum=\@@eqnnum% bug fix
 \let\@@eqncr@orig=\@@eqncr%
 \let\@@eqncr=\@@@eqncr%
 \let\@currentlabel=\theequation\@equation}%
\def\endequation{%
 \@@@eqncr\egroup\global\advance\c@equation\m@ne$$\global\@ignoretrue%
 \let\@@eqncr=\@@eqncr@orig }

\def\subequation{%
 \stepcounter{equation}\global\c@subequation\@ne%%
 \def\@eqnstepcounter{\stepcounter{subequation}}%
 \def\@eqndowncounter{\addtocounter{subequation}{-1}}%
 \let\sub@eqnstepcounter=\@eqnstepcounter%
 \let\sub@eqndowncounter=\@eqndowncounter%
 \let\@eqnnum=\sub@@eqnnum% bug fix
 \let\@@eqncr@orig=\@@eqncr%
 \let\@@eqncr=\@@@eqncr%
 \@ifnextchar\label{\sub@equation}%
 {\let\@currentlabel=\thesubequation\@equation}}
\def\sub@equation\label#1{%
 \let\@currentlabel=\theequation\label{#1}%
 \let\@currentlabel=\thesubequation\@equation}
\def\endsubequation{\@@@eqncr\egroup$$\global\@ignoretrue%
 \let\@@eqncr=\@@eqncr@orig }

\@namedef{equation*}{\def\@eqncr{\nonumber\@seqncr}
            \let\eqncases=\cases\let\endeqncases=\endcases%
            \let\subeqncases=\cases\let\endsubeqncases=\endcases\equation}
\@namedef{endequation*}{\nonumber\endequation}
\@namedef{subequation*}{\def\@eqncr{\nonumber\@seqncr}
            \let\eqncases=\cases\let\endeqncases=\endcases%
            \let\subeqncases=\cases\let\endsubeqncases=\endcases\subequation}
\@namedef{endsubequation*}{\global\advance\c@equation\m@ne%
            \nonumber\endsubequation}
%
% New eqnarray, such that 2nd column's space are reduced.
% New subeqnarray, numbering with subeqno
%
\def\eqnarray{%
 \stepcounter{equation}%
 \def\@eqnstepcounter{\stepcounter{equation}}%
 \def\@eqndowncounter{\addtocounter{equation}{-1}}%
 \def\sub@eqnstepcounter{\stepcounter{subequation}}%
 \def\sub@eqndowncounter{\addtocounter{subequation}{-1}}%
 \let\@eqnnum=\@@eqnnum% bug fix
 \let\@currentlabel=\theequation\@eqnarray}
%\def\endeqnarray{\@@eqncr\egroup%
% \global\advance\c@equation\m@ne$$\global\@ignoretrue}

\def\subeqnarray{%
 \def\@eqnstepcounter{\stepcounter{subequation}}%
 \def\@eqndowncounter{\addtocounter{subequation}{-1}}%
 \let\sub@eqnstepcounter=\@eqnstepcounter%
 \let\sub@eqndowncounter=\@eqndowncounter%
 \let\@eqnnum=\sub@@eqnnum% bug fix
 \stepcounter{equation}%
 \global\c@subequation\@ne%
 \@ifnextchar\label{\sub@eqnarray}%
 {\let\@currentlabel=\thesubequation\@eqnarray}}
\def\sub@eqnarray\label#1{%
 \let\@currentlabel=\theequation\label{#1}%
 \let\@currentlabel=\thesubequation\@eqnarray}
\def\endsubeqnarray{\@@eqncr\egroup$$\global\@ignoretrue}

\@namedef{eqnarray*}{\def\@eqncr{\nonumber\@seqncr}
            \let\eqncases=\cases\let\endeqncases=\endcases%
            \let\subeqncases=\cases\let\endsubeqncases=\endcases\eqnarray}
\@namedef{endeqnarray*}{\nonumber\endeqnarray}
\@namedef{subeqnarray*}{\def\@eqncr{\nonumber\@seqncr}
            \let\eqncases=\cases\let\endeqncases=\endcases%
            \let\subeqncases=\cases\let\endsubeqncases=\endcases\subeqnarray}
\@namedef{endsubeqnarray*}{\global\advance\c@equation\m@ne%
            \nonumber\endsubeqnarray}

\newdimen\eqnarraycolsep
%\eqnarraycolsep=\arraycolsep
%\eqnarraycolsep=.5\arraycolsep
\eqnarraycolsep=\z@
%
%
\def\@@eqncr{\let\@tempa=\relax%
 \ifcase\@eqcnt\def\@tempa{&&&}\or\def\@tempa{&&}%
 \or\def\@tempa{&}\else\let\@tempa\@empty%
  \@latexerr{Too many columns in eqnarray environment}\@ehc\fi%
 \@tempa\if@eqnsw\@eqnnum%
 \@ifundefined{@eqnstepcounter}% *
   {\stepcounter{equation}}{\@eqnstepcounter}\fi% *
 \global\@eqnswtrue\global\@eqcnt\z@\cr}
\def\@@@eqncr{&\if@eqnsw\@eqnnum%
 \@ifundefined{@eqnstepcounter}% *
   {\stepcounter{equation}}{\@eqnstepcounter}\fi% *
 \global\@eqnswtrue\cr}
%
%If you wnat to change locate-Right:eq-no <-> locate-Left:eq-no,
%you may use \lefteqno or \righteqno outside eq-env.
%
\def\lefteqno{\global\def\@eqnnummode{l}}
\def\righteqno{\global\def\@eqnnummode{r}}
\def\@@eqnnum{%
 \iftwo@e@used\normalfont\normalcolor\fi%
 \if\@eqnnummode l%
  {\hbox to .01pt{}\rlap{\rm \hskip -\displaywidth(\theequation)}}%
 \else%
  {\rm(\theequation)}\fi}
\def\sub@@eqnnum{%
 \iftwo@e@used\normalfont\normalcolor\fi%
 \if\@eqnnummode l%
  {\hbox to .01pt{}\rlap{\rm \hskip -\displaywidth(\thesubequation)}}%
 \else%
  {\rm(\thesubequation)}\fi}

\righteqno%default is right-eq-no.
%
%If you want to CENTRing-eqn <-> FlushLeft-eqn
%you may use \centereqn or \fleqn outside eq-env,
%
\def\centereqn{%
 \gdef\[{\relax\ifmmode\@badmath\else%
  \ifvmode \nointerlineskip \makebox[.6\linewidth]\fi$$\fi}
 \gdef\]{\relax\ifmmode\ifinner\@badmath\else$$\fi\else\@badmath\fi%
  \ignorespaces}
 \gdef\@equation{%
  \global\@eqnswtrue\m@th%
  \tabskip\@centering\let\\=\@eqncr
  $$\iftwo@e@used\everycr{}\fi%
  \halign to\displaywidth\bgroup%\@eqnsel%
   \hfil$\displaystyle{####}$\hfil%
  &\llap{####}\tabskip\z@skip\cr}
 \gdef\@eqnarray{%
  \global\@eqcnt\z@%
  \global\@eqnswtrue\m@th%
  \tabskip\@centering\let\\=\@eqncr%
  $$\iftwo@e@used\everycr{}\fi%
  \halign to\displaywidth\bgroup%
   \hskip\@centering\tabskip\z@skip$\displaystyle{####}$\@eqnsel%
  &\global\@eqcnt\@ne\hskip\tw@\eqnarraycolsep%
   \hfil$\displaystyle{{}####{}}$\hfil%
  &\global\@eqcnt\tw@\hskip\tw@\eqnarraycolsep%
   \tabskip\z@skip$\displaystyle{####}$\hfil\tabskip\@centering%
  &\global\@eqcnt\thr@@\llap{####}\tabskip\z@skip\cr}
}
\def\fleqn{%referred from fleqn.sty 6 Feb 85
 \gdef\[{\relax\ifmmode\@badmath\else\begingroup\trivlist\item[]\leavevmode%
 \hbox to\linewidth\bgroup$\displaystyle%
 \hskip\mathindent\bgroup\fi}
 \gdef\]{\relax\ifmmode\egroup$\hfil\egroup\endtrivlist\endgroup\else%
 \@badmath\fi}
 \gdef\@equation{%
  \global\@eqnswtrue\m@th%
  \tabskip\mathindent\let\\=\@eqncr%
  \abovedisplayskip\topsep\ifvmode\advance\abovedisplayskip\partopsep\fi%
  \belowdisplayskip\abovedisplayskip%
  \belowdisplayshortskip\abovedisplayskip%
  \abovedisplayshortskip\abovedisplayskip%
  $$\iftwo@e@used\everycr{}\fi%
  \halign to \linewidth\bgroup%\@eqnsel%
   \tabskip\@centering$\displaystyle{####}$\hfil\tabskip\@centering%
  &\llap{####}\tabskip\z@skip\cr}
 \gdef\@eqnarray{%
  \global\@eqcnt\z@%
  \global\@eqnswtrue\m@th%
  \tabskip\mathindent\let\\=\@eqncr%
  \abovedisplayskip\topsep\ifvmode\advance\abovedisplayskip\partopsep\fi%
  \belowdisplayskip\abovedisplayskip%
  \belowdisplayshortskip\abovedisplayskip%
  \abovedisplayshortskip\abovedisplayskip%
  $$\iftwo@e@used\everycr{}\fi%
  \halign to\linewidth\bgroup%
   \hskip\@centering\tabskip\z@skip$\displaystyle{####}$\@eqnsel%
  &\global\@eqcnt\@ne\hskip\tw@\eqnarraycolsep%
   \hfil$\displaystyle{{}####{}}$\hfil%
  &\global\@eqcnt\tw@\hskip\tw@\eqnarraycolsep%
   \tabskip\z@skip$\displaystyle{####}$\hfil\tabskip\@centering%
  &\global\@eqcnt\thr@@\llap{####}\tabskip\z@skip\cr}
 \newdimen\mathindent%
 \mathindent = \leftmargini%
}

\centereqn%default is CENTERing-eqn
%
%
\long\def\textin#1{\noalign{\noindent%
 \vskip\topsep\hbox{\vbox{\hsize\textwidth%
 \let\\=\newline%
 \noindent#1\hss}}\vskip\topsep}}
%
%
%
\def\FRAC{\@ifnextchar[{\@FRAC}{\@FRAC[.4pt]}}
\def\@FRAC[#1]#2#3{{\begingroup\displaystyle#2\endgroup%
 \above#1\relax\displaystyle#3}}%
\def\pfrac{\@ifnextchar[{\@pfrac}{\@@pfrac}}
\def\@pfrac[#1]#2#3{\@FRAC[.4pt]{\partial^{#1}#2}{\partial#3^{#1}}}
\def\@@pfrac#1#2{\@FRAC[.4pt]{\partial#1}{\partial#2}}
\def\slfrac#1#2{\leavevmode%
 \ifmmode%
  \raise.5ex\hbox{$#1$}\kern-.1em/\kern-.1em\lower.25ex\hbox{$#2$}%
 \else%
  \raise.5ex\hbox{#1}\kern-.1em/\kern-.1em\lower.25ex\hbox{#2}%
 \fi}
%
%
\def\newfunction#1{%
  \iftwo@e@used%
   \expandafter\def\csname#1\endcsname{\mathop{\operator@font#1}\nolimits}%
  \else%
   \expandafter\def\csname#1\endcsname{\mathop{\rm#1}\nolimits}%
  \fi}
\def\newoperator#1#2{%
  \expandafter\def\csname#1\endcsname{\mathop{#2}\limits}}
\def\newrelation#1#2{%
  \expandafter\def\csname#1\endcsname{\mathrel{#2}\limits}}
%
\def\@iint@kern{\mathchoice{\!\!\!}{\!\!}{\!\!}{\!\!}}
\def\@iiint@kern{\mathchoice{\!\!\!\!}{\!\!}{\!\!}{\!\!}}
%
\newoperator{Ker}{\mbox{Ker}}
\newoperator{Im}{\mbox{Im}}
\newoperator{sumsum}{\sum\!\sum}
\newoperator{iint}{\int\@iint@kern\int}
\newoperator{iiint}{\int\@iiint@kern\int\@iiint@kern\int}
%
\newfunction{cond}
\newfunction{diag}
\newfunction{det}
\newfunction{trace}
\newfunction{sign}
\newfunction{const}
\newfunction{Arcsin}
\newfunction{Arccos}
\newfunction{Arctan}
\newfunction{cosec}
%
\newfunction{Arcsec}\newfunction{arcsec}
\newfunction{Arccosec}\newfunction{arccosec}
\newfunction{Arccsc}\newfunction{arccsc}
\newfunction{Arccot}\newfunction{arccot}
%
\def\@addCapitalGreek#1{%
 \@ifundefined{var#1}{% check for AmS-LaTeX
  \expandafter\def\csname var#1\endcsname{{\mit\csname#1\endcsname}}}{}}
%
\@addCapitalGreek{Gamma}\@addCapitalGreek{Delta}
\@addCapitalGreek{Theta}\@addCapitalGreek{Lambda}
\@addCapitalGreek{Xi}\@addCapitalGreek{Pi}
\@addCapitalGreek{Sigma}\@addCapitalGreek{Upsilon}
\@addCapitalGreek{Phi}\@addCapitalGreek{Psi}
\@addCapitalGreek{Omega}
%
\let\@addCapitalGreek=\relax%
%
%(See RakuRaku LaTeX edited by Dr.Nodera)
%
\def\fillBox{{\rule[-2pt]{5pt}{6pt}}}
%%%\font\b@g=cmr10 scaled\magstep4%
%%%\def\bigzerol{\smash{\hbox{\b@g0}}}
%%%\def\bigzerou{\smash{\lower1.7ex\hbox{\b@g0}}}
%%%\def\bigzero{\smash{\lower.85ex\hbox{\b@g0}}}
\def\bigzerol{\smash{\hbox{\LARGE$0$}}}
\def\bigzerou{%
  \setbox\@tempboxa=\hbox{$o$}\@tempdima=\ht\@tempboxa%
  \setbox\@tempboxa=\hbox{\LARGE$0$}\@tempdimb=\ht\@tempboxa%
  \advance\@tempdimb-\@tempdima\smash{\lower\@tempdimb\hbox{\LARGE$0$}}}
\def\bigzero{%
  \setbox\@tempboxa=\hbox{$o$}\@tempdima=\ht\@tempboxa%
  \setbox\@tempboxa=\hbox{\LARGE$0$}\@tempdimb=\ht\@tempboxa%
  \advance\@tempdimb-\@tempdima\smash{\lower.5\@tempdimb\hbox{\LARGE$0$}}}
%
%                 (     )           (  .  )
%                 (. . .)           (  .  )
% resizable Hdots (     ) and Vdots (  .  )
%           hdots(=cdots)     vdots
%                 (.    )           (    .)
%                 (  .  )           (  .  )
% resizable Ddots (    .) and Qdots (.    )
%           ddots             qdots
%
% ddots and qdots is adjusted to cdots and vdots
%
\def\Hdots[#1]{%
 \@tempdima=#1\def\b@x{\hbox to\@tempdima{\hss}}\let\cdots=\b@x\hdots}
\def\Vdots[#1]{%
 \@tempdima=#1\def\b@x{\hbox to\@tempdima{\hss}}\let\cdots=\b@x\vdots}
\def\Ddots[#1]{%
 \@tempdima=#1\def\b@x{\hbox to\@tempdima{\hss}}\let\cdots=\b@x\ddots}
\def\Qdots[#1]{%
 \@tempdima=#1\def\b@x{\hbox to\@tempdima{\hss}}\let\cdots=\b@x\qdots}
\def\hdots{\@ifnextchar[{\@hdots}{\@hdots[3]}}
\def\vdots{\@ifnextchar[{\@vdots}{\@vdots[3]}}
\def\ddots{\@ifnextchar[{\@ddots}{\@ddots[3]}}
\def\qdots{\@ifnextchar[{\@qdots}{\@qdots[3]}}
\def\@hdots[#1]{%
 \mathinner{\setbox\@tempboxa=\hbox{$\cdots$}\@tempdima\wd\@tempboxa%
  \hbox to \@tempdima{%
   \vrule width\z@ height.85\@tempdima depth.15\@tempdima%
   \@tempcnta=#1\loop\raise.35\@tempdima\my@dot\hss
    \advance\@tempcnta-1\ifnum\@tempcnta>2\repeat\raise.35\@tempdima\my@dot}}}
\def\@vdots[#1]{%
 \mathinner{\setbox\@tempboxa=\hbox{$\cdots$}\@tempdima\wd\@tempboxa%
   \vrule width\z@ height.85\@tempdima depth.15\@tempdima%
   \hss\vbox to.7\@tempdima{%
   \@tempcnta=#1\loop{\my@dot}\vss
    \advance\@tempcnta-1\ifnum\@tempcnta>2\repeat{\my@dot}}}}
\def\@ddots[#1]{%
 \mathinner{\setbox\@tempboxa=\hbox{$\cdots$}\@tempdima\wd\@tempboxa%
 \def\@tempa##1##2{\vbox to.7\@tempdima{%
   \@tempcntb=##1\loop{\ifnum##2=\@tempcntb{\my@dot}\fi}\vss%
   \advance\@tempcntb-1\ifnum\@tempcntb>2\repeat%
   {\ifnum##2=1{\my@dot}\fi}}}%
 \hbox to \@tempdima{%
  \vrule width\z@ height.85\@tempdima depth.15\@tempdima%
  \@tempcnta=#1\loop\@tempa{#1}{\@tempcnta}\hss%
  \advance\@tempcnta-1\ifnum\@tempcnta>2\repeat\@tempa{#1}{1}}}}
\def\@qdots[#1]{%
 \mathinner{\setbox\@tempboxa=\hbox{$\cdots$}\@tempdima\wd\@tempboxa%
 \def\@tempa##1##2{\vbox to.7\@tempdima{%
   \@tempcntb=##1\loop{\ifnum##2=\@tempcntb{\my@dot}\fi}\vss%
   \advance\@tempcntb-1\ifnum\@tempcntb>2\repeat%
   {\ifnum##2=1{\my@dot}\fi}}}%
 \hbox to \@tempdima{%
  \vrule width\z@ height.7\@tempdima depth-.1\@tempdima%
  \@tempa{#1}{1}\@tempcnta=2\loop\hss\@tempa{#1}{\@tempcnta}%
  \advance\@tempcnta1\ifnum\@tempcnta<#1\repeat}}}
\def\my@dot{\hbox{\hss\vbox to\z@{\vss\hbox{\hss.\hss}\vss}\hss}}
%
%
%NEW (sub)eqncases environment
%in version 1.4
%
\newcount\@eqnccnt\@eqnccnt\z@
\newcount\eqnccols\eqnccols\tw@% *
\newcount\@eqnccols% *
\newsavebox\@eqc@a
\newsavebox\@eqc@b
\newsavebox\@eqc@c
\newsavebox\@eqc@d
\newsavebox\@eqc@e
\newsavebox\@eqc@f
\newsavebox\@eqc@g

\let\@eqnnum@old=\relax

\def\eqncases{%
 \let\@eqncnum=\@eqnnum%
 \@eqncases}
\def\subeqncases{%
 \ifx\@currentlabel\theequation%
  \global\c@subequation\@ne%
  \let\@currentlabel=\thesubequation%
  \let\@eqncnum=\sub@@eqnnum%
  \let\@eqnstepcounter=\sub@eqnstepcounter%
  \let\@eqndowncounter=\sub@eqndowncounter%
 \else%
  \let\@eqncnum=\@eqnnum% bug fix
 \fi%
 \@eqncases}

\def\@eqncases{\@ifnextchar[{\@@eqncases}{\@@eqncases[\eqnccols]}}
\def\@@eqncases[#1]{%
 \global\@eqnccols=#1\relax% *
 \global\let\@eqnnum@old=\@eqnnum% bug fix
 \global\setbox\@eqc@a=\vbox\bgroup\normalbaselines\m@th%
 \setbox\@eqc@b=\vbox{}% bug fix
 \setbox\@eqc@f=\vbox{}%
%%
 \let\noalignorig=\noalign%
 \def\noalign##1{%
  \typeout{\protect\noalign\space cannot be used in (sub)eqncases-env.(\protect\noalign\space ignore)}}
%%
 \let\\=\@eqnccr%
 \let\@halignto=\@empty\let\par=\@empty%
 \ifnum\@eqnccols<1%
  \@latexerr{eqncases column option must be 1,2,3 or 4}\@ehc%
 \fi
 \ifcase\@eqnccols\or% cols=1
  \def\@tempa{\ialign\bgroup%
   \global\@eqnccnt\z@${####}$\hfil}
 \or% cols=2
  \def\@tempa{\ialign\bgroup%
   \global\@eqnccnt\z@${####}$\hfil%
  &\global\@eqnccnt\@ne\quad\strut{####}\hfil}
 \or% cols=3
  \def\@tempa{\ialign\bgroup%
   \global\@eqnccnt\z@\hskip\@centering\tabskip\z@skip${####{}}$\@eqnsel%
  &\global\@eqnccnt\@ne\tabskip\z@skip${{}####}$\hfil\tabskip\@centering%
  &\global\@eqnccnt\tw@\quad\strut{####}\hfil}
 \or% cols=4
  \def\@tempa{\ialign\bgroup%
   \global\@eqnccnt\z@\hskip\@centering%
   \tabskip\z@skip${####}$\@eqnsel%
  &\global\@eqnccnt\@ne\hskip\tw@\eqnarraycolsep\hfil${{}####{}}$\hfil%
  &\global\@eqnccnt\tw@\hskip\tw@\eqnarraycolsep%
   \tabskip\z@skip${####}$\hfil\tabskip\@centering%
  &\global\@eqnccnt\thr@@\quad\strut{####}\hfil}
 \else%
   \@latexerr{eqncases column option must be 1,2,3 or 4}\@ehc%
 \fi%
 \@tempa\crcr%
}

\def\endeqncases{\@@eqnccr\egroup\egroup\mk@eqncnum%
 \@eqndowncounter}% bug fix
\def\endsubeqncases{\@@eqnccr\egroup\egroup\mk@eqncnum%
 \@eqndowncounter}% bug fix

\def\@eqnccr{\@ifnextchar[{\@@qnccr}{\@@qnccr[\jot]}}
\def\@@qnccr[#1]{%
 \@@eqnccr\noalignorig{\vskip#1\relax%
  \global\setbox\@eqc@f=\vbox{\vbox{\rule{\z@}{#1}}\unvbox\@eqc@f}}}
\def\@@eqnccr{\let\@tempa=\relax%
 \@tempcnta\@eqnccols\advance\@tempcnta-\@eqnccnt%
 \ifnum\@tempcnta<1%
   \@latexerr{Too many columns in eqncases environment}\@ehc%
 \fi
 \ifcase\@tempcnta\or\def\@tempa{}\or\def\@tempa{&}%
               \or\def\@tempa{&&}\or\def\@tempa{&&&}\fi
%
% cases-num-column is contained in \@eqc@b
% and \@eqc@b is as an interface-box to \mk@eqncnum.
%
 \if@eqnsw\global\setbox\@eqc@b=\vbox{\unvbox\@eqc@b\hbox{\@eqncnum}}%
 \@eqnstepcounter\else\global\setbox\@eqc@b=\vbox{\unvbox\@eqc@b\hbox{}}\fi%
 \global\@eqnswtrue\@tempa\cr}

\def\mk@eqncnum{%
 \left\{\hskip\arraycolsep\vcenter{\copy\@eqc@a}\hskip\arraycolsep\right.%
 \def\@num{%
    \hbox{\vrule height\ht\@eqc@c depth\dp\@eqc@c width\z@}}%
 \def\@last{%
  \setbox\@eqc@a=\vbox{\unvbox\@eqc@a\unskip\global\setbox\@eqc@c=\lastbox}}%
%
% in next loop \@eqc@c contribute as an interface box
%              \@eqc@d assembles empty boxes which ht&dp is of eq-columns.
%
% \@num : put the 0wd box whose ht&dp is match up to those of \@eqc@c
% \@last : pick up the last box from \@eqc@a and set it to \@eqc@c
%
 \@last\setbox\@eqc@d=\vbox{\@num}\@last\@last%
 \loop%
  \setbox\@eqc@d=\vbox{\@num\unvbox\@eqc@d}\@last\@last%
 \ifhbox\@eqc@c\repeat%
%
 \@tempdima=\wd\@eqc@d%
 \setbox\@eqc@f=\vbox{\unvbox\@eqc@f\hbox{}}%
 \def\@num{%
  \hbox{\box\@eqc@a\hbox to\@tempdima{\hss\box\@eqc@c}}}%
 \def\@last{%
  \setbox\@eqc@b=\vbox{\unvbox\@eqc@b\unskip\global\setbox\@eqc@c=\lastbox}%
  \setbox\@eqc@d=\vbox{\unvbox\@eqc@d\unskip\global\setbox\@eqc@a=\lastbox}%
  \setbox\@eqc@f=\vbox{\unvbox\@eqc@f\unskip\global\setbox\@eqc@g=\lastbox}%
 }%
%
% in next loop \@eqc@c and \@eqc@a contribute as interface boxes
%              \@eqc@e assembles ht&dp-fitted num-columns.
%
% Known bug : \noalign results un-exact num-colums.
%           : but \\[XXpt] is worked instead of \noalign{\vskip...}.
%
% \@num : make hbox which contains \@eqc@a(eq-col) and \@eqc@c(num-col)
% \@last : pick up the last box from \@eqc@b(num-col-box) and set to \@eqc@c
%          pick up the last box from \@eqc@d(ht&dp-box) and set to \@eqc@a
%          pick up the last box from \@eqc@f(skip-box) and set it to \@eqc@g
%
 \@last\setbox\@eqc@e=\vbox{\@num}\@last%
 \loop%
  \setbox\@eqc@e=\vbox{\@num\kern\ht\@eqc@g\unvbox\@eqc@e}\@last%
 \ifhbox\@eqc@c\repeat%
%
 \global\setbox\@eqc@a=\box\@eqc@e%
 \gdef\@eqnnum{\@eqncnum\global\let\@eqnnum=\@eqnnum@old}%
}%

\def\@eqncnum{%
 $\vcenter{\box\@eqc@a}$%
 \setbox\@eqc@a=\box\voidb@x%
 \setbox\@eqc@b=\box\voidb@x%
 \setbox\@eqc@c=\box\voidb@x%
 \setbox\@eqc@d=\box\voidb@x%
 \setbox\@eqc@e=\box\voidb@x%
 \setbox\@eqc@f=\box\voidb@x%
 \setbox\@eqc@g=\box\voidb@x%
}

%
%CASES environment
%
\def\cases{\@ifnextchar[{\@cases}{\@cases[\eqnccols]}}
\def\@cases[#1]{%
 \left\{\hskip\arraycolsep\vcenter\bgroup\normalbaselines\m@th%
 \def\@cr{\@ifnextchar[{\@@cr}{\@@cr[\jot]}}%
 \def\@@cr[##1]{\cr\noalign{\vskip##1\relax}}\let\\=\@cr%
 \let\@halignto=\@empty\let\par=\@empty%
 \ifnum\@eqnccols<1%
  \@latexerr{eqncases column option must be 1,2,3 or 4}\@ehc%
 \fi
 \ifcase\@eqnccols\or% cols=1
  \def\@tempa{\ialign\bgroup%
   \global\@eqnccnt\z@${####}$\hfil}
 \or% cols=2
  \def\@tempa{\ialign\bgroup%
   \global\@eqnccnt\z@${####}$\hfil%
  &\global\@eqnccnt\@ne\quad\strut{####}\hfil}
 \or% cols=3
  \def\@tempa{\ialign\bgroup%
   \global\@eqnccnt\z@\hskip\@centering\tabskip\z@skip${####{}}$\@eqnsel%
  &\global\@eqnccnt\@ne\tabskip\z@skip${{}####}$\hfil\tabskip\@centering%
  &\global\@eqnccnt\tw@\quad\strut{####}\hfil}
 \or% cols=4
  \def\@tempa{\ialign\bgroup%
   \global\@eqnccnt\z@\hskip\@centering%
   \tabskip\z@skip${####}$\@eqnsel%
  &\global\@eqnccnt\@ne\hskip\tw@\eqnarraycolsep\hfil${{}####{}}$\hfil%
  &\global\@eqnccnt\tw@\hskip\tw@\eqnarraycolsep%
   \tabskip\z@skip${####}$\hfil\tabskip\@centering%
  &\global\@eqnccnt\thr@@\quad\strut{####}\hfil}
 \else%
   \@latexerr{eqncases column option must be 1,2,3 or 4}\@ehc%
 \fi%
 \@tempa\crcr%
}
\def\endcases{\crcr\egroup\egroup\hskip\arraycolsep\right.}

%
%   bigmathstrut
%
\def\bigmathstrut{\vphantom{\displaystyle{1\atop1}}}
%
%   bordermatrix with delimeter
%
\def\bordermatrix{\@ifnextchar+{\@bordermatrix}{\@bordermatrix+()+}}
\def\@bordermatrix+#1#2+#3{%
  \begingroup \m@th%
  \setbox\z@\vbox{%
    \def\cr{\crcr\noalign{\kern2\p@\global\let\cr\endline}}%
    \let\\=\cr%
    \ialign{$##$\hfil\kern2\p@\kern\p@renwd&\thinspace\hfil$##$\hfil 
      &&\quad\hfil$##$\hfil\crcr
      \omit\strut\hfil\crcr\noalign{\kern-\baselineskip}%
      #3\crcr\omit\strut\cr}}%
  \setbox\tw@\vbox{\unvcopy\z@\global\setbox\@ne\lastbox}%
  \setbox\tw@\hbox{\unhbox\@ne\unskip\global\setbox\@ne\lastbox}%
  \setbox\tw@\hbox{$\kern\wd\@ne\kern-\p@renwd%
    \left#1%  *
    \kern-\wd\@ne 
    \global\setbox\@ne\vbox{\box\@ne\kern2\p@}%
    \vcenter{\kern-\ht\@ne\unvbox\z@\kern-\baselineskip}\,%
    \right#2% *
    $}\null\;\vbox{\kern\ht\@ne\box\tw@}\endgroup}
%
%
%   for LaTeX2e \usepackage option
%
%
\iftwo@e@used%
  \DeclareOption{fleqn}{ \fleqn }
  \DeclareOption{leqno}{ \lefteqno }
  \DeclareOption{alph}{%
    \def\thesubequation{%
     \theequation\kern.8pt\hbox to1ex{\hss\alph{subequation}\hss}}}
  \DeclareOption{Alph}{%
    \def\thesubequation{%
     \theequation.\hbox to1em{\hss\Alph{subequation}\hss}}}
  \DeclareOption{roman}{%
    \def\thesubequation{%
     \theequation-\roman{subequation}}}
  \DeclareOption{arabic}{%
    \def\thesubequation{%
     \theequation-\arabic{subequation}}}
  \ProcessOptions%
\fi
%
\endinput
%
%Tiny document
%
mathematical envirnment

i) equation environment ( centering multi-eq-lines )
   No numbering can be done with '*'

\begin{equation}
f(x) = .... \\
g(x) = ....
\end{equation}

Compiled image is,

    f(x) = .... (1.1)

  g(x) = ........ (1.2)


ii) subequation environment ( centering multi-eq-lines with sub-eq no.)
    No numbering can be done but it is nonsense.
sub-numbering counter is subequation.
If you want to change sub-numbering style as (1.2-1),
you may re-define \thesubequation as \theequation.

\begin{subequation}
f(x) = .... \\
g(x) = ....
\end{subequation}

Compiled image is,

    f(x) = ....(1.1a)

  g(x) = ........(1.1b)


iii) eqnarray environment ( aligning ,at '&', multi-eq-lines )
     spacing 1-2-3 column is defined as \eqnarraycolsep
     default is 0pt, latex-default is \arraycolsep(not 0pt)
     No numbering can be done with '*'

\begin{eqnarray}
f(x)&=&.... \\
g(x)&=&....
\end{eqnarray}

Compiled image is,

f(x) = .... (1.1)

g(x) = ........ (1.2)


iv) subeqnarray environment ( aligning ,at '&', multi-eq-lines with sub-eq no. )
    No numbering can be done but it is nonsense.

\begin{subeqnarray}
f(x)&=&.... \\
g(x)&=&....
\end{subeqnarray}

Compiled image is,

f(x) = ....(1.1a)

g(x) = .......(1.1b)

\thesubequation is used in sub(equation|eqnarray) environment.
\ref command is also applied in sub* envirnment.


v) eqncases environment is the case environment with equation numbering
   with every items, and also subeqncases is with subeqation numbering.
   For each column, nonumber can be done. And after endsubeqncases nonumber
   means usual nonumber command of eqnarray.
   (sub)eqncases environment must be only one time in (sub)(equation/eqnarray)
   environment on those of column. In (sub)eqnarray, (sub)eqncases must be
   located at third column. And also (sub)eqncases must not be nested.
   If you want more column to align in eqncases, you can specify the number of
   column in [ ] option, default is 2. [ ] option can be specified for 1, 2, 3,
    4. and the last column is not math-mode, but in text-mode.
   And default number of columns can be specified by counter \eqnccols.
  
  (in subeqnarray env, numbering is forced to subequation.)

\begin{eqnarray}
f(x) &=& \begin{subeqncases}
   1 & if $x>0$\\
  -1 & if $x\le0$
 \end{subeqncases}\\
g(x) &=& \tan x
\end{eqnarray}
\begin{equation}
\begin{subeqncases}[4]
   y & = & ax+b & if $x>0$\\
   y & = & cx+d & if $x\le0$
 \end{subeqncases}\\
\end{equation}

Compiled image is,

/~  1  if x>0(1.1a)
f(x) = {
\_ -1  if x<0(1.1b)
   ~
g(x) = tan x (1.2)


       /~  y  =  ax+b   if x>0(1.3a)
      {
       \_  y  =  cx+d   if x<0(1.3b)
    ~

If only one numbering for cases, it is available with cases environment and
no numbering is able to use both cases and nonumber;

\begin{eqnarray}
f(x) &=& \begin{cases}
   1 & if $x>0$\\
  -1 & if $x\le0$
 \end{cases}\\
g(x) &=& \tan x
\end{eqnarray}

Compiled image is,

/~  1  if x>0
f(x) = { (1.1)
\_ -1  if x<=0

g(x) = tan x (1.2)


vi) In multiline-eqs, \textin command can be very useful.
    This line can be forced not to be aligned.

\begin{eqnarray}
f(x)&=&.....\\
\textin{where, x is in ...}
g(x)&=&.....
\end{eqnarray}

    Compiled image is,

f(x)=...... (1.1)

 where, x is in ...

g(x)=..... (1.2)

    In \textin \par and \\ (breakline) is available, but some command,
    for example \verb, is not available.


vii) re-sizable triple-dot commands(\cdot,\vdots,\ddots,and \qdots).

normalsize is \hdots, \vdots, \ddots, \qdots
(size of \ddots and \qdots is automatically changed with font-size)

re-sizable  is \Hdots[#1], \Vdots[#1], \Ddots[#1], \Qdots[#1]
(#1 is size of width)
if you add auxilally option [#2] the number of dot can be designated

ex.
\Hdots[20pt][5]


viii) AMS-like command is also supported.

\numberwithin
\newfunction,\newoperator,\newrelation ... etc.

\varXXXX means slanted Greek capital font in math-mode.


ix) lefteqno, righteqno and fleqn command

\lefteqno   ... number of equation is located in left side.
\righteqno  ... number of equation is located in right side.
\fleqn      ... equation is flushed in the left side.
\centereqn  ... equation is located in center of the line.


%********************************************************
%* TEST.TEX *
%********************************************************
\documentstyle[mathtech]{article}

\begin{document}
%\fleqn
%\lefteqno
\righteqno
\begin{equation}\label{0}% \label{0} is same as \label{1}
   f(x)=\cos(\varepsilon x) \label{1} \\
   g(x)=\frac{\sin x}{x} \label{2}
\end{equation}
(\ref{0})(\ref{1})(\ref{2})
%
\begin{subequation}\label{3}% \label{3} means theequation of this sub-one
   f(x)=\cos(\varepsilon x) \label{4} \\
   g(x)=\frac{\sin x}{x} \label{5}
\end{subequation}
(\ref{3})(\ref{4})(\ref{5})
%
\begin{equation}\label{6}% \label{6} is same as \label{7}
  f(x)=\begin{eqncases}
           1 & if~~$x=0$ \label{7}\\
           0 & others \label{8}
         \end{eqncases} \label{9}\\ % \label{9} is same as \label{8}
  g(x)=x^2\label{10}
\end{equation}
(\ref{6})(\ref{7})(\ref{8})(\ref{9})(\ref{10})
%
\begin{equation}\label{11}
  f(x)=\begin{subeqncases}
           1 & if~~$x=0$ \label{12}\\
           0 & others \label{13}
         \end{subeqncases} \label{14}\\ % \label{14} is same as \label{11}
  g(x)=x^2\label{15}
\end{equation}
(\ref{11})(\ref{12})(\ref{13})(\ref{14})(\ref{15})
%
\begin{subequation}\label{16}% \label{16} means theequation of this sub-one
  f(x)=\begin{eqncases}
           1 & if~~$x=0$ \label{17}\\
           0 & others \label{18}
         \end{eqncases} \label{19}\\ % \label{19} is same as \label{18}
  g(x)=x^2\label{20}
\end{subequation}
(\ref{16})(\ref{17})(\ref{18})(\ref{19})(\ref{20})
%
\begin{subequation}\label{21}% \label{21} means theequation of this sub-one
  f(x)=\begin{subeqncases}
           1 & if~~$x=0$ \label{22}\\
           0 & others \label{23}
         \end{subeqncases} \label{24}\\ % \label{24} is same as \label{23}
  g(x)=x^2\label{25}
\end{subequation}
(\ref{21})(\ref{22})(\ref{23})(\ref{24})(\ref{25})
%
\begin{eqnarray}\label{26} % \label{26} is same as \label{27}
  f(x)&=&\begin{eqncases}
           1 & if~~$x=0$ \label{27}\\
           0 & others \label{28}
         \end{eqncases} \label{29}\\ % label{29} is same as \label{28}
  g(x)&=&x^2\label{30}
\end{eqnarray}
(\ref{26})(\ref{27})(\ref{28})(\ref{29})(\ref{30})
%
\begin{eqnarray}\label{31}
  f(x)&=&\begin{subeqncases}
           1 & if~~$x=0$ \label{32}\\
           0 & others \label{33}
         \end{subeqncases} \label{34}\\ % label{34} is same as \label{31}
  g(x)&=&x^2\label{35}
\end{eqnarray}
(\ref{31})(\ref{32})(\ref{33})(\ref{34})(\ref{35})
%
\begin{subeqnarray}\label{36} % \label{36} means theequation of this sub-one
  f(x)&=&\begin{eqncases}
           1 & if~~$x=0$ \label{37}\\
           0 & others \label{38}
         \end{eqncases} \label{39}\\ % label{39} is same as \label{38}
  g(x)&=&x^2\label{40}
\end{subeqnarray}
(\ref{36})(\ref{37})(\ref{38})(\ref{39})(\ref{40})
%
\begin{subeqnarray}\label{41} % \label{41} meas theequation of this sub-one
  f(x)&=&\begin{subeqncases}
           1 & if~~$x=0$ \label{42}\\
           0 & others \label{43}
         \end{subeqncases} \label{44}\\ % label{44} is same as \label{43}
  g(x)&=&x^2\label{45}
\end{subeqnarray}
(\ref{41})(\ref{42})(\ref{43})(\ref{44})(\ref{45})
%
\end{document}


