[Tex/LaTex] Big spaces in output

spacing

When I run the following code, there's a huge space between the last bit of text and the final table. Why is this? Also, how can I create a blank line between the final paragraph of text and the table above it?

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

Best Answer

  • The usage of \\[<dimen>] is mostly wrong; font size changing commands should better be ended by \par

  • Your usage of \center in titlepage is wrong, better \centering

  • Better a tabular than a minipage for the authors

  • Don't end a section title with a colon

  • It should be $1\rightarrow 9$

  • There should be a blank line before \begin{table}

  • There should be a blank line after \end{table}; \end{table}\\ is surely wrong

  • $$ at the end of the \boxed formula is wrong

  • You should use indirect references to tables and not “the following table”, because you don't know whether the table will end up where you'd ideally place it

  • Tables should have a caption

  • The headers in the second table are numbers, so they should be medium series and in a math formula, so that the minus sign is correct

  • Numeric data should be treated with the S column type provided by siunitx.

  • Long headers can be abbreviated so they don't spoil the table

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

enter image description here

Related Question