테이블 배치 문제

테이블 배치 문제

찾은 템플릿을 사용하고 있으며 일반적으로 문제가 없지만 테이블 배치에 문제가 있습니다. 문서의 마지막 페이지에 표 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

설명하는 문제의 즉각적인 원인은 4개의 table환경이 있다는 것입니다. 반면 article문서 클래스에서는 기본적으로 이러한 환경을 단일 페이지에 최대 3개까지만 배치할 수 있습니다. 이것이 네 번째 페이지가 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})}$.

관련 정보