From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/62411 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Stefan_M=FCller?= Newsgroups: gmane.comp.tex.context Subject: Re: Verbatim typing with numbers inside float Date: Thu, 07 Oct 2010 00:02:28 +0200 Message-ID: <4CACF1F4.8030201@gmx.de> References: <4CAC870B.3010605@gmx.de> <4CACDAEA.4010508@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1286402607 16734 80.91.229.12 (6 Oct 2010 22:03:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 6 Oct 2010 22:03:27 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Oct 07 00:03:25 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P3c56-0001w1-Gg for gctc-ntg-context-518@m.gmane.org; Thu, 07 Oct 2010 00:03:24 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9638CCA71E; Thu, 7 Oct 2010 00:03:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VBofRfLaeF+h; Thu, 7 Oct 2010 00:03:20 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id ADDBFCA70C; Thu, 7 Oct 2010 00:03:20 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0C78ECA70C for ; Thu, 7 Oct 2010 00:03:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id UbBE196ePeG3 for ; Thu, 7 Oct 2010 00:03:16 +0200 (CEST) Original-Received: from filter5-ams.mf.surf.net (filter5-ams.mf.surf.net [192.87.102.73]) by balder.ntg.nl (Postfix) with ESMTP id 30E79CA70A for ; Thu, 7 Oct 2010 00:03:16 +0200 (CEST) Original-Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.23]) by filter5-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with SMTP id o96M3FU6012863 for ; Thu, 7 Oct 2010 00:03:15 +0200 Original-Received: (qmail invoked by alias); 06 Oct 2010 22:03:15 -0000 Original-Received: from 77-64-199-171.dynamic.primacom.net (EHLO [192.168.100.108]) [77.64.199.171] by mail.gmx.net (mp047) with SMTP; 07 Oct 2010 00:03:15 +0200 X-Authenticated: #11064435 X-Provags-ID: V01U2FsdGVkX180arIXng40mjK+hQVg3x/QrZvWJWNNe07KXdkWZ6 ypZI4LsTmkmjTj User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 In-Reply-To: <4CACDAEA.4010508@wxs.nl> X-Y-GMX-Trusted: 0 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.165.64.23; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0BDfy3f5o - d5b6d666623b - 20101007 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.73 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:62411 Archived-At: On 06.10.2010 22:24, Hans Hagen wrote: > On 6-10-2010 4:26, Stefan M=FCller wrote: >> Hi list, >> >> I defined a float for typesetting algorithms, so I can reference them at >> other places in the document. >> >> \definefloat[algorithm][algorithms] >> >> When I now place such a figure with >> >> \placealgorithm[here][alg:myalgorithm]{Very neat algorithm.}{ >> \starttyping >> some source code >> \stoptyping >> } >> >> then the numbering I set up with >> >> \setuptyping[numbering=3Dline] >> \setuplinenumbering[location=3Dtext] >> >> is gone. Is there a way to get around this? I try to not use itemize for >> this (although it seems to work with itemize), because I'd rather use >> the more semantically correct approach. Any help appreciated. > > this sort of works > > \startbuffer > some source code > some source code > some source code > \stopbuffer > > \setuplinenumbering[style=3D\ttx,distance=3D0em,width=3D1em] > > \startsetups algorithm > \startlinenumbering > \setuptyping[file][before=3D,after=3D] > \framed[strut=3Dno,align=3Dnormal,frame=3Doff]{\typebuffer} > \stoplinenumbering > \stopsetups > > \placealgorithm > [here][alg:myalgorithm] > {Very neat algorithm.} > {\directsetup{algorithm}} > > > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com > | www.pragma-pod.nl > ----------------------------------------------------------------- > Thank you very much for your effort. Pretty amazing what's doable. = Unfortunately there are two issues: The distance between numbers and = source lines is too small for bigger line numbers. I just have to make = "distance=3D0em" big enough for this to work, right? The other thing: The width available for the caption is capped by the = width of the longest source line. I think I prefer the source lines to = start at the left margin. In addition there is something else I didn't think of when I put up that = mail (sorry for that). If I put (a very long piece) source inside a = figure I won't have pagebreaks, right? So this makes me think it's = probably not what I'm looking for. Splitting up long source code in several pieces (one per page) and put = them in separate figures doesn't seem right to me. Setting it as = numbered paragraph? Putting up a fake caption with \placefloatcaption = (which doesn't seem to work in MkIV)? Are there other possiblities of = numbering (by section) more or less big chunks of source code I'm not = thinking of? That would help me very much. Thanks for thinking about that. Best regards, Stefan. ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________