当我运行以下代码时,最后一行文本和最后的表格之间有很大空白。这是为什么?另外,如何在最后一段文本和上面的表格之间创建一个空白行?
\documentclass[11pt]{article}
\usepackage[top = 1in, bottom = 1in, right = 1in, left = 1in]{geometry}
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{bigstrut}
\begin{document}
\begin{titlepage}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % Defines a new command for the horizontal lines, change thickness here
\center % Center everything on the page
%----------------------------------------------------------------------------------------
% HEADING SECTIONS
%----------------------------------------------------------------------------------------
\textsc{\LARGE University College Cork}\\[1.5cm] % Name of your university/college
\textsc{\Large CE 2001: Lab Reports}\\[0.5cm] % Major heading such as course name
\textsc{\large Dr. Virkam Pakrashi}\\[0.5cm] % Minor heading such as course title
%----------------------------------------------------------------------------------------
% TITLE SECTION
%----------------------------------------------------------------------------------------
\HRule \\[0.4cm]
{ \huge \bfseries \#2: Bending Stress In Beams}\\[0.4cm] % Title of your document
\HRule \\[1.5cm]
%----------------------------------------------------------------------------------------
% AUTHOR SECTION
%----------------------------------------------------------------------------------------
\begin{minipage}{0.4\textwidth}
\large
\textbf{{\Large{Authors:}}}\\\\
David \textsc{O'Sullivan}\\ Yuriy \textsc{Lishchynskyy}\\ John \textsc{Kearney}\\ Billy \textsc{O'Connor}\\ Eoghan \textsc{Kelleher} % Your name
\end{minipage}
~
%\begin{minipage}{0.4\textwidth}
%\begin{flushright} \large
%\emph{Instructors:}\\ Mr. Paul \textsc{Smith}\\Mr. Ciaran \textsc{Smith}% Supervisor's Name
%\end{flushright}
%\end{minipage}
\\[4cm]
% If you don't want a supervisor, uncomment the two lines below and remove the section above
%\Large \emph{Author:}\\
%John \textsc{Smith}\\[3cm] % Your name
%----------------------------------------------------------------------------------------
% DATE SECTION
%----------------------------------------------------------------------------------------
{\large \today}\\[3cm] % Date, change the \today to a set date if you want to be precise
%----------------------------------------------------------------------------------------
% LOGO SECTION
%----------------------------------------------------------------------------------------
%\includegraphics{Logo}\\[1cm] % Include a department/university logo - this will require the graphicx package
%----------------------------------------------------------------------------------------
\vfill % Fill the rest of the page with whitespace
\end{titlepage}
\section{Results:}
The dimensions of the beam are as follows:
The following is a table of the various loads applied and and the corresponding values of strain for the gauges 1 $\rightarrow$ 9.
\begin{table}[htbp]
\begin{tabular}{|c|c|c|c|c|c|c|} \hline
\textbf{Gauge Number} & \multicolumn{6}{|c|}{\textbf{Load (N)}} \\
& \textbf{0} & \textbf{100} & \textbf{200} & \textbf{300} & \textbf{400} & \textbf{500} \\ \hline
1 & -128 & -230 & -332 & -434 & -538 & -649 \\ \hline
2 & 35 & -37 & -108 & -179 & -252 & -329 \\ \hline
3 & 1089 & 1089 & 1089 & 1089 & 1049 & 973 \\ \hline
4 & 5 & -9 & -22 & -36 & -48 & -63 \\ \hline
5 & 1088 & 1088 & 1088 & 1088 & 1088 & 1088 \\ \hline
6 & 77 & 96 & 116 & 134 & 156 & 175 \\ \hline
7 & 731 & 751 & 771 & 792 & 814 & 836 \\ \hline
8 & 129 & 172 & 217 & 261 & 309 & 355 \\ \hline
9 & 58 & 104 & 149 & 195 & 243 & 293 \\ \hline
\end{tabular}
\end{table}\\
The loads in the previous tables can be used to calculate the bending moment about the end points of the beam via the following formula: \begin{equation}\boxed{M = \frac{-W}{2}\times0.305$$} \end{equation}
Where $W$ is the applied load and the value 0.305 is the distance, in metres, of the applied loads line of action from the end points of the beam. Once the various different bending moments due to the applied loads have been calculated, the following table can be formed:
\begin{table}[htbp]
\begin{tabular}{|c|c|c|c|c|c|c|} \hline
\textbf{Gauge Number} & \multicolumn{6}{|c|}{\textbf{BM (Nm) and Corrected Strain Readings}} \\
& \textbf{0} & \textbf{-15.25} & \textbf{-30.5} & \textbf{-45.75} & \textbf{-61} & \textbf{-76.25} \\ \hline
1 & 0 & -102 & -204 & -306 & -410 & -521 \\ \hline
2 & 0 & -72 & -143 & -214 & -287 & -364 \\ \hline
3 & 0 & 0 & 0 & 0 & -40 & -116 \\ \hline
4 & 0 & -14 & -27 & -41 & -53 & -68 \\ \hline
5 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline
6 & 0 & 19 & 39 & 57 & 79 & 98 \\ \hline
7 & 0 & 20 & 40 & 61 & 83 & 105 \\ \hline
8 & 0 & 43 & 88 & 132 & 180 & 226 \\ \hline
9 & 0 & 46 & 91 & 137 & 185 & 235 \\ \hline
\end{tabular}
\end{table}
A number of the gauges occupy the same vertical position on the T-section and thus can be grouped together depending on their displacement from the top/bottom (the datum is arbitrary). Once this is done, a table of $M$ and the strain values for the corresponding gauge groupings can be created. The table can be structured as such:
\begin{table}[htbp]
\begin{tabular}{|c|c|c|c|c|c|c|c|} \hline
\textbf{Gauge Number} & \textbf{Vertical Position (mm)} & \multicolumn{6}{|c|}{\textbf{Bending Moment (Nm)}} \\
& & \textbf{0} & \textbf{-15.25} & \textbf{-30.5} & \textbf{-45.75} & \textbf{-61} & \textbf{-76.25} \\ \hline
1 & 0 & 0 & -102 & -204 & -306 & -410 & -521 \\ \hline
2,3 & 8 & 0 & -36 & -71.5 & -107 & -163.5 & -240 \\ \hline
4,5 & 23 & 0 & -7 & -13.5 & -20.5 & -26.5 & -34 \\ \hline
6,7 & 31.7 & 0 & 19.5 & 39.5 & 59 & 81 & 101.5 \\ \hline
8,9 & 38.1 & 0 & 44.5 & 89.5 & 134.5 & 182.5 & 230.5 \\ \hline
\end{tabular}
\end{table}
\end{document}
答案1
的使用
\\[<dimen>]
大多是错误的;字体大小更改命令最好以\par
\center
你的in用法titlepage
是错误的,最好\centering
对于作者来说a
tabular
比 a更好minipage
不要以冒号结尾章节标题
它应该是
$1\rightarrow 9$
之前应该有一个空行
\begin{table}
\end{table}
;后面应该有一个空行,\end{table}\\
这肯定是错误的$$
公式末尾的\boxed
公式是错误的你应该使用间接引用表格,而不是“下表”,因为你不知道表格是否最终会出现在你理想的位置
表格应该有标题
第二个表中的标题是数字,因此它们应该是中等系列和数学公式,这样减号才是正确的
S
数字数据应该用提供的列类型来处理siunitx
。长标题可以缩短,以免破坏表格
\documentclass[11pt]{article}
\usepackage[margin = 1in]{geometry}
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{booktabs}
\begin{document}
\begin{titlepage}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\centering
{\scshape\LARGE University College Cork\par}
\vspace{1cm}
{\scshape\Large CE 2001: Lab Reports\par}
{\scshape\large Dr. Virkam Pakrashi\par}
\HRule
\vspace{0.4cm}
{\huge \bfseries \#2: Bending Stress In Beams\par}
\vspace{0.4cm}
\HRule
\vspace{1.5cm}
{\large
\begin{tabular}{@{}l@{}}
\Large\textbf{Authors:}\\
David \textsc{O'Sullivan}\\
Yuriy \textsc{Lishchynskyy}\\
John \textsc{Kearney}\\
Billy \textsc{O'Connor}\\
Eoghan \textsc{Kelleher}
\end{tabular}
\par}
\vspace{4cm}
{\large \today\par}
\vfill
\end{titlepage}
\section{Results}
The dimensions of the beam are as follows: table~\ref{tab:loads} reports
the various loads applied and the corresponding values of strain for the
gauges $1\rightarrow 9$.
\begin{table}[htbp]
\centering
\caption{Loads applied and corresponding values of strain;
GN stands for ``Gauge Number''}\label{tab:loads}
\medskip
\begin{tabular}{c *{6}{S[table-format=-4.0]} }
\toprule
\textbf{GN} & \multicolumn{6}{c}{\textbf{Load (N)}} \\
\cmidrule{2-7}
& {$0$} & {$100$} & {$200$} & {$300$} & {$400$} & {$500$} \\
\midrule
1 & -128 & -230 & -332 & -434 & -538 & -649 \\
2 & 35 & -37 & -108 & -179 & -252 & -329 \\
3 & 1089 & 1089 & 1089 & 1089 & 1049 & 973 \\
4 & 5 & -9 & -22 & -36 & -48 & -63 \\
5 & 1088 & 1088 & 1088 & 1088 & 1088 & 1088 \\
6 & 77 & 96 & 116 & 134 & 156 & 175 \\
7 & 731 & 751 & 771 & 792 & 814 & 836 \\
8 & 129 & 172 & 217 & 261 & 309 & 355 \\
9 & 58 & 104 & 149 & 195 & 243 & 293 \\
\bottomrule
\end{tabular}
\end{table}
The loads in the table~\ref{tab:loads} can be used to calculate the
bending moment about the end points of the beam via the following formula:
\begin{equation}
\boxed{M = \frac{-W}{2}\times0.305}
\end{equation}
where $W$ is the applied load and the value $0.305$ is the distance,
in metres, of the applied loads line of action from the end points of the
beam. Once the various different bending moments due to the applied loads
have been calculated, table~\ref{tab:corrloads} can be formed.
\begin{table}[htbp]
\centering
\caption{Corrected strain readings;
GN stands for ``Gauge Number''}\label{tab:corrloads}
\medskip
\begin{tabular}{ c *{6}{S[table-format=-3.0]} }
\toprule
\textbf{GN} &
\multicolumn{6}{c}{\textbf{BM (\si{Nm}) and Corrected Strain Readings}} \\
\cmidrule{2-7}
& {$0$} & {$-15.25$} & {$-30.5$} & {$-45.75$} & {$-61$} & {$-76.25$} \\
\midrule
1 & 0 & -102 & -204 & -306 & -410 & -521 \\
2 & 0 & -72 & -143 & -214 & -287 & -364 \\
3 & 0 & 0 & 0 & 0 & -40 & -116 \\
4 & 0 & -14 & -27 & -41 & -53 & -68 \\
5 & 0 & 0 & 0 & 0 & 0 & 0 \\
6 & 0 & 19 & 39 & 57 & 79 & 98 \\
7 & 0 & 20 & 40 & 61 & 83 & 105 \\
8 & 0 & 43 & 88 & 132 & 180 & 226 \\
9 & 0 & 46 & 91 & 137 & 185 & 235 \\
\bottomrule
\end{tabular}
\end{table}
A number of the gauges occupy the same vertical position on the T-section
and thus can be grouped together depending on their displacement from the
top/bottom (the datum is arbitrary). Once this is done, a table of $M$ and
the strain values for the corresponding gauge groupings can be created.
The table can be structured as seen in table~\ref{tab:again}.
\begin{table}[htbp]
\centering
\caption{Corrected data;
GN stands for ``Gauge Number'',
VP stands for ``Vertical Position''}\label{tab:again}
\medskip
\begin{tabular}{ c S[table-format=2.1] *{6}{S[table-format=-3.1]} }
\toprule
\textbf{GN} &
\textbf{VP (\si{mm})} &
\multicolumn{6}{c}{\textbf{Bending Moment (\si{Nm})}} \\
\cmidrule{3-8}
& & {$0$} & {$-15.25$} & {$-30.5$} & {$-45.75$} & {$-61$} & {$-76.25$} \\
\midrule
1 & 0 & 0 & -102 & -204 & -306 & -410 & -521 \\
2,3 & 8 & 0 & -36 & -71.5 & -107 & -163.5 & -240 \\
4,5 & 23 & 0 & -7 & -13.5 & -20.5 & -26.5 & -34 \\
6,7 & 31.7 & 0 & 19.5 & 39.5 & 59 & 81 & 101.5 \\
8,9 & 38.1 & 0 & 44.5 & 89.5 & 134.5 & 182.5 & 230.5 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
答案2
要有一个“浮动”,如table
环境,排版在页面顶部在仅浮动的页面上(而不是默认的垂直居中),您可以在文档的序言中发出以下命令:
\makeatletter
\setlength{\@fptop}{0pt}
\setlength{\@fpbot}{0pt plus 1fil}
\makeatother
你还问:
另外,如何在文本的最后一段和其上方的表格之间创建一个空白行?
文本中的 LaTeX 浮动(例如第二个table
)与其上方或下方文本之间的垂直距离由长度参数控制\intextsep
。要将此参数的值增加一个空白行,可以发出命令
\addtolength\intextsep{1\baselineskip}
答案3
(1) 表格位于页面中央,因为它是页面上唯一的项目。\newpage
在文档的第 110 行添加内容,从而将以“许多仪表...”开头的段落移至包含表格的页面,这将是解决第一个问题的第一步。
(2) 您可以插入任意垂直空间\vspace{0.5cm}
或 ,无论您喜欢什么距离。如果您只想添加一个额外的空白行,请插入\newline
。