# How do I make custom float environments use the same numbering for captions.

I use a custom float environment that is basically used as a table environment that provides extra formatting. I would like this environment to use the same numbering as the regular table floats. Is there a way to do that? I have already changed the floatname to match Table by using the floatname command. Here is my initialization code:

\newfloat{newtable}{tbp}{lop}[chapter]
\floatname{newtable}{Table}


Regular tables numbering also span over chapters... do you have any ideas?

-

If you're doing this only to get a second table environment with different formatting, why don't you simply define it in terms of the existing table? For example something like

\newenvironment{newtable}{\table[opts]\formatting\stuff}{\endtable}

-
Or if the OP must use a new float for whatever reason, another option is to define a wrapper environment newnewtable which in its initialization \setcounter{newtable}{table} before loading newtable, and in its end \setcounter{table}{newtable} after ending newtable. –  Willie Wong Oct 13 '10 at 13:54
I kind of need the float functionalities [hbt]... I asked in a previous question how to pass on the [opts] in a new environment and the solution which I got was to use floats... With what you are proposing I would be stuck with the same problem/question... –  levesque Oct 13 '10 at 14:39
I see, I've just posted a new answer there. –  Juan A. Navarro Oct 13 '10 at 15:18

A hackish solution - possibly with adverse effects - is to increment the table counter after a newtable environment and vice versa.

\documentclass{book}

\usepackage{float}
\newfloat{newtable}{tbp}{lop}[chapter]
\floatname{newtable}{Table}

\makeatletter
\makeatother

\begin{document}

\chapter{A chapter}

\begin{table}[!ht]
\caption{A table}
\end{table}

\begin{newtable}[!ht]
\caption{A newtable}
\end{newtable}

\begin{table}[!ht]
\caption{Another table}
\end{table}

\end{document}

-