From ae97ee7df8f95817a090a4a58faa2776a286c3d7 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 4 Apr 2017 07:25:36 +0000 Subject: correctmathalign (new 4Apr) git-svn-id: svn://tug.org/texlive/trunk@43690 c570f23f-e606-0410-a88d-b1316a301751 --- .../latex/correctmathalign/correctmathalign.sty | 111 +++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/correctmathalign/correctmathalign.sty (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/correctmathalign/correctmathalign.sty b/Master/texmf-dist/tex/latex/correctmathalign/correctmathalign.sty new file mode 100644 index 00000000000..181f7123148 --- /dev/null +++ b/Master/texmf-dist/tex/latex/correctmathalign/correctmathalign.sty @@ -0,0 +1,111 @@ +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{correctmathalign} + [2017/04/04 v1.1 style file ``correctmathalign.sty''^^J + by Yuwsuke Kieda] + +\newif\if@fleqn \@fleqnfalse + +\DeclareOption{latexorg}{\endinput} +\DeclareOption{fleqn}{\@fleqntrue} + +\ProcessOptions + +\if@fleqn + \renewenvironment{eqnarray}{% fleqn.clo + \stepcounter{equation}% + \def\@currentlabel{\p@equation\theequation}% + \global\@eqnswtrue\m@th + \global\@eqcnt\z@ + \tabskip\mathindent + \let\\=\@eqncr + \setlength\abovedisplayskip{\topsep}% + \ifvmode + \addtolength\abovedisplayskip{\partopsep}% + \fi + \addtolength\abovedisplayskip{\parskip}% + \setlength\belowdisplayskip{\abovedisplayskip}% + \setlength\belowdisplayshortskip{\abovedisplayskip}% + \setlength\abovedisplayshortskip{\abovedisplayskip}% + $$\everycr{}\halign to\linewidth% $$ + \bgroup + \hskip\@centering + $\displaystyle\tabskip\z@skip{##}$\@eqnsel&% + \global\@eqcnt\@ne\hfil$\displaystyle{{}##{}}$\hfil&% + \global\@eqcnt\tw@$\displaystyle{##}$\hfil\tabskip\@centering&% + \global\@eqcnt\thr@@\hb@xt@\z@\bgroup\hss##\egroup\tabskip\z@skip\cr}% + {\@@eqncr + \egroup + \global\advance\c@equation\m@ne$$% $$ + \@ignoretrue + } +\else + \def\eqnarray{% latex.ltx + \stepcounter{equation}% + \def\@currentlabel{\p@equation\theequation}% + \global\@eqnswtrue + \m@th + \global\@eqcnt\z@ + \tabskip\@centering + \let\\\@eqncr + $$\everycr{}\halign to\displaywidth\bgroup + \hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel + &\global\@eqcnt\@ne\hfil$\displaystyle{{}##{}}$\hfil + &\global\@eqcnt\tw@$\displaystyle{##}$\hfil\tabskip\@centering + &\global\@eqcnt\thr@@\hb@xt@\z@\bgroup\hss##\egroup + \tabskip\z@skip + \cr + } +\fi + +\@ifpackageloaded{amsmath}{% + \@ifpackagelater{amsmath}{2016/11/05}{\relax}{% + \renewcommand{\start@aligned}[2]{% + \RIfM@\else + \nonmatherr@{\begin{\@currenvir}}% + \fi + \savecolumn@ % Assumption: called inside a group + \null% + \if #1t\vtop \else \if#1b \vbox \else \vcenter \fi \fi \bgroup + \maxfields@#2\relax + \ifnum\maxfields@>\m@ne + \multiply\maxfields@\tw@ + \let\math@cr@@@\math@cr@@@alignedat + \alignsep@\z@skip + \else + \let\math@cr@@@\math@cr@@@aligned + \alignsep@\minalignsep + \fi + \Let@ \chardef\dspbrk@context\@ne + \default@tag + \spread@equation % no-op if already called + \global\column@\z@ + \ialign\bgroup + &\column@plus + \hfil + \strut@ + $\m@th\displaystyle{##}$% + \tabskip\z@skip + &\column@plus + $\m@th\displaystyle{{}##}$% + \hfil + \tabskip\alignsep@ + \crcr + } + \renewenvironment{gathered}[1][c]{% + \RIfM@\else + \nonmatherr@{\begin{gathered}}% + \fi + \null% + \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi \bgroup + \Let@ \chardef\dspbrk@context\@ne \restore@math@cr + \spread@equation + \ialign\bgroup + \hfil\strut@$\m@th\displaystyle##$\hfil + \crcr + }{% + \endaligned + }% + } +}{\relax} + +\endinput -- cgit v1.2.3