Re: multi page Algorithm Floats ?

2009-08-28 Thread Helge Hafting

Jaime Huerta Cepas wrote:

Hi all,

I wonder if there is any way of allowing Algorithm Float boxes to start in
the middle of one page, and end in the next one. I'm using these kind of
floats to include pieces of highlighted source code, so I guess text could
be perfectly splitted.


Then a float is not what you need. Floats float around, precisely 
because they need to stay in one piece. (table, picture, ...)


If your algorithm can be split, then it don't need a float.
Write your algorithm, just don't insert a float and you'll be fine.

If you want nice formatting for your algorithm, consider
"Insert->Program Listing" Listings are nice for computer code and 
similiar stuff. You can specify fonts, you can have syntax highlighting,

you can have automatic line numbering if you like. Just right-click the
listing box, and you'll see all the options.

You can type listings into your document, but a listing may also get its 
content from (parts of) an external file. (Insert->File->child document, 
set the type to "listing") This makes it possible to
list parts of actual source code. That way, the working code and the 
document is always in sync - because the same file is used for both. No 
need to fix the document after fixing a bug. :-)


Helge Hafting


Re: multi page Algorithm Floats ?

2009-08-26 Thread Jaime Huerta Cepas
True. It seems that Floats, by definition, cannot be split into two pages.
Given that I don't need a real float for inserting my example code snippets,
I found a better solution than manual separation of content.
I'm now using an environment that mimics an algorithm float:

 \newcounter{code}

\newenvironment{CodeEnv}[1] {

\stepcounter{code}

\vspace{1ex} \hrule \vspace{1ex}

\textbf{Example \thecode }

\vspace{1ex} \hrule \vspace{1ex}

#1

\vspace{1ex} \hrule

}


Then, you can do add things like this at any part of your document:
\begin{CodeEnv} MyCodeExample \end{CodeEnv}

Note that MyCodeExample can be a verbatim area, a "listing" code , or
similar stuff. In my case I'm inserting an ExternalProgramListing as
explained here: http://wiki.lyx.org/Examples/IncludeExternalProgramListing,
and it works great!.

I only miss captions

Jaime.


On Wed, Aug 26, 2009 at 9:22 AM, Luca Carlon  wrote:

> Jaime Huerta Cepas  writes:
>
> >
> > Hi all,
> >
> > I wonder if there is any way of allowing Algorithm Float boxes to start
> in
> > the middle of one page, and end in the next one. I'm using these kind of
> > floats to include pieces of highlighted source code, so I guess text
> could
> > be perfectly splitted.
> >
> > Thanks!
> > Jaime
> >
>
> I tried to find a solution to this too, but it seems the only way is to
> manually
> split the algorithm in two floats (this is what I do), or to use just the
> lyx
> code paragraph style. Bye!
>
>


-- 
=
Jaime Huerta-Cepas, Ph.D.
CRG-Centre for Genomic Regulation
Doctor Aiguader, 88
PRBB Building
08003 Barcelona, Spain
http://www.crg.es/comparative_genomics
=


Re: multi page Algorithm Floats ?

2009-08-26 Thread Luca Carlon
Jaime Huerta Cepas  writes:

> 
> Hi all,
> 
> I wonder if there is any way of allowing Algorithm Float boxes to start in
> the middle of one page, and end in the next one. I'm using these kind of
> floats to include pieces of highlighted source code, so I guess text could
> be perfectly splitted.
> 
> Thanks!
> Jaime
> 

I tried to find a solution to this too, but it seems the only way is to manually
split the algorithm in two floats (this is what I do), or to use just the lyx
code paragraph style. Bye!



multi page Algorithm Floats ?

2009-08-25 Thread Jaime Huerta Cepas
Hi all,

I wonder if there is any way of allowing Algorithm Float boxes to start in
the middle of one page, and end in the next one. I'm using these kind of
floats to include pieces of highlighted source code, so I guess text could
be perfectly splitted.

Thanks!
Jaime