Graphics, Figures & TablesHuge Gap between Paragraph and Table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
zqzuk
Posts: 2
Joined: Tue Mar 27, 2012 9:49 pm

Huge Gap between Paragraph and Table

Post by zqzuk »

Hi, I am a latex newbie and I currently have weird presentation with tables. my code looks like this:

Code: Select all

\FloatBarrier
\input{./tables/t_4}
\FloatBarrier
In addition, .......(some text goes here) used. 
\vspace{-20cm}
\FloatBarrier
\input{./tables/t_5}
\FloatBarrier

\input{./sections/section6}
where "./tables/t_5" looks like:

Code: Select all

\begin{table}
  \caption{Evaluation based on .....}
    \begin{tabular}{llllll}
        \hline\hline
A&B&C&D&E&F\\
        \hline
...............
\hline\hline
    \end{tabular}
  \label{t5}
\end{table}
With this code, table (t_4) is on the previous page and the paragraph {In addition ...} starts on the current page. Table t_5 is supposed to follow directly after the paragraph, but currently there is a huge gap between them, making it look like the image below (apologies for blocking the content, due to some copyright issues):
Capture.PNG
Capture.PNG (27.03 KiB) Viewed 3563 times
As you see I tried "vspace{}" but it didnt help. Any suggestions please?

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

zqzuk
Posts: 2
Joined: Tue Mar 27, 2012 9:49 pm

Re: Huge Gap between Paragraph and Table

Post by zqzuk »

Further to this - I ve noticed that, it seems latex always places tables such that it is aligned to the top of a page, or to the bottom. However in my case, i want it to stay between paragraphs, so somewhere in the middle of a page.

Is that possible?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Huge Gap between Paragraph and Table

Post by Stefan Kottwitz »

Hi,

welcome to the board!

Tables are floating environments. LaTeX positions them at good places, so inserting \vspace somewhere would not have the desired effect.

You could use positioning options in the optional argument to the {table} environment, such as t for top, h for here, b for bottom, p for dedicated pages, ! for more relaxed positioning.

Use all together for most easy placement:

Code: Select all

\begin{table}[!htbp]
The order of the options doesn't matter. Don't use just h, which would mean you don't allow floating to top or bottom even if it's desirable. Combinations like [ht] or [hb] may be good if you have such preferences.

Stefan
LaTeX.org admin
Post Reply