From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/20406 Path: news.gmane.org!not-for-mail From: Maurice Diamantini Newsgroups: gmane.comp.tex.context Subject: sample of using \startarray (long) was: Math startarray and \cases{xxx} bug? Date: Tue, 17 May 2005 17:36:48 +0200 Message-ID: <8A92F369-4013-45C9-B6EF-C1B0C6368979@ensta.fr> References: <1A7D71A6-E93B-473E-9746-0D9D4455A850@ensta.fr> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v728) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1116344371 27260 80.91.229.2 (17 May 2005 15:39:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 17 May 2005 15:39:31 +0000 (UTC) Cc: Maurice Diamantini Original-X-From: ntg-context-bounces@ntg.nl Tue May 17 17:39:19 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1DY485-00087k-K9 for gctc-ntg-context-518@m.gmane.org; Tue, 17 May 2005 17:37:09 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2FA7E127FB; Tue, 17 May 2005 17:37:44 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15191-05-4; Tue, 17 May 2005 17:37:39 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DD34512797; Tue, 17 May 2005 17:37:39 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8ACF312797 for ; Tue, 17 May 2005 17:37:38 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15191-05-3 for ; Tue, 17 May 2005 17:37:37 +0200 (CEST) Original-Received: from ns1.ensta.fr (ns1.ensta.fr [147.250.10.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4EFE3126F8 for ; Tue, 17 May 2005 17:37:37 +0200 (CEST) Original-Received: from localhost (localhost.ensta.fr [127.0.0.1]) by localhost.ns1.ensta.fr (Postfix) with ESMTP id D5FFC313CAD for ; Tue, 17 May 2005 17:36:39 +0200 (CEST) Original-Received: from ns1.ensta.fr ([127.0.0.1]) by localhost (ns1.ensta.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 67559-57 for ; Tue, 17 May 2005 17:36:37 +0200 (CEST) Original-Received: from ensta.ensta.fr (ensta.ensta.fr [147.250.1.1]) by ns1.ensta.fr (Postfix) with ESMTP id B27C131417B for ; Tue, 17 May 2005 17:36:37 +0200 (CEST) Original-Received: from [147.250.33.133] (mac-oc1 [147.250.33.133]) by ensta.ensta.fr (8.11.6/9.11.6) with ESMTP id j4HFaJr16095; Tue, 17 May 2005 17:36:19 +0200 In-Reply-To: <1A7D71A6-E93B-473E-9746-0D9D4455A850@ensta.fr> Original-To: mailing list for ConTeXt users X-Mailer: Apple Mail (2.728) X-Virus-Scanned: amavisd-new at ensta.fr X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:20406 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:20406 Le 13 mai 05 =E0 16:16, Maurice Diamantini a =E9crit : > Bonjour =E0 tous, > > I'm using amsl module, but it seems there is a probleme > with the startarray/stoparray environment which apear with the "t" > type of column (t for text) and the \\ > So the basic cases commande doesn't work. Thanks to Otared Kavian, things are OK now ;-) There are still pb with the behavior of \\ which should be replaced with \cr, and (variants of) \startcases which are not consistents with the cases{} tex command. But here are some samples of way to use \startarray and some \cases{} The few things I'll try to remember are: - TeX is your friend (don't think in LaTeX) e.g. \matrix command is is a core usefull command, \cr instead of =20= \\, ... - \startarray could be the more powerfull ConTeXt command about =20 mathematiques can be (and is) use to build some other commands - but this later command seems to not be embedable in another =20 \startarray command and lacks of some documentations (exemples on how to ajust =20 spaces, ...) Also is there a mean (a wiki page?) where to start building a =20 collection of mathematics exemples using ConTeXt ? - home to print the doc in newmat.tex ? Cordialement, -- Maurice Diamantini %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \enableregime[il1] \useencoding[ffr] \mainlanguage[fr] \setuppapersize[A4] \setuplayout[% topspace=3D1.0cm, backspace=3D2.0cm, % header=3D2.0cm, % footer=3D1.0cm, % margin=3D1.2cm, % margindistance=3D3mm, % defaut =3D 5mm width=3Dmiddle, height=3Dmiddle% ] \usemodule[amsl] % \usemodule[nath] \starttext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Utilisation de startarray/stoparray (t-amsl.tex version 2004.11.18) % % DECONSELLE ! % \startarray{xx...} ou { | x | x | ... |} % aaa & bbb & ccc \\ % aaa & bbb & ccc \\ % aaa & bbb & ccc % \stoparray % % CONSEILLE % \startarray{xx...} ou { | x | x | ... |} % aaa & bbb & ccc \cr % aaa & bbb & ccc \cr % aaa & bbb & ccc \cr % \stoparray % % Le pr=C8ambule {xxx...} : % ---------------------- % lrc =3D left, right, center % d =3D> left avec \displaymath % t =3D> left en texte (dans \text{...}) % On peut compenser l'effet de l ou r par \hfil % ou inverser cet effet par \hfill % % Les variantes de cases utilisent un array pr=C8c=C8d=C8s d'une = accolade % % \startcases utilise startarray{ll} % \startbigcases utilise startarray{dl} % mais % \cases{...} utilise startarray{lt} % % BUG de array ? % le caractere t (text) semble ne pas fonctionner ! % NON, mais il faut utiliser \cr au lieu de \\ en fin de ligne % et ne pas oublier le dernier \cp de la dern=CBre ligne !! % \section{Example of \type{\case} with or without \type{\displaystyle}} \subsection{Without \type{\displaystyle}} \startbuffer \startformula {\bf f(x)} =3D \cases{ \sum_{x=3D1}^n x & if I am true \cr \sum_{x=3D1}^n y & \quad if I am false \cr 0 & \quad if I don't know \cr } \stopformula \stopbuffer \getbuffer \typebuffer \subsection{With \type{\displaystyle}} \startbuffer \startformula {\bf f(x)} =3D \cases{ \displaystyle \sum_{x=3D1}^n x & if I am true \cr \displaystyle \sum_{x=3D1}^n y & \quad if I am false \cr \displaystyle 0 & \quad if I don't know \cr } \stopformula \stopbuffer \getbuffer \typebuffer \page \section{Example of \type{\startbigcases} with or without strut} \subsection{Using \type{\startbigcases}} Note the needed of \type{\text} as \type{\startbigcases} behavior isn't the sames as \type{\cases}. \startbuffer \startformula {\bf f(x)} =3D \startbigcases \sum_{x=3D1}^n x & \quad\text{if I am true} \cr \sum_{x=3D0}^n y & \quad\text{if I don't know} \cr 0 & \quad\text{if I am false} \cr \stopbigcases \stopformula \stopbuffer \getbuffer \typebuffer \subsection{Adding \type{\strut} to make the vertical spacing better} Note the needed of \type{\text} as \type{\startbigcases} behavior isn't the sames as \type{\cases}. \startbuffer \def\STR{\vrule height3.5ex depth1ex width0pt} \startformula {\bf f(x)} =3D \startbigcases \sum_{x=3D1}^n x & if I am true \cr \sum_{x=3D0}^n y & \quad\text{if I don't know} \cr \STR 0 & \text{if I am false} \cr \stopbigcases \stopformula \stopbuffer \getbuffer \typebuffer \page \section{Standard use of \type{\startarray}} % \setuptyping[style=3D\small] % give bad results ! (no more typing = font) \startbuffer \startformula {\bf e_u(t)} =3D \left\{ \startarray{dllt}% ou bien : \startarray{| d | l | r | l} \sum_{x=3D1}^n f(x) & =3D ax^2 + b.x + c & =3D a & \quad here some text \cr y^2 + z & =3D 3ax^3 + 3ax^2 + b.x + c & =3D \hfill b & \cr h(x) & =3D \hfil y_i & =3D a + b & \quad encore du $(x^2)$ texte \cr \stoparray \right. \stopformula \stopbuffer \getbuffer \typebuffer \page \section{Combining arrays} Array inside array doesn't seem to work. On should use \type{matrix} from \TeX{} for this purpose. \startbuffer \def\TMPSTRUT{{\vrule height3ex depth2ex width0pt}} \def\TMP{{ \left| \matrix{ \tx p_u(t) \in {\cal P}_u \hfill \cr \tx u \in U \hfill \cr } \right.%| }} \startformula {\bf e_u(t)} =3D \left\{ \startarray{dllt} \sum_{\TMP}^n f(x) & =3D ax^2 + b.x + c & =3D a & \quad here some text \cr\TMPSTRUT y^2 + z & =3D 3ax^3 + 3ax^2 + b.x + c & =3D \hfill b & \cr\TMPSTRUT h(x) & =3D \hfil y_i & =3D a + b & \quad encore du $(x^2)$ texte \cr \stoparray \right. \stopformula \stopbuffer \getbuffer \typebuffer \stoptext %%%%%%%%%%%%%%%%%%%%%%