1

I am new in LaTeX and I am in the learning phase. I am making a document on it, but the problem is that its formatting is incorrect as I compile the source code of the LaTeX. Like I am making a table and it inserted in between the item list and I am making it after the list. I don't know why it is doing this. Secondly if I remove some of the item list, the table goes on the next page but in the end of the page leaving the above potion blank. I searched a lot but can't find the suitable answer.

This is my code:

\documentclass{report}
\begin{document}

   \include{criterion1}

\end{document}

in criterion chapter I have

\begin{itemize}

  \item  4 items here  

   \begin{itemize}
    \item 8 item here
  \end{itemize}
\end{itemize}

if I put table after this

\begin{table}

\centering

 \caption{correlation between objectives and features of the program}

    \begin{longtable}{|c|p{3in}|}

  \end{longtable} 
\end{table}

It went wrong in a seance that it comes either in between the 2nd nested item list or goes on the next page but in the middle of it leaving the whole page blank.

5
  • 5
    Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – jub0bs
    Mar 7, 2013 at 9:41
  • 5
    To quote the FAQ: "Tables and figures have a tendency to surprise, by floating away from where they were specified to appear." tex.ac.uk/cgi-bin/texfaq2html?label=floats Mar 7, 2013 at 9:48
  • The discussion in this question may be of help. Short version: for tables or drawings that are part of the text flow, the floating environments aren't necessary. tex.stackexchange.com/questions/82203/center-table-on-page/…
    – T. Verron
    Mar 7, 2013 at 10:15
  • 5
    longtable in a table will generate an error message. It is best not to ignore TeX error messages, tex will try to carry on but the document is usually not right as a result. Mar 7, 2013 at 13:50
  • than what should I use instead of long table if I have to incorporate long tables? Mar 7, 2013 at 15:33

1 Answer 1

2

If you need to use longtable, just use longtable:

\RequirePackage{filecontents}
\begin{filecontents}{criterion1}
  \begin{itemize}
    \item 4 items here
    \item 4 items here
    \item 4 items here
    \item 4 items here

      \begin{itemize}
        \item 8 item here
        \item 8 item here
        \item 8 item here
        \item 8 item here
        \item 8 item here
        \item 8 item here
        \item 8 item here
        \item 8 item here
      \end{itemize}
   \end{itemize}

  \begin{longtable}{|c|p{3in}|}
    \caption{correlation between objectives and features of the program}\\
    cell one & cell two\\
  \end{longtable}
\end{filecontents}
%
\documentclass{report}
\usepackage{longtable}
\begin{document}

   \include{criterion1}% NB: \include will start a new page if there
%   \input{criterion1}%      is anything preceding it; \input won't

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .