ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* framed algorithm / float: problems with line break
@ 2012-12-17 12:14 Andreas Mang
  2012-12-18 10:17 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Mang @ 2012-12-17 12:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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've realised that it does not really stand out from the text. My first idea was to put some box around it. In the garden I've found some example for using 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 better solutions. Any ideas or better ways for achieving this or a similar behaviour?!

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=Algorithmus ]

\setupcaption[algorithm][
	headstyle=bold,
	location=top,
	width=0.95\textwidth]


\starttext

\placealgorithm[top][alg:some-algorithm]{Some description of some algorithm.}{
\framed
  [background=color,backgroundcolor=darkblue,
   foreground=color,foregroundcolor=white,width=broad]{
\startalgorithmic
	\STATE choose $\alpha\in(0,1)$
	\WHILE{$\alpha < 100$}
		\STATE $\alpha \leftarrow \alpha + \alpha$
	\ENDWHILE
\stopalgorithmic
}
}

\stoptext
%%% MINIMAL EXAMPLE %%%

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-18 10:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-17 12:14 framed algorithm / float: problems with line break Andreas Mang
2012-12-18 10:17 ` Wolfgang Schuster
2012-12-18 10:41   ` Andreas Mang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).