我正在制作一个模板,用于我的简历和履历,它在章节标题下方使用一条水平线。我遇到一个问题,当一页几乎写满时,该线附近的垂直空白会被调整,以至于它会碰到章节标题,看起来很糟糕。我更希望 LaTeX 把页面的最后一行放到下一页,而不是把它塞进去并调整空白。
为了解决这个问题,我一直在尝试禁用我能找到的任何“胶水”,但无济于事。我尝试过的大部分方法都在下面的例子中。我提供了两个例子,一个页面没有填满,另一个页面填满,这样你就能看到区别了。第一张图片来自下面的代码,但删除了第二段和第三段。
如果这个问题已经在其他地方得到解决,我深表歉意,但我找不到好的解决方案。另外,请随意提出与我的问题不直接相关的改进建议。这是我第一次从头开始构建这样的模板,我确信我做错了(并且违反了所有排版规则)。谢谢!
\documentclass[12pt]{article}
\usepackage[left=.95in,right=.95in,top=.95in,bottom=.95in]{geometry}
\pagestyle{empty}
\raggedbottom
\setlength{\parindent}{0in}
\setlength{\leftskip}{4pt}
\setlength{\rightskip}{\leftskip}
\setlength{\lineskiplimit}{-100pt}
\setlength{\baselineskip}{11pt plus 0pt minus 0pt}
\setlength{\normalbaselineskip}{11pt plus 0pt minus 0pt}
\setlength{\lineskip}{11pt plus 0pt minus 0pt}
\setlength{\normallineskip}{11pt plus 0pt minus 0pt}
\setlength{\parskip}{1pt plus 0pt minus 0pt}
\setlength{\topskip}{0pt plus 0pt minus 0pt}
\newcommand{\sect}[1]{\addvspace{15pt plus 0pt minus 0pt} {\large{\textsc{#1}}}%
\begin{center} \addvspace{-21pt plus 0pt minus 0pt} \line(1,0){474} \end{center}
\addvspace{-10pt plus 0pt minus 0pt} \par}
\newcommand{\plain}[1]{%
\begingroup \addtolength{\leftskip}{1pt} \addtolength{\rightskip}{1pt} #1 \par \endgroup
\addvspace{5pt plus 0pt minus 0pt}}
\begin{document}
\sect{Section}
\plain{Text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text.}
\plain{Text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text.}
\plain{Text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text.}
\end{document}
答案1
即使使用 TeX,您也需要手动进行一些操作。因此,您可以\pagebreak
在倒数第二行或倒数第二行内使用某个位置来避免出现寡妇。有时可以允许寡妇降低\widowpenalty
值(150
是默认值,但10000
不应允许任何寡妇)。但是,在您的情况下甚至\widowpenalty = 0
没有帮助。
\documentclass[12pt]{article}
\usepackage[left=.95in,right=.95in,top=.95in,bottom=.95in]{geometry}
\pagestyle{empty}
\raggedbottom
\setlength{\parindent}{0in}
\setlength{\leftskip}{4pt}
\setlength{\rightskip}{\leftskip}
\setlength{\lineskiplimit}{-100pt}
\setlength{\baselineskip}{11pt plus 0pt minus 0pt}
\setlength{\normalbaselineskip}{11pt plus 0pt minus 0pt}
\setlength{\lineskip}{11pt plus 0pt minus 0pt}
\setlength{\normallineskip}{11pt plus 0pt minus 0pt}
\setlength{\parskip}{1pt plus 0pt minus 0pt}
\setlength{\topskip}{0pt plus 0pt minus 0pt}
\newcommand{\sect}[1]{\addvspace{15pt plus 0pt minus 0pt}{\large{\textsc{#1}}}%
\begin{center} \addvspace{-21pt plus 0pt minus 0pt} \line(1,0){474}\end{center}
\addvspace{-10pt plus 0pt minus 0pt} \par}
\newcommand{\plain}[1]{%
\begingroup \addtolength{\leftskip}{1pt} \addtolength{\rightskip}{1pt} #1 \par \endgroup
\addvspace{5pt plus 0pt minus 0pt}}
\begin{document}
\sect{Section}
\plain{Text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text.}
\plain{Text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text.}
\plain{Text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
\pagebreak text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text.}
\end{document}