我正在写论文,刚开始使用 latex,我无法将表格放在与章节标题页相同的页面上。我的一个附录只包含表格而没有文本,但表格出现在包含图块页面的下一页上,尽管表格上方和下方有足够的空间。希望附图能帮助您更好地理解这个问题。
我的代码如下:
\documentclass[a4paper, 12pt, twoside, openright]{report}
\usepackage[top=25mm,bottom=25mm,left=25mm, right=25mm, bindingoffset=6mm]{geometry}
\usepackage{amsmath, tabularx, mathtools, array, multirow, booktabs, pdflscape}
\usepackage[titletoc]{appendix}
\begin{document}
%
\begin{appendices}
%
\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}%---------supress sectioning in TOC
\titleformat{\chapter}[display]
{\normalfont\fontsize{14}{10}\bfseries\raggedright}{\chaptertitlename{} \thechapter:}{0.3em}{\fontsize{14}{10}}
\titlespacing*{\chapter}{0pt}{-15pt}{10pt}
\chapter{Rock Mass Parameter selection guidelines}
%
\begin{table}
\caption{Field estimate of Uniaxial Compressive Strength (UCS).}
\footnotesize
\begin{tabularx}{\textwidth}{>{\hsize=0.4\hsize \centering\arraybackslash}X
>{\hsize=0.5\hsize \raggedright\arraybackslash}X
>{\hsize=0.5\hsize \centering\arraybackslash}X
>{\hsize=0.4\hsize \centering\arraybackslash}X
>{\raggedright\arraybackslash}X
>{ \raggedright\arraybackslash}X}
\toprule
\textbf{Grade*}& \textbf{Term}& \textbf{Uniaxial Comp. Strength (MPa)}& \textbf{Point Load Index (MPa)}& \textbf{Field estimate of strength}& \textbf{Examples}\\
\midrule
R6& Extremely Strong& $>$250& $>$10& Specimen can only be chipped with a geological hammer& Fresh basalt, chert,diabase, gneiss, granite, quartzite\\
\addlinespace
R5& Very Strong& 100--250& 4--10& Specimen requires many blows of a geological hammer to fracture it& Amphiobolite, sandstone, basalt, gabbro, gneiss, granodiorite, limestone, marble, rhyolite, tuff\\
\addlinespace
R4& Strong& 50--100& 2--4& Specimen requires more than one blow of a geological hammer to fracture it& Limestone, marble, phyllite, sandstone, schist, shale\\
\addlinespace
R3& Medium Strong& 25--50& 1--2& Cannot be scraped or peeled with a pocket knife, specimen can be fractured with a single blow from a geological hammer& Claystone, coal, concrete, schist, shale, siltstone\\
\addlinespace
R2& Weak& 5--25& **& Can be peeled with a pocket knife with difficulty, shallow indentation made by firm blow with a point of geological hammer& Chalk, rocksalt, potash\\
\addlinespace
R1& Very Weak& 1--5& **& Crumble under firm blows with point of a geological hammer, can be peeled by a pocket knife& Highly weathered or altered rock\\
\addlinespace
R0& Extremely Weak& 0.21--1& **& Indented by thumbnail& Stiff fault gouge\\
\bottomrule
\end{tabularx}
* Grade according to Brown (1981)\\
** Point load tests on rocks with a UCS below 25 MPa are likely to yield highly ambiguous results.
\label{CT1}
\end{table}
%
\end{appendices}
\end{document}
PS:由于我原来的文档中有很多东西需要放在这里,所以在创建这个 MWE 时我可能遗漏了一些包。
答案1
默认情况下,LaTeX 会限制常规文本页面中可用于浮动元素的数量(例如table
),因此您的表格会被推到浮动页面。您需要手动指定表格的“此处”位置(并且,如果有必要,请确保它确实适合页面上的可用空间),方法是添加[h!]
到\begin{table}
命令中。
顺便说一句,您的 MWE 丢失了\usepackage{titlesec}
。