[Tex/LaTex] Longtable not working

errorslongtable

so I'm trying to create a longtable over several pages – however it doesn't produce it over two pages when it compiles. Can anyone help me out?

Thanks in advance!

\documentclass[12pt]{article}
\usepackage{longtable}
\usepackage{booktabs}
\begin{document}

 \begin{table}[h]
 \def\arraystretch{1.5}%
 \label{tab:FilterPrep}
 \begin{longtable}{p{1cm}p{14cm}}
 \multicolumn{2}{c}{\textbf{Preparation}}                                                                       \\ \hline
 \multicolumn{1}{|l|}{1.} & \multicolumn{1}{p{14cm}|}{An ultrasonic bath was half-filled with water.}                                                                                         \\ \hline
 \multicolumn{1}{|l|}{2.} & \multicolumn{1}{p{14cm}|}{A ‘beaker with outflow’ was filled with 350ml of neutralised DI water, so that the water level reached the outflow.}                                                                                       \\ \hline
 \multicolumn{1}{|l|}{3.} & \multicolumn{1}{p{14cm}|}{The ultrasonic bath was topped up to the brim.}                                                                                          \\ \hline
 \multicolumn{1}{|l|}{4.} & \multicolumn{1}{p{14cm}|}{PVC flexible tubing was fitted to the outflow, and the beaker is placed in the ultrasonic bath.}                                                                                          \\ \hline
 \multicolumn{1}{|l|}{5.} & \multicolumn{1}{p{14cm}|}{A collecting vessel was placed under the end of the tubing.}                                                                                        \\ \hline
 \multicolumn{1}{|l|}{6.} & \multicolumn{1}{p{14cm}|}{Neutralised DI water was used to wet the top of one end of the SVL42 pyrex tubes, on which a rubber butt joint was placed. This was then wetted too, on top which a filter was placed. The filter was nylon or polycarbonate. A plastic cap was then used to secure the filter.} \\ \hline
 \multicolumn{1}{|l|}{7.} & \multicolumn{1}{p{14cm}|}{The pyrex tube was then placed (filter down) in the beaker. It was placed in at an angle, to avoid bubbles forming under the filter, which would have impeded the filtration process.}                                                                                       \\ \hline
 \multicolumn{1}{|l|}{8.} & \multicolumn{1}{p{14cm}|}{This was then secured by clamp, so that the filtration column was placed 1cm under the surface. The clamp was not tightened very tight, as it would dampen the ultrasonic vibration.}                                                                                     \\ \hline
 \multicolumn{2}{c}{\textbf{Filtration}}                                                                        \\ \hline
 \multicolumn{1}{|l|}{9.} & \multicolumn{1}{p{14cm}|}{0.5 litres of neutralised DI water was added to 2.5g of sample in a separate beaker, and stirred until the sediment dissolved. If the sediment was unable to dissolve, more DI water was added.}                                                                                         \\ \hline
 \multicolumn{1}{|l|}{10.} & \multicolumn{1}{p{14cm}|}{The ultrasonic bath was turned on, at low-moderate frequencies to avoid nannofossil breakage.}                                                                                      \\ \hline
 \multicolumn{1}{|l|}{11.} & \multicolumn{1}{p{14cm}|}{The suspended sediment was poured (slowly) into the pyrex tube, and allowed to filter through the mesh. The retentate (that sediment trapped in the mesh) now consisted of particles that are bigger than the size of the mesh. By using meshes of decreasing size, it was possible to capture set size fractions of the sediment. Conversely, the filtrate (found in the collecting beaker and the beaker with outflow now consisted of sediment that was smaller than the mesh size.}                                                                                          \\ \hline
 \multicolumn{1}{|l|}{12.} & \multicolumn{1}{p{14cm}|}{The retentate was washed out using DI water into another collection container, and covered up.}                                                                                            \\ \hline
 \multicolumn{1}{|l|}{13.} & \multicolumn{1}{p{14cm}|}{Smear slides were then taken of both the filtrate and the retentate – if the size fractions in the filtrate still contained particles bigger than the mesh size, the process is repeated until they are no longer present. As a minimum, the process was repeated twice for each mesh size.}                                                                                          \\ \hline
 \multicolumn{1}{|l|}{14.} & \multicolumn{1}{p{14cm}|}{The process was repeated with decreasing mesh sizes, to produce the size fractions listed in section \ref{sec:Fraction Sizes}.}                                                                                        \\ \hline
 \multicolumn{2}{c}{\textbf{Post-Filtration}}                                                                                    \\ \hline
 \multicolumn{1}{|l|}{15.} & \multicolumn{1}{p{14cm}|}{The retentate, and the filtrate remaining after the final filtration, were then centrifuged to remove excess water.}                                                                                                                                                                                    \\ \hline
 \multicolumn{1}{|l|}{16.} & \multicolumn{1}{p{14cm}|}{The sediment was centrifuged again, with any visible water removed using Pasteur pipettes.}                                                                                      \\ \hline
 \multicolumn{1}{|l|}{17.} & \multicolumn{1}{p{14cm}|}{The sediments were then left in a desiccator to dry for 5 days to remove any remaining water.}                                                                                         \\ \hline
 \multicolumn{1}{|l|}{18.} & \multicolumn{1}{p{14cm}|}{Smear slides were produced for relevant size fractions.}                                                                                     \\ \hline

 \end{longtable}

 \caption{Steps for the microfiltration process carried out in the experiments detailed in this paper.}
 \end{table}

 \end{document}

Best Answer

Your longtable setup is needlessly complex. (Seriously: Who taught you to write such LaTeX code?) Set up the longtable as

\begin{longtable}{|p{1cm}|p{14cm}|}

and omit all subsequent \multicolumn{1}{|p{1cm}|{...} and \multicolumn{1}{p{14cm}|}{...} "wrappers" around the cell contents. Oh, and do remove the \begin{table} and \end{table} statements, since they prevent LaTeX/longtable from inserting page breaks.

Incidentally, the \label command needs to come after the \caption command. For a table that contains at least one page break, it's very helpful to your reader(s) if you provide the caption before rather than after the body of the table itself.

enter image description here

\documentclass[12pt]{article}
\usepackage[textwidth=16cm]{geometry} % text block needs to be (at least) 16cm wide
\usepackage{longtable,booktabs}
\begin{document}

\renewcommand\arraystretch{1.5}%
\begin{longtable}{|p{1cm}|p{14cm}|}
\caption{Steps for the microfiltration process carried out in the experiments detailed in this paper.} \label{tab:FilterPrep}\\
\multicolumn{2}{c}{\textbf{Preparation}}
\\ \hline
1. & An ultrasonic bath was half-filled with water.
\\ \hline
2. & A `beaker with outflow' was filled with 350ml of neutralised DI water, so that the water level reached the outflow.
\\ \hline
3. & The ultrasonic bath was topped up to the brim. 
\\ \hline
4. & PVC flexible tubing was fitted to the outflow, and the beaker is placed in the ultrasonic bath. 
\\ \hline
5. & A collecting vessel was placed under the end of the tubing. 
\\ \hline
6. & Neutralised DI water was used to wet the top of one end of the SVL42 pyrex tubes, on which a rubber butt joint was placed. This was then wetted too, on top which a filter was placed. The filter was nylon or polycarbonate. A plastic cap was then used to secure the filter.
\\ \hline
7. & The pyrex tube was then placed (filter down) in the beaker. It was placed in at an angle, to avoid bubbles forming under the filter, which would have impeded the filtration process. 
\\ \hline
8. & This was then secured by clamp, so that the filtration column was placed 1cm under the surface. The clamp was not tightened very tight, as it would dampen the ultrasonic vibration. 
\\ \hline
\multicolumn{2}{c}{\textbf{Filtration}}
\\ \hline
9. & 0.5 litres of neutralised DI water was added to 2.5g of sample in a separate beaker, and stirred until the sediment dissolved. If the sediment was unable to dissolve, more DI water was added. 
\\ \hline
10. & The ultrasonic bath was turned on, at low-moderate frequencies to avoid nannofossil breakage. 
\\ \hline
11. & The suspended sediment was poured (slowly) into the pyrex tube, and allowed to filter through the mesh. The retentate (that sediment trapped in the mesh) now consisted of particles that are bigger than the size of the mesh. By using meshes of decreasing size, it was possible to capture set size fractions of the sediment. Conversely, the filtrate (found in the collecting beaker and the beaker with outflow now consisted of sediment that was smaller than the mesh size. 
\\ \hline
12. & The retentate was washed out using DI water into another collection container, and covered up. 
\\ \hline
13. & Smear slides were then taken of both the filtrate and the retentate---if the size fractions in the filtrate still contained particles bigger than the mesh size, the process is repeated until they are no longer present. As a minimum, the process was repeated twice for each mesh size. 
\\ \hline
14. & The process was repeated with decreasing mesh sizes, to produce the size fractions listed in section \ref{sec:Fraction Sizes}. 
\\ \hline
\multicolumn{2}{c}{\textbf{Post-Filtration}} 
\\ \hline
15. & The retentate, and the filtrate remaining after the final filtration, were then centrifuged to remove excess water. 
\\ \hline
16. & The sediment was centrifuged again, with any visible water removed using Pasteur pipettes. 
\\ \hline
17. & The sediments were then left in a desiccator to dry for 5 days to remove any remaining water. 
\\ \hline
18. & Smear slides were produced for relevant size fractions. 
\\ \hline
\end{longtable}

\end{document}