避免 LaTeX 自動調整我的垂直空間

避免 LaTeX 自動調整我的垂直空間

例如,我有時會使用\vspace*{8cm}添加空白區域來讓學生寫下他們的證明或筆記。我發現 LaTeX 有自己的分頁演算法,可以讓頁面在「好」點上分頁。因此,LaTeX有時會自動加強垂直空間,或移動段落的位置以產生(帶出)較寬(有時太寬!!)的垂直空白,以使頁面「更好」地分開。然而,我不想要這個。如果分頁符號很難看,我會\newpage自己手動插入一個。如何避免 LaTeX 自動調整我的垂直空間?

測試程式碼:(XeLaTeX)

\documentclass[12pt,a4paper,openany,fleqn]{book}
\usepackage[margin=2cm, top=2cm]{geometry}
\usepackage{amsmath}
\usepackage[no-math]{fontspec}
\usepackage[fancyhdr,noindent]{ctexcap}
\usepackage{xeCJK}
\setCJKmainfont{Times New Roman}
\usepackage[subscriptcorrection,nofontinfo,zswash,mtphrb]{mtpro2}
\linespread{1.6}
\parindent = 0 pt 
\everymath{\displaystyle}
\usepackage{fancyhdr} 
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}

\thickmuskip= 5.0mu plus 3.0mu minus 1.5mu
\CTEXsetup[format={\large},beforeskip={3.5ex},afterskip={0.3ex plus 0.1ex},aftername={}]{section}
\renewcommand{\thesection}{(\arabic{section})~}


\newcommand{\allindent}{\hangindent = 2em\hangafter = 0}
\newcommand{\discussItem}[1]{
    \par\allindent \textbf{Discuss:}
    \iItem{#1}
}
\newcounter{iItemcounter}
\newcommand{\iItem}[2][4em]{
    \setcounter{iItemcounter}{0}
    \begin{list}{(\roman{iItemcounter})}{\usecounter{iItemcounter}\itemsep=0pt\parsep=0pt\parskip=0pt\topsep=0pt
    \leftmargin = #1\rightmargin = 1em}{#2}\end{list}

}
\begin{document}
\lineskiplimit = 6pt
\lineskip=6pt
\section{Section Title:}
As you can see, the vertical space between ``Section Title" and this sentence is correct, and I guess it is 0.3ex.\\
Now we go to the next section on the next page.
\newpage
\section{Section Title Two:}
\textbf{$\uparrow$From this place, the vertical space between section and paragraph is stretched.} Let $L$ be a line on the coordinate plane. Blah Blah Blah Blah Blah Blah Blah Blah Blah from $A$ to $B$ $\Delta x$, $y$Blah Blah BlahBlah Blah Blah$\Delta y$ namely$\Delta x=x_2-x_1$, $\Delta y=y_2-y_1$, then define slope $L$Blah Blah BlahBlah Blah Blah\fbox{$m=\frac{\Delta y}{\Delta x}=\frac{y_2-y_1}{x_2-x_1}$}.\\[5.5cm]
\discussItem{
    \item \textbf{Notice that I use \textbackslash\textbackslash[5.5cm] before ``Discuss". If I use the command \textbackslash par\textbackslash rule\{2pt\}\{5cm\} here, the weird vertical space between section title and the context still occurs.}
    \item Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test 
    \item Test Test Test Test Test Test Test Test Test Test Test Test $\frac{\Delta y}{\Delta x}$Test Test Test Test Test Test Test Test Test 
    \item Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test 
}
\section{Section Three:}

\textbf{The vertical space is still weird.} Blah Blah Blah Blah Blah \\[5.5cm]
\discussItem{
    \item Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah 
    \item Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
}


\end{document}

答案1

LaTeX 不會擴展空間,因此在\vspace*{8cm}沒有任何範例的情況下很難給出具體的建議。可能是自動添加的空間(例如\parskip)被添加到同一視覺點,並且是有彈性的。 (預設值是\parskip拉伸)。另外,如果\flushbottom有效,乳膠通常只會拉伸垂直空間,所以也許您會更喜歡\raggedbottom

相關內容