In brief, the [h!] option to override the default float restrictions for tables and figures does not appear to work.

I am trying to insert a table that takes up a whole page. Due to its size, I have had to define it as a sidewaystable as follows:

      Column 1 & Column 2 & Column 3 & Column 4 \\
    \caption{A Caption}

No matter what I try to do, LaTeX always places it at the end of the document, after my bibliography (i.e. references). What's worse is that any table that I define after this, no matter how big or small, is also placed at the end of the document (after the problematic table).

I seem to have a similar problem with figures. While the [h!] option places some figures immediately after the paragraph I have referenced them in (as expected), LaTeX places other figures one or two pages following the referencing paragraph.

If it helps any, I am using the following document class:

\documentclass[JMC]{degruyter-journal}   % Journal of Mathematical Cryptology

I am also using the following packages:

  • Do you receive any overfull box warnings? How about adding a \clearpage immediately after the the figure environment? Since the figure will be a full page, does using the float specifier p help? Also, since you're loading the float package, you could use the provided H specifier which is more strict than !h. – Werner Nov 15 '11 at 3:13
  • @Werner - No overfull warnings, however, I do receive underfull warnings for each hbox that is defined (badness 10000). I also seem to get the following warning generated for the table, and each of the figures I have inserted into the document: LaTeX Warning: '!h' specifier changed to '!ht'. – Bill Nov 15 '11 at 3:22
  • @Werner - P.S. Adding a \clearpage immediately after the figure environment, or using the p specifier places the figure on a separate page. Furthermore, using the H specifier for the problematic table causes it to disappear from the document altogether!!!! – Bill Nov 15 '11 at 3:31

I've found the following set of instructions works well in the circumstances you describe; I use the \afterpage command provided by the afterpage package.

\begin{sidewaystable} % no need for the [h] or even [h!] specifier
\centering % better than \begin{center} ... \end{center}
\caption{xyz} \label{tab:xyz}
\clearpage } % note the "}" to denote the end of the argument of \afterpage

The key is the use of \clearpage commands both before and after the sideways{figure/table} environment.

  • Thanks! This not only has solved the problem with the large table. It appears to have fixed the problem with other figures/tables in the document. Once again, thank you! – Bill Nov 15 '11 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.