长桌不工作

长桌不工作

所以我尝试创建一个跨多页的长表 - 但是它在编译时无法生成跨两页的长表。有人能帮我吗?

提前致谢!

\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}

答案1

您的longtable设置过于复杂。(说真的:谁教您编写这样的 LaTeX 代码?)设置longtable

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

并省略全部随后,单元格内容周围会出现“包装器”\multicolumn{1}{|p{1cm}|{...}\multicolumn{1}{p{14cm}|}{...}。哦,请删除\begin{table}\end{table}语句,因为它们会阻止 LaTeX/longtable 插入分页符。

顺便说一下,\label命令需要来命令\caption。对于包含至少一个分页符的表格,如果提供标题,对读者来说非常有帮助而不是在表格主体本身之后。

在此处输入图片描述

\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}

相关内容