General\floatingtable near \tableofcontents

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Marek
Posts: 20
Joined: Wed Jan 30, 2008 3:36 pm

\floatingtable near \tableofcontents

Post by Marek »

The last paragraph of the last \section of my text is needed to refer to the floating table wrapped by the text (I use \floatingtable from package "floatflt"). Compilation of the document turns out the table inserted in the page of table of contents and creates two columns on this page: first one contains the table, the second one is for table of contents.
I tried to put "\\" after \end{floatingtable} but it had generated errors. Also the structures:
...\end{floatingtable}
\newpage
\tableofcontents...

and

...\end{floatingtable}
space mark
\\
\tableofcontents...
do not work. How to force the table of contents would have nothing to do with this table?

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

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

\floatingtable near \tableofcontents

Post by gmedina »

Try using \clearpage or \cleardoublepage
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Marek
Posts: 20
Joined: Wed Jan 30, 2008 3:36 pm

Re: \floatingtable near \tableofcontents

Post by Marek »

Thank you, but no result (only the column with the table and column with table of contents replaced each other).
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

\floatingtable near \tableofcontents

Post by gmedina »

Can you please post a minimal working example showing this problem?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Marek
Posts: 20
Joined: Wed Jan 30, 2008 3:36 pm

Re: \floatingtable near \tableofcontents

Post by Marek »

Minimal Working Example:
%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt,a4paper,fleqn,oneside,dvips]{report}
\usepackage{graphicx}
\usepackage{floatflt}
%
\title{Minimal working example}
\author{My name}
\begin{document}
\maketitle
\section{To create table of contents}
Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1. Section 1.
\section{To create table of contents}
Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2. Section 2.
\section{To create table of contents}
Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3 \ref{tab:tab}. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3. Section 3.
\begin{floatingtable}{
\begin{tabular}{|c|c|}\hline\hline
\textbf{ABC} & \textbf{BCD [eV]} \\ [0.5ex]
\hline
C-H & 4,3 \\ \hline
C-C & 3,6 \\ \hline
C=C & 6,3 \\ \hline
C-O & 3,6 \\ \hline
O-H & 4,8 \\ [0.5ex]
\hline
\end{tabular}}
\caption{\textsl{The table}}
\label{tab:tab}
\end{floatingtable}
%
\tableofcontents
%
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%
In this example puttnig the table's code somewhere earlier leads to placing the table into the right paragraph but in the real text putting the code of the table in the beginning of the paragraph which refers to it leads to the same result as placing it in the end of the paragraph.
balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: \floatingtable near \tableofcontents

Post by balf »

Did you try to use the wrapfig package instead? Also, another, less known, package that can be used if you don't need to caption your table (it is no more floating) is insbox, a generic macro.

B.A.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

\floatingtable near \tableofcontents

Post by gmedina »

I did some tests with your code and floatflt doe not behave very well (and reading the documentation, I noticed that it is very "old" (apparently no changes since 1998)). As balf suggests, you might consider using the wrapfig package.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Marek
Posts: 20
Joined: Wed Jan 30, 2008 3:36 pm

Re: \floatingtable near \tableofcontents

Post by Marek »

Thank you very much. I have replaced floatflt by wrapfig. It seems to work correct.
By the way, I like LaTeX very much but I have used it up to this time only occasionally and I am not very fluent in advanced usage but I think this forum and your advices are very, very, very helpful. Thank you for it.
M.P.
Post Reply