From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/17704 Path: main.gmane.org!not-for-mail From: Maurice Diamantini Newsgroups: gmane.comp.tex.context Subject: Re: algorithms style : need \starttyping with TeX and math feature Date: Mon, 3 Jan 2005 15:52:01 +0100 Message-ID: <067F33B3-5D97-11D9-B03E-000A9595B57C@ensta.fr> References: <41CC2657.7000508@guest.arnes.si> <200412251403.10518.john@wexfordpress.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1104764403 18146 80.91.229.6 (3 Jan 2005 15:00:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 3 Jan 2005 15:00:03 +0000 (UTC) Cc: Maurice Diamantini Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 03 15:59:50 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ClTgT-0003Sb-00 for ; Mon, 03 Jan 2005 15:59:49 +0100 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 79553127B4; Mon, 3 Jan 2005 15:59:48 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01185-02; Mon, 3 Jan 2005 15:59:47 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C5323127AB; Mon, 3 Jan 2005 15:59:46 +0100 (CET) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BFF12127AB for ; Mon, 3 Jan 2005 15:59:44 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01164-02 for ; Mon, 3 Jan 2005 15:59:43 +0100 (CET) Original-Received: from ns1.ensta.fr (unknown [147.250.10.1]) by ronja.ntg.nl (Postfix) with ESMTP id A7C79127A8 for ; Mon, 3 Jan 2005 15:59:43 +0100 (CET) Original-Received: from localhost (unknown [127.0.0.1]) by ns1.ensta.fr (Postfix) with ESMTP id B88003164DE for ; Mon, 3 Jan 2005 15:57:56 +0100 (CET) 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 27727-05 for ; Mon, 3 Jan 2005 15:57:23 +0100 (CET) Original-Received: from ensta.ensta.fr (ensta.ensta.fr [147.250.1.1]) by ns1.ensta.fr (Postfix) with ESMTP id 3DEED3164C5 for ; Mon, 3 Jan 2005 15:57:14 +0100 (CET) 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 j03Eur918839; Mon, 3 Jan 2005 15:56:53 +0100 In-Reply-To: <200412251403.10518.john@wexfordpress.com> Original-To: mailing list for ConTeXt users X-Mailer: Apple Mail (2.619) X-Virus-Scanned: by 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-Virus-Scanned: by amavisd-new at ntg.nl Xref: main.gmane.org gmane.comp.tex.context:17704 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:17704 Le 25 d=E9c. 04, =E0 20:03, John Culleton a =E9crit : > On Friday 24 December 2004 09:23, Mojca Miklavec wrote: >> Maurice Diamantini wrote: >>> Well I agree that it's no more "typing" any more! >>> So a special option for \setuplines would be more appropriate? >> >> Exactly, \starttyping does exactly that what you don't want: it=20 >> disables >> math and expansion of TeX commands. >> >>> Also, perhaps my request is simply an option of \startlines >>> which keep not only the lines break, but also the first >>> spaces of each line (in a verbatim font fors these space) Happy new year ! Thanks to Mojca and John, I use \startlines for the algorithms environment. In the "Algo" environment, I defined some short names command to help dealing with indent spacing (\0, \1, ..., \5) and with itemize like indent (i.e. space with the same length as "- " Here is the environment I defined. It could be better (to keep the use of it event simpler) But as the "p=E8re No=EBl" Hans give me a "Christmas present" (see next post) It is no more usefull! \definestartstop[Algo][ before=3D{ \start \tx \def\H{\phantom{- }}% H for Hyphen (espace correspondant =E0=20= "- " \def\0{\hskip0em} % indent 0 \def\1{\hskip2em} % indent 1 \def\2{\hskip4em} % indent 2 \def\3{\hskip6em} % indent 3 \def\4{\hskip8em} % indent 5 \def\5{\hskip10em} % indent 6 \setupinterlinespace[small] \startframedtext[ width=3D\makeupwidth, framecolor=3Dblue, ] \startlines }, after=3D{ \stoplines \stopframedtext \stop }, ] Just a "french like" algorithm \startAlgo \0 Entr=E9e : \1 - nom de l'instance =E0 traiter (e.g. ucp8, ...) \1 - LDS\_Limit Nombre maximum de discordances (e.g. 1 pour LDS\_1,=20 ...) \0 Sortie : \1 - affichage des meilleures solutions primale et duale \0 Algorithme : \1 - initialisation : \2 - LDS\_Counter :=3D 0 (nombre de discordances courantes) \2 - lecture de l'instance \2 - propagation initiale \1 - relaxation lagrangienne principale avec primalisations interne \1\H $\Rightarrow$ on connait bestDualValue, bestPrimalValue et les=20= co=FBts r=E9duits \1 - explorer le noeud racine (i.e. toutes les variables =E9tant = libres) \1 - afficher les r=E9sultats \stopAlgo Thanks you very much ! Maurice