Graphics, Figures & TablesFloat placement

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kotoko
Posts: 12
Joined: Sat Jan 09, 2010 8:33 pm

Float placement

Post by kotoko »

Hi!

I'm trying to place a table at the beginning of a chapter and having some troubles with it. I think it's because the chapter is composed only of the table (it's a timeline with the picture of the work in each time).

I tried the usual [h] [t] and even [ht!] and [H].

I ran out of ideas :shock:

Recommended reading 2024:

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

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Float placement

Post by gmedina »

Hi,

since you don't want the table to float, then one possible solution would be to build your table without using the table environment and to use the \captionof command (provided by the caption package) to assign the caption, if needed. A little example:

Code: Select all

\documentclass{book}
\usepackage{caption}
\usepackage{lipsum} % just to generate some text

\begin{document}

\chapter{Test chapter}

{%
\centering
\begin{tabular}{p{.6\textwidth}}
  \hline\lipsum[1] \\\hline
\end{tabular}
\captionof{table}{Test table}
\label{tab:test}
}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Float placement

Post by localghost »

I see no problem even with a float object.

Code: Select all

\documentclass[11pt,a4paper,english]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{blindtext}

\begin{document}
  \chapter{Dummy chapter}

    \begin{table}[!ht]
      \centering
      \begin{tabular}{p{.75\textwidth}}\hline
        \blindtext \\ \hline
      \end{tabular}
      \caption{Dummy table}\label{tab:dummy}
    \end{table}

    \blindtext
\end{document}

Best regards
Thorsten
Post Reply