Re: Sistema in cui ogni equazione e’ numerata

#5711
Up
0
Down
::


Ho postato lo stesso probelma sul NG francese ed ecco la risposta (a naso doveva essere facile ma proprio non ne uscivo da sola):

pacchetto cases con i suoi environnement numcases e subnumcases

Dal file .sty:

% C A S E S . S T Y ver 2.5 May 2002
%
% Copyright (C) 1993,1994,1995,2000,2002 by Donald Arseneau
% asnd@triumf.ca
% These macros may be freely transmitted, reproduced, or modified
% provided that this notice is left intact. Sub-equation numbering
% is based on subeqn.sty by Stephen Gildea; most of the rest is based
% on LaTeX’s \eqnarray by Leslie Lamport and the LaTeX3 team.
%
% This provides a LaTeX environment {numcases} to produce multi-case
% equations with a separate equation number for each case. There is
% also {subnumcases} which numbers each case with the overall equation
% number plus a letter [8a, 8b, etc.]. The syntax is
%
% \begin{numcases}{left_side}
% case_1 & explanation_1 \\
% case_2 & explanation_2 \\
% …
% case_n & explanation_n
% \end{numcases}
%
% Each case is a math formula, and each explanation is a piece of lr mode
% text (which may contain math mode in \(…\) or $…$). The explanations
% are optional. Equation numbers are inserted automatically, just as for
% the eqnarray environment. In particular, the \nonumber command suppresses
% an equation number and the \label command allows reference to a particular
% case. In a subnumcases environment, a \label in the left_side of the
% equation gives the overall equation number, without any letter.
%
% To use this package,
% include “\usepackage{cases}” after \documentclass. You may also
% specify “\usepackage[subnum]{cases}” to force *all* numcases
% environments to be treated as subnumcases.
%
% Question: Is there a {numcases*} environment for unnumbered cases?
% Answer: There is a {cases} environment in AMS-LaTeX, but it is just as
% convenient to stick with the canonical LaTeX array:
% \[ left side = \left\{ PROTECTED1 \right. \]
%
% Speaking of AMS-math, they use an entirely different system of equation
% numbering, and this package uses ordinary LaTeX numbering.
%
% – – – – –
% A simple example is:
% \begin{numcases}{|x|=}
% x, & for $x \geq 0$\\
% -x, & for $x < 0$ % \end{numcases} % % Giving: % / x for x > 0 (1)
% |x| = < - % \ -x for x < 0 (2) % % - - - - - % % Another example is calculating the square root of $c+id$. First compute % \begin{subnumcases}{\label{w} w\equiv} % 0 & $c = d = 0$\label{wzero}\\ % \sqrt{|c|}\,\sqrt{\frac{1 + \sqrt{1+(d/c)^2}}{2}} & $|c| \geq |d|$ \\ % \sqrt{|d|}\,\sqrt{\frac{|c/d| + \sqrt{1+(c/d)^2}}{2}} & $|c| < |d|$ % \end{subnumcases} % Then, using $w$ from eq.~(\ref{w}), the square root is % \begin{subnumcases}{\sqrt{c+id}=} % 0 & $w=0$ (case \ref{wzero})\\ % w+i\frac{d}{2w} & $w \neq 0$, $c \geq 0$ \\ % \frac{|d|}{2w} + iw & $w \neq 0$, $c < 0$, $d \geq 0$ \\ % \frac{|d|}{2w} - iw & $w \neq 0$, $c < 0$, $d < 0$ % \end{subnumcases}

Go to top