Graphics, Figures & TablesMisplaced line of text above my tables / figures

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
rasta1985
Posts: 3
Joined: Sat Aug 28, 2010 11:20 am

Misplaced line of text above my tables / figures

Post by rasta1985 »

Hey there,

I'm writing my diploma thesis at the moment and I got two problems including graphics / tablets to my latex document. First of all I always get a line of text above my tables and also above my graphics. The line of text above the table in the attachment belongs to the break below the table. If latex places the table/graphic "here" I get the problem described above. If latex places the table/graphic "top" I dont get the problem.
My second problem is, that theres a blank after every table/graphic as you can see in the attachment and I dont know why (It is above the table in this case because latex pulled the line of text above the table).

Thanks for your help,
Philip

Code: Select all

F"uhrt man die Optimierung f"ur beide Tage durch, so ergeben sich die in Tabelle (2) dargestellten Parametrisierungen f"ur $\vartheta=(\alpha,\beta,\theta)'$.\\
\begin{table}[ht]
\centering
\begin{tabular}{lccc}
  \toprule
  \toprule
  Datum & $\alpha$ & $\beta$ & $\theta$ \\
  \midrule
 $20.06.2007$ & $0,5152$ & $0,4234$ & $-2,7596$ \\
 $16.09.2008$ & $1,2772$ & $0,4695$ & $-1,6916$ \\
  \bottomrule
  \bottomrule
\end{tabular}
\caption[Parametrisierung des RFL(2)-Modells f"ur den 20.06.2007 und 16.09.2008]{Parametrisierung des RFL(2)-Modells f"ur den 20.06.2007 und den 16.09.2008}
\end{table}
Die beiden Werte f"ur $\alpha$ und $\beta$ und somit die damit assoziierte Korrelation sind f"ur den $20.06.2007$ betragsm"a"sig nah beieinander, was daf"ur spricht, dass 
Attachments
problem.PNG
problem.PNG (55.93 KiB) Viewed 3987 times

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Misplaced line of text above my tables / figures

Post by meho_r »

Separating your table from the text above/below it with an empty line and avoiding manual line breaks should solve your problems. Here's your code with slight corrections:

Code: Select all

\documentclass{article}

\usepackage{booktabs}

\begin{document}

F"uhrt man die Optimierung f"ur beide Tage durch, so ergeben sich die in Tabelle (2) dargestellten Parametrisierungen f"ur $\vartheta=(\alpha,\beta,\theta)'$.%\\ this line break causes additional space after the table.
% An additional note: separate table from the text above/below it with an empty line

\begin{table}[ht]
\centering
\begin{tabular}{lccc}
  \toprule
  \toprule
  Datum & $\alpha$ & $\beta$ & $\theta$ \\
  \midrule
$20.06.2007$ & $0,5152$ & $0,4234$ & $-2,7596$ \\
$16.09.2008$ & $1,2772$ & $0,4695$ & $-1,6916$ \\
  \bottomrule
  \bottomrule
\end{tabular}
\caption[Parametrisierung des RFL(2)-Modells f"ur den 20.06.2007 und 16.09.2008]{Parametrisierung des RFL(2)-Modells f"ur den 20.06.2007 und den 16.09.2008}
\end{table}

Die beiden Werte f"ur $\alpha$ und $\beta$ und somit die damit assoziierte Korrelation sind f"ur den $20.06.2007$ betragsm"a"sig nah beieinander, was daf"ur spricht, dass 

\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Misplaced line of text above my tables / figures

Post by localghost »

For the first problem just insert blank lines between the figure environment and the surrounding text.

Code: Select all

F"uhrt man die Optimierung f"ur beide Tage durch, so ergeben sich die in Tabelle (2) dargestellten Parametrisierungen f"ur $\vartheta=(\alpha,\beta,\theta)'$.\\

\begin{table}[!ht]
  \centering
  \begin{tabular}{lccc}\toprule\toprule
    Datum & $\alpha$ & $\beta$ & $\theta$ \\\midrule
    $20.06.2007$ & $0,5152$ & $0,4234$ & $-2,7596$ \\
    $16.09.2008$ & $1,2772$ & $0,4695$ & $-1,6916$ \\\bottomrule\bottomrule
  \end{tabular}
  \caption[Parametrisierung des RFL(2)-Modells f"ur den 20.06.2007 und 16.09.2008]{Parametrisierung des RFL(2)-Modells f"ur den 20.06.2007 und den 16.09.2008}
\end{table}

Die beiden Werte f"ur $\alpha$ und $\beta$ und somit die damit assoziierte Korrelation sind f"ur den $20.06.2007$ betragsm"a"sig nah beieinander, was daf"ur spricht, dass 
By the way, for direct insertion of umlauts you can use the inputenc package. That would spare you the effort of always using the quotes character.

Regarding the second problem, I'm not sure what you mean. Take into account that there is always some space inserted between the float object and the text. This space is determined by the length \intextsep.

And finally just another note. Captions of tables are placed above, not below. The caption package as well as the classes from KOMA Script offer mechanism for according customization.


Thorsten
Post Reply