I want to use exact placement for my table. As I read on SO it can be done with [H] option for table environment provided by ‘float’ package. But this doesn't seem to work with longtable which I have to use due to the fact that my table is really long.
What I tried so far
% Preamble
\usepackage{longtable}
\usepackage{float}
\restylefloat{longtable} % as \restylefloat{table} doesn't take effect
…
% Long table
\begin{longtable}[H]{| c | c | c | c |}
\hline
1 & 5 & 6 & 7 \\ \hline
1 & 5 & 6 & 7 \\ \hline
1 & 5 & 6 & 7 \\ \hline
% and so on, many rows
\end{longtable}
This gives me a bunch of errors like
Misplaced \noalign. [\hline]
Misplaced alignment tab character &. [1 &]
Maybe there are some other ways to get desired behaviour of longtable?
EDIT: I add the screenshot of exact problem with longtable placement. In short: it is placed before the paragraph, while I wrote it after.
Best Answer
As clarified in comments the problem is unrelated to floating environments.
\paragraph
is an inline heading (designed to be used after\subsubsection
) the heading is held back and added to the first line of the following paragraph.longtable
does not start a paragraph so the heading gets added toaa
.To fix this add an empty paragraph
But are you sure you want an inline rather than a display heading in this context?