From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79957 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: framed algorithm / float: problems with line break Date: Tue, 18 Dec 2012 11:17:07 +0100 Message-ID: <24A3C8C9-0CDB-4C7E-825E-F4069280E0B2@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1355825843 10853 80.91.229.3 (18 Dec 2012 10:17:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Dec 2012 10:17:23 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Dec 18 11:17:35 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TkuEs-0006VH-2c for gctc-ntg-context-518@m.gmane.org; Tue, 18 Dec 2012 11:17:30 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3662B101F2; Tue, 18 Dec 2012 11:17:16 +0100 (CET) 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 tcAjlJusoQFU; Tue, 18 Dec 2012 11:17:13 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 75A8110227; Tue, 18 Dec 2012 11:17:13 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DEEFE10227 for ; Tue, 18 Dec 2012 11:17:11 +0100 (CET) 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 xCidvjM999lW for ; Tue, 18 Dec 2012 11:17:10 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id D360E101F2 for ; Tue, 18 Dec 2012 11:17:10 +0100 (CET) Original-Received: from mail-bk0-f48.google.com (mail-bk0-f48.google.com [209.85.214.48]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qBIAH6nx001317 for ; Tue, 18 Dec 2012 11:17:08 +0100 Original-Received: by mail-bk0-f48.google.com with SMTP id jc3so187460bkc.21 for ; Tue, 18 Dec 2012 02:17:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=4stkvHJB39QWkns5dpWJbM0UEogdhbrGaI1ciz2fx4M=; b=1BVw1ZkR1gtwTiWXae80jVn0bZV1th1d9OEPaLx/JBWw88JAOwh9aZaEUSqSTRt1ZX n9pXrDQVXPPS02hk3n+xXCrDgGLwU6dxj9fE84vs70N/yK1DS5dyHD4aKAGYcytsocy7 KY88cN+LMfnyHibD6A9tgBZEHAxj7tigR2rXOcVZmvqTjZ6RuBLFiI5WV2L+jZkC6Wcv pEb/43hE2b63a6cEm8DB5zMTss7UDbkDMRwsnHaJLIQsB11EEv35MMyJeZ+N63EIe9Lu wcTc0Fl+1vl5SdgUkYXS5F/zXmV1I1bNEh8N4MLLH0UxjOqdhZfUpRz9wEj3XEUHrQph DTMQ== X-Received: by 10.204.156.11 with SMTP id u11mr492272bkw.106.1355825826189; Tue, 18 Dec 2012 02:17:06 -0800 (PST) Original-Received: from keima.localdomain (nrbg-4dbfb363.pool.mediaWays.net. [77.191.179.99]) by mx.google.com with ESMTPS id hm8sm741113bkc.10.2012.12.18.02.17.04 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Dec 2012 02:17:05 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.1499) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.48; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0TIAWh6w5 - 320b6ed4a422 - 20121218 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 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-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79957 Archived-At: Am 17.12.2012 um 13:14 schrieb Andreas Mang : > Dear all, > = > Quick access: there is no line break in case algorithmic is used together= with framed as a float. > = > I'd like to put some pseudocode in my document. I've used the algorithmic= module. Since I'd like to refer to the algorithm in the text, I've defined= a float environment. However, putting the pseudocode into my document, I'v= e realised that it does not really stand out from the text. My first idea w= as to put some box around it. In the garden I've found some example for usi= ng framed together with floats: > = > http://wiki.contextgarden.net/Framed > = > However, this screws up the line break in the algorithmic environment. I = could define manually the size of the box, but I think there might be bette= r solutions. Any ideas or better ways for achieving this or a similar behav= iour?! > = > Thanks in advance. > = > Cheers, > Andreas = > = > ConTeXt ver: 2012.12.10 23:20 MKIV fmt: 2012.12.14 > = > %%% MINIMAL EXAMPLE %%% > \usemodule[algorithmic] > = > = > \definefloat[algorithm][algorithms] = > = > \setuplabeltext[de][algorithm=3DAlgorithmus ] > = > \setupcaption[algorithm][ > headstyle=3Dbold, > location=3Dtop, > width=3D0.95\textwidth] > = > = > \starttext > = > \placealgorithm[top][alg:some-algorithm]{Some description of some algorit= hm.}{ > \framed > [background=3Dcolor,backgroundcolor=3Ddarkblue, > foreground=3Dcolor,foregroundcolor=3Dwhite,width=3Dbroad]{ You have to add =93align=3Dright=94 to \framed to force a multiline frame b= ut you don=92t need the command because floats do also use the \framed command. You can use thi= s feature and set the background with \setupfloat, only the text color can=92t be set= with \setupfloat because it=92s applied to late in the process and a manual setting is neces= sary. I can add a =93color=94 key to the algorithmic environment which allows you= to set the color with \setupalgorithmic and you don=92t need the \white command after \start= algorithmic anymore. \usemodule[algorithmic] \definefloat[algorithm][algorithms] = \setuplabeltext[de][algorithm=3DAlgorithmus ] \setupcaption [algorithm] [headstyle=3Dbold, location=3Dtop, width=3D0.95\textwidth] \setupfloat [algorithm] [background=3Dcolor, backgroundcolor=3Ddarkblue] \starttext \placealgorithm[top][alg:some-algorithm]{Some description of some algorithm= .} {\startalgorithmic\white \STATE choose $\alpha\in(0,1)$ \WHILE{$\alpha < 100$} \STATE $\alpha \leftarrow \alpha + \alpha$ \ENDWHILE \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 / 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 ___________________________________________________________________________= ________