Graphics, Figures & TablesTable ends up at the end of the document

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Isopropyl
Posts: 29
Joined: Thu Sep 24, 2009 10:49 pm

Table ends up at the end of the document

Post by Isopropyl »

Hi,

in my current document I have a sidewaystable that spans a whole page. It is inserted with the placement option "[h]". However, as LaTeX obviously tries to find the best spot for it, it gets pushed back, every time I add new text.

How can I make the text kind of "float around" the table? It would be very inconvenient if all my tables ended up at the end of the document just because they take a whole page...

Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Table ends up at the end of the document

Post by Stefan Kottwitz »

Hi,

you could insert \clearpage to force the output of the table, or

Code: Select all

\afterpage{\clearpage}
using the afterpage package.

Stefan
LaTeX.org admin
Isopropyl
Posts: 29
Joined: Thu Sep 24, 2009 10:49 pm

Re: Table ends up at the end of the document

Post by Isopropyl »

Whoa, thanks a lot. The afterpage package did the trick.

But now I discovered another problem with tables...

I have two sidewaystables placed with "[h]" and a "clearpage" in between them. The second table is very large, almost writing into the page borders. And for some reason, I always get an extra blank page between the tables. If I delete the "clearpage", however, I still get the extra blank page but now the first table ends up behind the second...

Any ideas why that might be?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Table ends up at the end of the document

Post by localghost »

I can't comprehend the problem.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}
\usepackage{rotating}
\usepackage{blindtext}

\begin{document}
  \blinddocument

  \begin{sidewaystable}
    \caption{Dummy table One}\label{fig:dummy-1}
    \centering
    \rule{0.75\linewidth}{0.5\linewidth}
  \end{sidewaystable}

  \begin{sidewaystable}
    \caption{Dummy table Two}\label{fig:dummy-2}
    \centering
    \rule{0.75\linewidth}{0.5\linewidth}
  \end{sidewaystable}

  \blinddocument
\end{document}
As far as I know the sidewaystable environment doesn't really accept optional arguments.


Best regards
Thorsten
Isopropyl
Posts: 29
Joined: Thu Sep 24, 2009 10:49 pm

Re: Table ends up at the end of the document

Post by Isopropyl »

Ah, I am so sorry. Thank you very much for your help.

Actually, I mixed this up. The second table is not a sidewaystable but a threeparttable. I now fixed the problem by wrapping a table-environment around the threeparttable.

But I did not know that sidewaystable will not accept any parameters like "[h]"...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Table ends up at the end of the document

Post by localghost »

Isopropyl wrote:[...] Actually, I mixed this up. The second table is not a sidewaystable but a threeparttable. I now fixed the problem by wrapping a table-environment around the threeparttable. []
This is one of the reasons for a minimal working example (MWE).
Isopropyl wrote:[...] But I did not know that sidewaystable will not accept any parameters like "[h]"...
Can be looked up in the rotating manual. That's what it's made for.
Post Reply