Inside a macro I would like to establish a new type of float. One of the parameters to be set during that process is \ftype@TYPE, where TYPE is the float type: figure, table, and so on. I know, that \ftype@figure = 1 and \ftype@table = 2 normally are already set in the classes, e.g. report.cls, and I know, that each following float type gets a number, that is double the one before, so the next one would be 4, then 8, then 16 and so on.
What I don't know, though: How can one inside a macro find out, which is the highest float type number already in use -- for not using one twice?
\newfloatfromfloatpackage? – David Carlisle Jul 18 '23 at 23:43!htbpallowed positions are packed into a 32 bit integer each item contributing 1 bit ie 1 power of 2 – David Carlisle Jul 19 '23 at 01:55\newfloatfrom the float package does, so I was suggesting you use that. Core latex does not keep record of already allocated floats, a class just has to "know", so using the float (or its related newfloat) package to handle the allocation is best. – David Carlisle Jul 19 '23 at 15:27@ifundefined{c@figure}%
{\setcounter{float@type}{1}}%
{\setcounter{float@type}{4}}
So if I use that with a document, that has already defined a third float, number 4 will be used twice, as far as I see? – ThorstenL Jul 19 '23 at 15:45