避免 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)可能添加到相同的可视点,并且是可拉伸的。(默认值为拉伸)。此外,如果有效,\parskipLaTeX 通常只会拉伸垂直空间,因此您可能更喜欢。\flushbottom\raggedbottom

相关内容