From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/96667 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Algorithmic, Floats and line numbers. Date: Wed, 26 Oct 2016 20:00:21 +0200 Message-ID: <5810EF35.3070208@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3251745648283813504==" X-Trace: blaine.gmane.org 1477504885 11986 195.159.176.226 (26 Oct 2016 18:01:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Oct 2016 18:01:25 +0000 (UTC) User-Agent: Postbox 5.0.5 (Macintosh/20161020) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Oct 26 20:01:16 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 1bzSVd-0001JM-EH for gctc-ntg-context-518@m.gmane.org; Wed, 26 Oct 2016 20:01:05 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 97F7A1BC37; Wed, 26 Oct 2016 20:00:42 +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 1g7EPj-hlMxD; Wed, 26 Oct 2016 20:00:40 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id B43571BC38; Wed, 26 Oct 2016 20:00:40 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7A3021BC36 for ; Wed, 26 Oct 2016 20:00:39 +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 UCjLqptmtvq2 for ; Wed, 26 Oct 2016 20:00:36 +0200 (CEST) Original-Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) (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 D04D21BC35 for ; Wed, 26 Oct 2016 20:00:26 +0200 (CEST) Original-Received: by mail-wm0-f48.google.com with SMTP id b80so238378461wme.1 for ; Wed, 26 Oct 2016 11:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to; bh=4sapjDsObWB48Mls1WhUSvPCZ9XG0EOa0Jp2cUO6Z0g=; b=hAwTkQZbIJ0xXvtGHyZte8nMHVi5RXsfYLscpkf15AQHX+JpJbeC+svfrtCCVBBlM2 0fR3bWNPT/3JzBIpZMuQKz2H1JwgvQAFq5E3p86sBNqexiQlM7bEqk69xAbJaS6AV+Xd bxP6NphMKccaRQqsh3KJoMBVC8bXY8QsUhcvW6ZI9avJUGG1n80Z7yWxhnmaMtRnQPWp TtxUyjVc8ZT5XqahvsfI+/oXQc5A5A/BVnepC1axm43uC3mpd7Rf7fDSbLkLm/Qe3Hh3 RtOQY8mB1JX9pbYbLfOZZTe6GUb75VeDByEQDy5ZKMrtoiE0EVAKSYiObS/vYnw+/2i9 9vsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to; bh=4sapjDsObWB48Mls1WhUSvPCZ9XG0EOa0Jp2cUO6Z0g=; b=fv17esGUhzNdpD1QJbiir0/tfRm1UKXvSBOa3maGikKcpiZ9bH/VNyHxlIDc3g+a7A C29AW5r3FBj30QriCZ69On4CFH5JDjdYtRF9jKSBRM0Dt7AWrxsORCthAPy9l80ds+9A 96AwbXMplv9l/tdmFjDTxHmW8zLyFzoH6MMQp6anaUdT0MHY3YvPQt8y8gEIMzociAQp gZAnRYS2aGs4JIqKoNho7zwNSziKGEu7eRTOlZwJK5rhrwxtyxUJ07rQMwzW/+pxEE9x 9QRMNutubSWA2Utf0Vuy3NeFqiBJ3uXc/Mo/5VCbzTTZOl6Z7U5UgkjgBoOF1Vq38kR9 5uwA== X-Gm-Message-State: ABUngvfb+INFIgmRZPXmfyehiZVzFbYtoWdo9536ibaWM9iZxxZhBaDHvOadVVSJjkdggQ== X-Received: by 10.194.82.163 with SMTP id j3mr3903346wjy.56.1477504824969; Wed, 26 Oct 2016 11:00:24 -0700 (PDT) Original-Received: from keima.localdomain (x2f275b8.dyn.telefonica.de. [2.242.117.184]) by smtp.gmail.com with ESMTPSA id w1sm3868375wje.36.2016.10.26.11.00.23 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Oct 2016 11:00:24 -0700 (PDT) In-Reply-To: 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:96667 Archived-At: This is a multi-part message in MIME format. --===============3251745648283813504== Content-Type: multipart/alternative; boundary="------------040208020201040401020304" This is a multi-part message in MIME format. --------------040208020201040401020304 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit > 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’t use them in floats unless you add a frame around the content, 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=,alternative=inleft] \definelines[algorithmic][command=\algorithmicline] \setuplayout[width=4cm] \showframe[text][text] \starttext \startalgorithmic text text text text text text text text text text text text text text \stopalgorithmic \stoptext Wolfgang --------------040208020201040401020304 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
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’t use them in floats unless you add a frame around the content, 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=,alternative=inleft]

\definelines[algorithmic][command=\algorithmicline]

\setuplayout[width=4cm]

\showframe[text][text]

\starttext

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

\stoptext

Wolfgang
--------------040208020201040401020304-- --===============3251745648283813504== 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 --===============3251745648283813504==--