diff options
author | Norbert Preining <norbert@preining.info> | 2020-03-12 03:00:57 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-03-12 03:00:57 +0000 |
commit | c4777604044f5d7ed37fd9e47edd58b44630a66d (patch) | |
tree | fcf9b1a09a9879bafce7c9eb217995530605be0f /macros/latex/contrib/cases/cases.sty | |
parent | 5412d52974c365e2d5bc1a8320816a729f7c10ab (diff) |
CTAN sync 202003120300
Diffstat (limited to 'macros/latex/contrib/cases/cases.sty')
-rw-r--r-- | macros/latex/contrib/cases/cases.sty | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/macros/latex/contrib/cases/cases.sty b/macros/latex/contrib/cases/cases.sty index 66609ee492..13d2effa54 100644 --- a/macros/latex/contrib/cases/cases.sty +++ b/macros/latex/contrib/cases/cases.sty @@ -1,4 +1,4 @@ -% C A S E S . S T Y ver 3.0 Feb 2020 +% C A S E S . S T Y ver 3.1 Mar 2020 % % Copyright (C) 1993,1994,1995,2000,2002,2020 by Donald Arseneau % asnd@triumf.ca @@ -30,11 +30,11 @@ % % For detailed description and package options, see cases.pdf (cases.tex). -\ProvidesPackage{cases}[2020/02/22 ver 3.0] +\ProvidesPackage{cases}[2020/03/10 ver 3.1] \newdimen\numc@numwid -% copy \@@eqncr but change error message and handle \tag{} for amsmath: +% copy \@@eqncr but change error message and handle \tag for amsmath: \def\@@numc@cr{\let\reserved@a\relax \ifcase\@eqcnt \def\reserved@a{& & &}\or \def\reserved@a{& &}% \or \def\reserved@a{&}\else @@ -42,7 +42,6 @@ \@latex@error{Too many columns in numcases environment}\@ehc\fi \reserved@a \if@eqnsw\@eqnnum\stepcounter{equation}\else \iftag@ \df@tag\fi\fi \global\@eqnswtrue\global\@eqcnt\z@\cr} - \let\iftag@=\iffalse \newenvironment{numcases}[1]% @@ -54,7 +53,7 @@ \numc@setsub % maybe \subequations (handling \refstepcounter) \def\@currentlabel{\p@equation\theequation}% \global\@eqnswtrue\m@th - \def\tag##1{\def\@currentlabel{##1}\tag@in@align{##1}}% + \let\tag\numc@tag \settowidth{\numc@numwid}{\ \advance\c@equation\tw@\numc@eqnnum}% \@tempskipb\@centering \ifx\numc@left\mathindent % fleqn: @@ -74,9 +73,9 @@ \everycr{}\let\\\@eqncr \let\@@eqncr\@@numc@cr \tabskip\@tempskipa \halign to\dimen@ii \bgroup % white space for LHS followed by RHS - \kern\wd\z@ \kern10\p@ % assume width of brace - \global\let\iftag@=\iffalse % for amsmath (make sure this is not in if block) - \global\@eqcnt\@ne $\numc@dispstyle{##}$\hfil + \kern\wd\z@ \kern10\p@ % assume (and force) width of brace + \global\let\iftag@=\iffalse % for amsmath (make sure this is not in \if block) + \global\@eqcnt\@ne $\numc@dispstyle ##\relax$\hfil \tabskip\z@skip &% explanation \global\@eqcnt\tw@ \numc@expstyle\quad ##\unskip\numc@expstyle\hfil % \unskip removes quad if no explanation @@ -133,6 +132,11 @@ $$\global\@ignoretrue} \@ifundefined{c@parentequation}{% No AMS \def\numc@eqnnum{\@eqnnum} +% for \tag (but not \tag*) without amsmath, using \@@numc@cr above. +\def\numc@tag#1{\def\@currentlabel{#1}% + \gdef\df@tag{\def\theequation{#1}\@eqnnum}% + \global\let\iftag@=\iftrue + \nonumber} % % These versions of subequations follow the style of Gildea's subeqn.sty, % but are thoroughly rewritten. @@ -184,8 +188,9 @@ $$\global\@ignoretrue} % \subequations already defined; % use tag format \def\numc@eqnnum{\tagform@{\theequation}} -% add little space after brace to amsmath's cases +\def\numc@tag{\tag@in@align} +% add little space after brace to amsmath's cases \def\@tempa{% \let\@ifnextchar\new@ifnextchar \left\lbrace @@ -241,7 +246,7 @@ $$\global\@ignoretrue} \openup\jot \tabskip\z@skip \halign \bgroup - $\numc@dispstyle{##}\m@th$\hfil + $\numc@dispstyle ##\m@th$\hfil &\numc@expstyle\quad ##\unskip\numc@expstyle\hfil % \unskip removes space if no explanations \cr }{% |