summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/cases
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-03-12 03:00:57 +0000
committerNorbert Preining <norbert@preining.info>2020-03-12 03:00:57 +0000
commitc4777604044f5d7ed37fd9e47edd58b44630a66d (patch)
treefcf9b1a09a9879bafce7c9eb217995530605be0f /macros/latex/contrib/cases
parent5412d52974c365e2d5bc1a8320816a729f7c10ab (diff)
CTAN sync 202003120300
Diffstat (limited to 'macros/latex/contrib/cases')
-rw-r--r--macros/latex/contrib/cases/README2
-rw-r--r--macros/latex/contrib/cases/cases.pdfbin334794 -> 335164 bytes
-rw-r--r--macros/latex/contrib/cases/cases.sty25
-rw-r--r--macros/latex/contrib/cases/cases.tex26
4 files changed, 31 insertions, 22 deletions
diff --git a/macros/latex/contrib/cases/README b/macros/latex/contrib/cases/README
index ee694332bf..5ddd34b8a4 100644
--- a/macros/latex/contrib/cases/README
+++ b/macros/latex/contrib/cases/README
@@ -1,4 +1,4 @@
-cases.sty version 3.0 2020/02/22
+cases.sty version 3.1 2020/03/10
Copyright 1993, 1994, 1995, 2000, 2002, 2020 by Donald Arseneau,
asnd@triumf.ca, Vancouver, Canada.
diff --git a/macros/latex/contrib/cases/cases.pdf b/macros/latex/contrib/cases/cases.pdf
index 21e48d54ff..168e8488fc 100644
--- a/macros/latex/contrib/cases/cases.pdf
+++ b/macros/latex/contrib/cases/cases.pdf
Binary files differ
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
}{%
diff --git a/macros/latex/contrib/cases/cases.tex b/macros/latex/contrib/cases/cases.tex
index f2bb343590..42a2b3efb5 100644
--- a/macros/latex/contrib/cases/cases.tex
+++ b/macros/latex/contrib/cases/cases.tex
@@ -23,9 +23,9 @@
%\addtokomafont{title}{\rmfamily}
\title{The \pkg{cases} package%
- \textnormal{\thanks{~~This manual corresponds to \pkg{cases}~v3.0, dated 2020/02/22.}}}
+ \textnormal{\thanks{~~This manual corresponds to \pkg{cases}~v3.1, dated 2020/03/10.}}}
\author{Donald Arseneau\\\mail{asnd@triumf.ca}}
-\date{Feb 2020}
+\date{Mar 2020}
\begin{document}
@@ -69,7 +69,7 @@ case. In a \env{subnumcases} environment, a \cmd{\label} in the \meta{left side}
equation gives the overall equation number, without any letter.
To use this package,
-include "\usepackage{cases}" after \cmd{\documentclass}, and also after
+include "\usepackage{cases}" after \cmd{\documentclass}, and also after
"\usepackage{amsmath}" if you are using that.
\fancybreak
@@ -89,7 +89,7 @@ this package.
\item[\opt{subnum}] Force all \env{numcases} environments to be treated as
\env{subnumcases}.
\item[\opt{amsstyle}] For compatibility with \pkg{amsmath}'s \env{cases}, make \env{numcases}
- use cramped math style ("\textstyle"), and put explanations in the same math style.
+ use cramped math style (\cmd{\textstyle}), and put explanations in the same math style.
\item[\opt{casesstyle}] Change \pkg{amsmath}'s \env{cases} environment to work in the text/math style
of \env{numcases}.
\item[\opt{cases}] Define a \env{cases} environment for use without \pkg{amsmath}. (This
@@ -114,8 +114,8 @@ A simple example is:
Giving:
%
\begin{numcases} {|x|=}
- x, & for $x \geq 0$\\
- -x, & for $x < 0$
+ x, & for $x \geq 0$\label{x}\\
+ -x, & for $x < 0$\label{-x}
\end{numcases}
\fancybreak
@@ -185,10 +185,14 @@ which produces
To get this more compact layout with \env{numcases} you can insert "\textstyle"
at the beginning of each case, as needed, or use the \pkg{cases}
package option \opt{amsstyle}.
-To have the \env{cases} environment give the more open layout of eq.~(\ref{weqn})
-you can put "\displaystyle" at the beginning of each case, or use the
-option \opt{casesstyle} for the \pkg{cases} package. (Yes these go with the cases package, they
-are not options for amsmath.)
+To have the (unnumbered) \env{cases} environment give the more open layout of
+eq.~(\ref{weqn}) you can put "\displaystyle" at the beginning of each case, or use
+the option \opt{casesstyle} for the \pkg{cases} package. (Yes these go with the
+\pkg{cases} package, they are not options for \pkg{amsmath}.)
+
+Another slight difference is that the cases within \env{numcases} can be right-justified by
+inserting \cmd{\hfill} at the beginning of each, which might be desired in rare situations,
+like maybe the absolute value example numbered (\ref{x}) and (\ref{-x}) above.
For full disclosure, even without any relevant package options, cases.sty will
slightly adjust the \env{cases} environment from \pkg{amsmath}, by adding a little
@@ -205,6 +209,6 @@ sub-numbering style can be controlled more easily by defining
\begin{verbatim}
\renewcommand\thesubequation{\themainequation.\Alph{equation}} % 13.C
\end{verbatim}
-
+(noting that the counter to reference is `equation' not `subequation').
\end{document}