From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/96673 Path: news.gmane.org!.POSTED!not-for-mail From: Mohammad Hossein Bateni Newsgroups: gmane.comp.tex.context Subject: Re: Algorithmic, Floats and line numbers. Date: Thu, 27 Oct 2016 11:59:00 -0400 Message-ID: References: <5810EF35.3070208@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5839429532576993009==" X-Trace: blaine.gmane.org 1477583998 17769 195.159.176.226 (27 Oct 2016 15:59:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Oct 2016 15:59:58 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Oct 27 17:59:53 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bzn5X-0001EW-2U for gctc-ntg-context-518@m.gmane.org; Thu, 27 Oct 2016 17:59:31 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9BF291BF0A; Thu, 27 Oct 2016 17:59:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3jtGUAJl252W; Thu, 27 Oct 2016 17:59:14 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id E36911BF0C; Thu, 27 Oct 2016 17:59:14 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id EB5381BF0A for ; Thu, 27 Oct 2016 17:59:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Usf80b5Hxmly for ; Thu, 27 Oct 2016 17:59:12 +0200 (CEST) Original-Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id B6C1E1BF06 for ; Thu, 27 Oct 2016 17:59:02 +0200 (CEST) Original-Received: by mail-oi0-f42.google.com with SMTP id n202so54886123oig.3 for ; Thu, 27 Oct 2016 08:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=8M0YbGdrhszQmMe/9eKwq5yO89N0tq8wXWr/jxYjNJA=; b=rDqLVFU5ILZVSCp0psob4N5isHXjLOWkGkWW6Yr5zxo9cPZRw6ud90kkIuIwsmtIlj AiVoMrygeZx3xaJ+TCMOgvNaNIGv4ni+ZvB2eG/IceMXDkHyue8enbCAISrxwTE9ziXW lSj1x3W5pEHBsFSpCWjJKYwOH4p3BMZYZodyAJ9te5gqf/KIntVaPzPgPlb5Ux5lBFE6 rGLWrdkhu8tQm4fU+hv8UayJLh3JBMWvXzl2hnmABvgvuXtL2SCw/6S9WPP2OOjvd90S 9N68MWPyr8G+gIxF57iwyLbGwEmy80Grl6AyVO/YjSC8AaAT5G2oFuTy9P7fbQTv1Swn E0Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=8M0YbGdrhszQmMe/9eKwq5yO89N0tq8wXWr/jxYjNJA=; b=ShvMqvc4QNiga4Ykuy/ZVxV27bIJHAK61i5HRrTZD2+8NpRpXLlzJ3A+e0BJp29stZ R81Wo/cAZZ6elkfRFjkjS85rv+YDImDjFTLZ4YypcBD0Y5VcXmjQPGiN1VmZZqJQ/+Zu EnrDMLzifrZBg+1tDbDr6Ygm0MzOlq6AwXGvzKvAPeiLPsSqKilpnkGyLXS/Y/BVDBrV ka3ZOxloPfeY75wrkUi15f3Ie1L1oRUgaq8TlqoQbHYtAIcgGkVSL5crgw47Qj5uSHG8 NWSaJZ2jGEfCZryT1E1hxuaKafQREpOEEu1lG0F8T22v3s0J08hB8ngU9KkfYKACrrpG 0ZAQ== X-Gm-Message-State: ABUngvd6agQ9NKl1Gctw5R+JtoUmZ8f3am+SRGwCr44s9QRhf1/+bfSDqCZOkCyrDCIIfmCrwrz00LP6gMMpFw== X-Received: by 10.202.58.2 with SMTP id h2mr8379646oia.115.1477583940835; Thu, 27 Oct 2016 08:59:00 -0700 (PDT) Original-Received: by 10.157.31.2 with HTTP; Thu, 27 Oct 2016 08:59:00 -0700 (PDT) In-Reply-To: <5810EF35.3070208@gmail.com> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:96673 Archived-At: --===============5839429532576993009== Content-Type: multipart/alternative; boundary=001a113cdbd0eb5fbc053fdad1c1 --001a113cdbd0eb5fbc053fdad1c1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable How does one reset the counter then? Normally one would like it to start from 1 within each algorithmic block. But definelabel seems to have bytext and bysection options only. On Wed, Oct 26, 2016 at 2:00 PM, Wolfgang Schuster < schuster.wolfgang@gmail.com> wrote: > Javier M Mora > 24. Oktober 2016 um 14:37 > Hi, I'm trying to use Algorithmic module with floating and line numbering= . > > In the first attempt, I get the "code" with lines numbered. But isn't > floating. > > In the second one, line numbers disappear inside the floating block. > > > Two questions: > > * How can I get line numbers inside floating block? > > You can=E2=80=99t use them in floats unless you add a frame around the co= ntent, > e.g. > > \startplacealgorithm > \startframedtext > \startlinenumbering > ... > \stoplinenumbering > \stopframedtext > \stopplacealgorithm > > * In algorithms, I think it has more sense to number only "logical" lines= . > The second state is so long that wraps into another line. Is it possible = to > number only logical lines? > > Not with linenumbering, what you need is counter which is inserted at the > begin of each line. > > \definelabel[algorithmicline][text=3D,alternative=3Dinleft] > > \definelines[algorithmic][command=3D\algorithmicline] > > \setuplayout[width=3D4cm] > > \showframe[text][text] > > \starttext > > \startalgorithmic > text > text text text text text text text text text text text text > text > \stopalgorithmic > > \stoptext > > Wolfgang > > ____________________________________________________________ > _______________________ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/ > listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ____________________________________________________________ > _______________________ > --001a113cdbd0eb5fbc053fdad1c1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
How does one reset the counter then?=C2=A0 Normally one wo= uld like it to start from 1 within each algorithmic block.=C2=A0 But define= label seems to have bytext and bysection options only.

On Wed, Oct 26, 2016 at 2:00 PM,= Wolfgang Schuster <schuster.wolfgang@gmail.com> w= rote:
24.=20 Oktober 2016 um 14:37
Hi, I'm=20 trying to use Algorithmic module with floating and line numbering.

In the first attempt, I get the "code" with lines numbered. B= ut=20 isn't=20 floating.

In the second one, line numbers disappear inside the floating block.


Two questions:

* How can I get line numbers inside floating block?
You can=E2=80=99t use them in floats unless you add a frame around the cont= ent,=20 e.g.

\startplacealgorithm
=C2=A0=C2=A0=C2=A0 \startframedtext
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \startlinenumbering
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ...
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \stoplinenumbering
=C2=A0=C2=A0=C2=A0 \stopframedtext
\stopplacealgorithm
* In algorithms, I think it has more sense to number only "logical"=20 lines. The second state is so long that wraps into another line. Is it=20 possible to number only logical lines?
Not with linenumbering, what you need is counter which is inserted at=20 the begin of each line.

\definelabel[algorithmicline][text=3D,alternative=3Dinleft]

\definelines[algorithmic][command=3D\algorithmicline]

\setuplayout[width=3D4cm]

\showframe[text][text]

\starttext

\startalgorithmic
text
text text text text text text text text text text text text
text
\stopalgorithmic

\stoptext

Wolfgang

_____________________________________________________________= ______________________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-context@ntg.nl / <= a href=3D"http://www.ntg.nl/mailman/listinfo/ntg-context" rel=3D"noreferrer= " target=3D"_blank">http://www.ntg.nl/mailman/listinfo/ntg-context=
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/cont= ext-mirror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
_________________________________________________________________= __________________

--001a113cdbd0eb5fbc053fdad1c1-- --===============5839429532576993009== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============5839429532576993009==--