所以我有这样的代码,其中我的第一个表格不断转到第二页,而我实际上希望它停留在第一页,因为那里有足够的空间,而且间隙看起来很奇怪。有什么想法可以解决这个问题,为什么它不断跳下来,即使首页上应该有足够的空间?代码:
\documentclass[12pt, fullpage, oneside]{article}
\usepackage[utf8]{inputenc}
\addtolength{\oddsidemargin}{-.875in}
\addtolength{\evensidemargin}{-.875in}
\addtolength{\textwidth}{1.75in}
\addtolength{\topmargin}{-1.7in}
\addtolength{\textheight}{3in}
\title{Assignment 1}
\author{Anonymous)}
\date{September 2021}
\begin{document}
\maketitle
\section{Goal definition}
\subsection*{Assignment A}
The purpose of the LCA is to identify any hot spots or flaws in the manufacturing stage and/or use stage of a vacuum cleaner made by large Danish manufacturer company of electric products. The intended use of the LCA is therefore to improve new vacuum cleaners. One intended user of the LCA is therefore the department that develop the product and they can then use the LCA to improve their product.
\subsection*{Assignment B}
As clarified in the first assignment the LCA was made so that changes and improvements could be made. A vacuum cleaner is a fairly small product with a very specific use so the change in its manufacturing processes and thereby environmental impact is not going to have big consequences on a large scale. Therefore the decision context must be situation A "Micro level decision support".
\begin{table}\def\arraystretch{1.5}
\section{Scope definition}\subsection*{Assignment C}\subsubsection*{Chest freezer}
\begin{tabular}{|c|c|}
\hline\textbf{Obligatory properties}&\textbf{Positioning properties}\\ \hline
Function as a container for food & Has light when lid is opened \\ \hline
Be able to freeze food & Electronic display showing temperature and more \\ \hline
Keep same temperature & Classical music when opened\\ \hline
Seal tight = No leaking & Wheels\\ \hline
Can be opened & Cheap\\ \hline
Not affect the temperature around it & Efficient \\ \hline
\end{tabular}
\caption{This table shows the obligatory properties and positioning properties of a chest freezer}
\end{table}
\begin{table}
\subsubsection*{Packaging of beer bottles}
\centering
\def\arraystretch{1.5}
\begin{tabular}{|c|c|}
\hline
\textbf{Obligatory properties}&\textbf{Positioning properties}\\ \hline
Container for beer & Ergonomic handles for comfortable lifting \\ \hline
Segments for each bottle so they do not tilt & Wheels \\ \hline
Handles & Recyclable\\ \hline
Sturdy material & Green colour\\ \hline
\end{tabular}
\caption{This table shows the obligatory properties and positioning properties of a packaging of beer bottles}
\end{table}
\end{document}
答案1
无论你做什么,不是\subsection
放置分段命令,例如\subsubsection
里面table
或环境figure
。绝不。没有例外。无论如何都不可能。
将这些命令放在浮点数之外后,我建议您更改\begin{table}
为\begin{table}[htbp]
。
以下截图显示了测试文档第 1 页的底部和第 2 页的顶部。观察\clearpage
before的使用\subsubsection*{Packaging of beer bottles}
。
\documentclass[12pt,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage[textwidth=7.25in,textheight=10.5in]{geometry}
\title{Assignment 1}
\author{Anonymous}
\date{September 2021}
\begin{document}
\maketitle
\section{Goal definition}
\subsection*{Assignment A}
The purpose of the LCA is to identify any hot spots or flaws in the manufacturing stage and/or use stage of a vacuum cleaner made by large Danish manufacturer company of electric products. The intended use of the LCA is therefore to improve new vacuum cleaners. One intended user of the LCA is therefore the department that develop the product and they can then use the LCA to improve their product.
\subsection*{Assignment B}
As clarified in the first assignment the LCA was made so that changes and improvements could be made. A vacuum cleaner is a fairly small product with a very specific use so the change in its manufacturing processes and thereby environmental impact is not going to have big consequences on a large scale. Therefore the decision context must be situation A "Micro level decision support".
\section{Scope definition}
\subsection*{Assignment C}
\subsubsection*{Chest freezer}
\begin{table}[htbp] % <-- note insertion of '[htbp]'
\def\arraystretch{1.5}
\centering
\begin{tabular}{|c|c|}
\hline
\textbf{Obligatory properties}&\textbf{Positioning properties}\\
\hline
Function as a container for food & Has light when lid is opened \\ \hline
Be able to freeze food & Electronic display showing temperature and more \\ \hline
Keep same temperature & Classical music when opened\\ \hline
Seal tight = No leaking & Wheels\\ \hline
Can be opened & Cheap\\ \hline
Not affect the temperature around it & Efficient \\
\hline
\end{tabular}
\caption{This table shows the obligatory properties and positioning properties of a chest freezer}
\end{table}
\clearpage
\subsubsection*{Packaging of beer bottles}
\begin{table}[htbp] % <-- note insertion of '[htbp]'
\def\arraystretch{1.5}
\centering
\begin{tabular}{|c|c|}
\hline
\textbf{Obligatory properties}&\textbf{Positioning properties}\\
\hline
Container for beer & Ergonomic handles for comfortable lifting \\ \hline
Segments for each bottle so they do not tilt & Wheels \\ \hline
Handles & Recyclable\\ \hline
Sturdy material & Green colour\\
\hline
\end{tabular}
\caption{This table shows the obligatory properties and positioning properties of a packaging of beer bottles}
\end{table}
\end{document}