texlive[54238] Master/texmf-dist: cases (11mar20)

commits+karl at tug.org commits+karl at tug.org
Wed Mar 11 22:17:10 CET 2020


Revision: 54238
          http://tug.org/svn/texlive?view=revision&revision=54238
Author:   karl
Date:     2020-03-11 22:17:10 +0100 (Wed, 11 Mar 2020)
Log Message:
-----------
cases (11mar20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/cases/README
    trunk/Master/texmf-dist/doc/latex/cases/cases.pdf
    trunk/Master/texmf-dist/doc/latex/cases/cases.tex
    trunk/Master/texmf-dist/tex/latex/cases/cases.sty

Modified: trunk/Master/texmf-dist/doc/latex/cases/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/cases/README	2020-03-11 21:16:58 UTC (rev 54237)
+++ trunk/Master/texmf-dist/doc/latex/cases/README	2020-03-11 21:17:10 UTC (rev 54238)
@@ -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 at triumf.ca, Vancouver, Canada.

Modified: trunk/Master/texmf-dist/doc/latex/cases/cases.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/cases/cases.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/cases/cases.tex	2020-03-11 21:16:58 UTC (rev 54237)
+++ trunk/Master/texmf-dist/doc/latex/cases/cases.tex	2020-03-11 21:17:10 UTC (rev 54238)
@@ -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 at triumf.ca}}
-\date{Feb 2020}
+\date{Mar 2020}
 
 
 \begin{document}
@@ -69,7 +69,7 @@
 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 @@
 \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 @@
 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,11 +185,15 @@
 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
 space after the left brace.
@@ -205,6 +209,6 @@
 \begin{verbatim}
 \renewcommand\thesubequation{\themainequation.\Alph{equation}} % 13.C
 \end{verbatim}
+(noting that the counter to reference is `equation' not `subequation').
 
-
 \end{document}

Modified: trunk/Master/texmf-dist/tex/latex/cases/cases.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/cases/cases.sty	2020-03-11 21:16:58 UTC (rev 54237)
+++ trunk/Master/texmf-dist/tex/latex/cases/cases.sty	2020-03-11 21:17:10 UTC (rev 54238)
@@ -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 at 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 at 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 at cr{\let\reserved at a\relax
     \ifcase\@eqcnt \def\reserved at a{& & &}\or \def\reserved at a{& &}%
      \or \def\reserved at a{&}\else
@@ -42,7 +42,6 @@
        \@latex at error{Too many columns in numcases environment}\@ehc\fi
      \reserved at a \if at eqnsw\@eqnnum\stepcounter{equation}\else \iftag@ \df at tag\fi\fi
      \global\@eqnswtrue\global\@eqcnt\z@\cr}
-
 \let\iftag@=\iffalse
 
 \newenvironment{numcases}[1]%
@@ -54,7 +53,7 @@
  \numc at setsub % maybe \subequations (handling \refstepcounter)
  \def\@currentlabel{\p at equation\theequation}%
  \global\@eqnswtrue\m at th
- \def\tag##1{\def\@currentlabel{##1}\tag at in@align{##1}}%
+ \let\tag\numc at tag
  \settowidth{\numc at numwid}{\ \advance\c at equation\tw@\numc at eqnnum}%
  \@tempskipb\@centering
  \ifx\numc at left\mathindent % fleqn:
@@ -74,9 +73,9 @@
   \everycr{}\let\\\@eqncr \let\@@eqncr\@@numc at cr
   \tabskip\@tempskipa
   \halign to\dimen at 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 at 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 at dispstyle ##\relax$\hfil 
     \tabskip\z at skip &% explanation
     \global\@eqcnt\tw@
     \numc at expstyle\quad ##\unskip\numc at expstyle\hfil % \unskip removes quad if no explanation
@@ -133,6 +132,11 @@
 
 \@ifundefined{c at parentequation}{% No AMS
 \def\numc at eqnnum{\@eqnnum}
+% for \tag (but not \tag*) without amsmath, using \@@numc at cr above.
+\def\numc at tag#1{\def\@currentlabel{#1}%
+  \gdef\df at 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 @@
 %  \subequations already defined;
 % use tag format
 \def\numc at eqnnum{\tagform@{\theequation}}    
+\def\numc at tag{\tag at in@align}
+
 % add little space after brace to amsmath's cases
-
 \def\@tempa{%
   \let\@ifnextchar\new at ifnextchar
   \left\lbrace
@@ -241,7 +246,7 @@
     \openup\jot
     \tabskip\z at skip 
     \halign \bgroup 
-      $\numc at dispstyle{##}\m at th$\hfil 
+      $\numc at dispstyle ##\m at th$\hfil 
       &\numc at expstyle\quad ##\unskip\numc at expstyle\hfil % \unskip removes space if no explanations
       \cr
  }{%



More information about the tex-live-commits mailing list.