I have a figure and and a table and I want to make sure they both appear on the same page. I want both objects to keep their natural numbering and captioning: The Figure should be captioned Figure 1.2.3: Text
and the Table should be captioned Table 1.2.3: Text 2
. Currently, I specified [pt]
as placement for both, but this (of course) does not what I need.
I know the following two solutions:
- Use
\subfloat
- Use a single
figure
and put both, the table and the figure in this figure and using\caption
twice.
Both solution do not lead to the captioning I need: The first solution generates a single figure and the second one creates two figures. I need a Figure and a Table for the captions.
Best Answer
I gather that the
figure
should be at the very top of a page, to be followed immediately by thetable
environment. (Moreover, I'm taking for granted that the two environments will actually fit on a single page, right?)You could achieve these objectives by loading the
afterpage
package and "encasing" thefigure
andtable
environments in an\afterpage{...}
statement, as is shown in the following code fragment:I'm further assuming that there are no deferred figure and/or table environments already waiting to be typeset. If that were the case, you should issue a
\clearpage
instruction as the very first item in the argument of the\afterpage
command. (Even if there are no accumulated deferred floats to take care of, there's no harm done by issuing a\clearpage
instruction anyway at the start of the\afterpage
material; it would simply be ignored by TeX.)In addition, if the figure and table environments combined take up most of the page (say, more than 75% of the page), you may also want to issue a second
\clearpage
instruction, following the end of thetable
environment. This will tell LaTeX that you want to have just those two floats on the page in question.