[texhax] create float based on longtable?

Ulrike Fischer news3 at nililand.de
Mon Feb 1 20:16:19 CET 2010

Am Thu, 28 Jan 2010 18:38:22 +0100 schrieb Christoph Haug:

> But let's assume for a moment that I decide manually, which examples
> should float (the small ones) and which dont (the long ones). How do I
> manage that both my floating and my non-floating examples use the same
> caption numbering and are listed in the same "list of examples"?

You can get problems with the numbering when you mix "fixed floats"
and "real floats":

Apart from this: you can get captions outside "real" floats e.g.
with the caption package and \captionof. caption allows you also to
define new float/caption types. 

> Before I can even think about that question, I need to know how I can
> tell longtable or supertabular that it should use the "Example" as a
> caption rather than "Table" and use the corresponding list. Or
> rather---instead of changing the longtable environment---how do I
> create a "duplicate" of longtable (or supertabular) which behaves like
> an example (except that it doesn't float?

longtable use the table counter and inserts its caption in the
listoftables. This behaviour is quite hardwirded. You would have to
hack the code to change it. You can't use \captionof inside a
longtable, but you could try \captionof together with longtable*
(which doesn't change the table counter):

\DeclareCaptionType{exa}[Example][List of Examples]

\captionof{exa}{Caption 1}


Be beware that page breaks between the caption and longtable are

Ulrike Fischer 

More information about the texhax mailing list