
見つけたテンプレートを使っていて、通常は問題ないのですが、表の配置に問題があります。文書の最後のページに 4 つの表を印刷しようとしているのですが、前のページに十分なスペースがあるにもかかわらず、4 番目の表が別のページに移動されてしまいます。どうすればこれを修正できますか?
(いくつかコメントがあります。フォーマットについてはあらかじめお詫びします。貼り付けるテキストをブロックする方法がわからなかったので、インデントがおかしくなっています。また、ここに含まれているものには必要のない余分なものがたくさんあることはわかっていますが、現時点でコードから削除したいものはありません。)
前もって感謝します!
\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
環境が 4 つあるのに、article
ドキュメント クラスではデフォルトで 1 ページに配置できる環境が 3 つまでしか許可されていないことです。そのため、4 つ目の環境はtable
次のページに押し出されます。
この問題を解決する一つの方法は、指示を出すことです
\setcounter{totalnumber}{4}
\setcounter{topnumber}{4}
\setcounter{bottomnumber}{4}
もちろん、7つの(おそらく非常に小さい)table
環境を1ページに配置する必要がある場合は、上記の内容を次のように変更する必要があります。
\setcounter{totalnumber}{7}
\setcounter{topnumber}{7}
\setcounter{bottomnumber}{7}
ちなみに、あなたのLaTeXの全体的な品質は完璧とは程遠いと言わざるを得ません。確かに、コードには2つの構文エラーがあります。\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})}$