Text FormattingForce order of contents

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
gunknown
Posts: 3
Joined: Sun Nov 01, 2009 8:41 pm

Force order of contents

Post by gunknown »

Code: Select all

\begin{itemize}
\item \textbf{Versuch 1}\\\\
  \begin{tabular}{l|c|c|c}
  Spezifikation & N & R & T [s]\\ \hline
  pre\_track=[0,-1,0,10]& \multirow{2}{*}{1460} & \multirow{2}{*}{853} & \multirow{2}{*}{53.6}\\
  h=-&&&\\
  \end{tabular}
  \begin{figure}[h!]
  \begin{center}
  \includegraphics[scale=0.4]{Bilder/s_1.png}
  \caption{Versuch 1}
  \end{center}
  \end{figure}

\item \textbf{Versuch 2}\\\\
  \begin{tabular}{l|c|c|c}
  Spezifikation & N & R & T [s]\\ \hline
  pre\_track=[0,-1,0,10]& \multirow{2}{*}{261} & \multirow{2}{*}{213} & \multirow{2}{*}{11.7}\\
  h=[-4,-0.01,-10,0]&&&\\
  \end{tabular}
  \begin{figure}[h!]
  \begin{center}
  \includegraphics[scale=0.4]{Bilder/s_2.png}
  \caption{Versuch 2}
  \end{center}
  \end{figure}
\end{itemize}
I want the output to appear in exactly the same order then i wrote it down. E.g. if the picture s_1.png is too big, it is pushed to the next page (like the usual latex behavior). In this case, the list point "Versuch 2" will stay on the first page (befor the figure s_1).
This is what i want to avoid. If the picture s_2 is pushed to the next page, the list "Versuch 2" point should also be pushed to the next page, just right after the figure s_1.
How can i do this?

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

Force order of contents

Post by Stefan Kottwitz »

Hi,

here are possible solutions: Prevent floating of figures or tables. Further, I would use \centering instead of \begin{center} ... \end{center} inside table environments, see center vs. \centering.

Stefan
LaTeX.org admin
davidec
Posts: 16
Joined: Thu Oct 22, 2009 6:18 pm

Force order of contents

Post by davidec »

I have a follow-up question on this. I have all the tables and figures pertaining to my paper at the end of the text part (main body of the paper), and of course I would like to have them in a precise order.

So far, this turned out to be fine, I just had the tables one after the other in the .tex file, and they would show up in that order in the typeset document. Sometimes, I would have to add some positional arguments like

Code: Select all

\begin{table}[!h]
and then, at the latest, everything would be fine.

Now I have made a change to one of the tables and this has messed up everything. The issue is that, in the middle of many tables, I have one "longtable". For some reason, this one (Table 11) now insists on being placed before table 9 and 10. The longtable package does not seem to accept positional arguments, does it?

Alternatively, I tried a xtabular or a supertabular environment, but that was even worse. Now, table 11 was split up in many little pieces to fill every empty spot.

Is there a way to solve this besides recurring to the options, like the caption package, suggested in http://texblog.net/latex-archive/graphi ... ure-table/? In a sense, I wonder why there is no easier way to erect a "Chinese wall" around an element and force it to be on one or two pages, not sharing spance with anything else...
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Force order of contents

Post by gmedina »

Hi,

you could use \clearpage commands at appropriate locations in your document. Another option would be to use the \FloatBarrier command provided by the placeins package.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
davidec
Posts: 16
Joined: Thu Oct 22, 2009 6:18 pm

Re: Force order of contents

Post by davidec »

Hi gmedina -- thank you very much, clearpage seems to do the job just perfectly fine!
Post Reply