
我正在使用我找到的模板,它通常不會給我帶來任何問題,但我在桌子放置方面遇到問題。我試圖在文件的最後一頁上列印四個表格,但第四個表格不斷移動到另一頁,即使前一頁有足夠的空間。我怎樣才能解決這個問題?
(一些評論 - 提前對格式表示歉意 - 無法弄清楚如何阻止粘貼文本,因此縮進被搞亂了。另外,我知道這裡包含的內容有很多我不需要的額外內容,但此時我不想從代碼中刪除任何內容。
先致謝!
\documentclass[11pt, a4paper]{article}
\usepackage[inner=2cm,outer=2cm,top=2.5cm,bottom=2.5cm]{geometry}
\pagestyle{empty}
\usepackage{graphicx}
\usepackage{fancyhdr, lastpage, bbding, pmboxdraw}
\usepackage[usenames,dvipsnames]{color}
\definecolor{darkblue}{rgb}{0,0,.6}
\definecolor{darkred}{rgb}{.7,0,0}
\definecolor{darkgreen}{rgb}{0,.6,0}
\definecolor{red}{rgb}{.98,0,0}
\usepackage[colorlinks,pagebackref,pdfusetitle,urlcolor=darkblue,citecolor=darkblue,linkcolor=darkred,bookmarksnumbered,plainpages=false]{hyperref}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\pagestyle{fancyplain}
\fancyhf{}
\lhead{ \fancyplain{}{MAT 135} }
\rhead{ \fancyplain{}{March 5, 2019} }
\thispagestyle{plain}
\usepackage{listings}
\usepackage{caption}
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}
\usepackage{verbatim}
\usepackage{fancyvrb}
\usepackage{acronym}
\usepackage{hyperref}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{array}
\usepackage{multicol}
\VerbatimFootnotes
\definecolor{OliveGreen}{cmyk}{0.64,0,0.95,0.40}
\definecolor{CadetBlue}{cmyk}{0.62,0.57,0.23,0}
\definecolor{lightlightgray}{gray}{0.93}
\lstset{
basicstyle=\ttfamily,
keywordstyle=\color{OliveGreen},
commentstyle=\color{gray},
numbers=left,
numberstyle=\tiny,
stepnumber=1,
numbersep=5pt,
backgroundcolor=\color{lightlightgray},
frame=none,
tabsize=2,
captionpos=t,
breaklines=true,
breakatwhitespace=false,
showspaces=false,
showtabs=false,
columns=flexible,
morekeywords={__global__, __device__},
}
\begin{document}
\begin{center}
{\Large{Sections 4.2 and 4.3 Questions}}
\end{center}
\begin{center}
March 5, 2019
\end{center}
\vspace{5mm}
\noindent 1. Consider the functions $f(x)=x^2$ and $g(x)=\sqrt{x}$ on the interval $(0,\infty)$. Compare their slopes.
\vspace{5mm}
\noindent 2. Define concave upward and concave downward.
\vspace{5mm}
\newpage
\begin{table}[h]
\begin{center
\begin{tabular}{|c|c|c|c|}
\hline
\textbf{f''(x)} & - & 0 & +\\
\hline
\textbf{f'(x)} & decreasing & horizontal tangent & increasing\\
\hline
\textbf{f(x)} & concave down & inflection point & concave up\\
\hline
\end{tabular}
\end{center}
\end{table}
\begin{table}[h]
\begin{center}
\begin{tabular}{|c|c|c|c|}
\hline
\textbf{f'(x)} & - & 0 & +\\
\hline
\textbf{f(x)} & decreasing & horizontal tangent & increasing\\
\hline
\end{tabular}
\end{center}
\end{table}
\begin{table}[h]
\begin{center}
\caption{Identifying Inflection Points of $f$ Based on The Sign of $f''$}
\begin{tabular}{|c|c|c|c|}
\hline
& c & & \\
\hline
- & & + & inflection point\\
\hline
- & & - & not an inflection point\\
\hline
+ & & - & inflection point\\
\hline
+ & & + & not an inflection point\\
\hline
\end{tabular}
\end{center}
\end{table}
\begin{table}[h]
\begin{center}
\caption{Classifying Local Extrema of $f$ Based on the Sign of $f'$
\begin{tabular}{|c|c|c|c|}
\hline
& c & & \\
\hline
- & & + & local minimum\\
\hline
- & & - & not local extremum\\
\hline
+ & & - & local maximum\\
\hline
+ & & + & not local extremum\\
\hline
\end{tabular}
\end{center}
\end{table}
\end{document}
答案1
您描述的問題的直接原因是您有四個table
環境,而article
預設情況下文件類別僅允許在單一頁面上放置最多三個這樣的環境。這就是第四個table
被推到下一頁的原因。
解決此問題的一種方法是發出指令
\setcounter{totalnumber}{4}
\setcounter{topnumber}{4}
\setcounter{bottomnumber}{4}
在序言中。當然,如果您發現自己需要table
在單一頁面上放置 7 個(大概非常小,對吧?)環境,您應該將上面的內容更改為
\setcounter{totalnumber}{7}
\setcounter{topnumber}{7}
\setcounter{bottomnumber}{7}
順便說一句,我忍不住要說你們的 LaTeX 的整體品質還遠非完美。當然,程式碼包含兩個語法錯誤—\begin{center
和 \caption{Classifying Local Extrema of $f$ Based on the Sign of $f'$
;你能發現缺少的大括號嗎? - 哪個必須在編譯文檔之前進行修復。而寫出《\textbf{f''(x)}
、》\textbf{f''(x)}
、\textbf{f''(x)}
《》,勢必會引起不少人的側目,甚至可能會讓一些讀者眼睛流血。請考慮寫$\mathbf{f}''(\mathbf{x})}$
, $\mathbf{f}'(\mathbf{x})}$
, 和$\mathbf{f}(\mathbf{x})}$
來代替。