0

I sometimes use \vspace*{8cm}, for example, to add a blank region to let students write down their proof or notes. I find that LaTeX has its own pagebreaking algorithm to let the pages break on "good" point. Hence, LaTeX will sometimes automatically strengthen the vertical space, or move the position of the paragraph to produce(bring out) a wide(sometimes too wide!!) vertical blank to let the pages break "better". However, I don't want this. If the page-break is ugly, I will manually insert a \newpage by myself. How to avoid LaTeX automatically adjusting my vertical space?

Test code:(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}
  • to debug what is happening try using \par\rule{2pt}{8cm} instead of \vspace*{8cm} that will make a visible non-stretchy rectangle, so you can then see the space from that, if there is additional white space, that is coming from something else which you can then track down. – David Carlisle Apr 18 '17 at 20:49
  • The skip after your sections is a bit stretchy. – Johannes_B Apr 19 '17 at 4:32
  • Are you sure LaTeX is the right tool for you? You are misusing/disabling some of its handy features. – Johannes_B Apr 19 '17 at 4:33
  • @Johannes_B Like what? I'm typesetting a Chinese handout, so there are some things I need to change to suit the Chinese fonts and the Taiwanese custom. – Eric Apr 19 '17 at 4:40
  • @Johannes_B But the value after section is 0.3ex plus 0.1ex, 0.1ex is pretty little, so it shouldn't look so wide. – Eric Apr 19 '17 at 4:42
2

LaTeX will not stretch the space from \vspace*{8cm} so without any example it is hard to give specific advice. It may be that automatically added space (for example \parskip) is added at the same visual point, and is stretchy. (The default value of \parskip does stretch). Also latex will normally only stretch vertical space at all if \flushbottom is in effect, so perhaps you would prefer \raggedbottom.

  • Thanks. Since I'm typesetting Chinese documents with XeLaTeX, the test code would be too long, so I thought that it is inconvenient to post the code here. I have found that \parskip is stretchy weeks ago, so I have set it to be 0pt, and it truly works. However, there is still some chance that LaTeX moves my paragraph up or down to suit the page-break algorithm. I guess it is because LaTeX don't want the \vspace*{8cm} literally occurs at the position the page just breaking? Well..., maybe the point is that I should find a vertical space command that can through the pages. – Eric Apr 18 '17 at 15:22
  • @Eric as I said latex will not stretch the 8cm nor will it move it from its position in the source, and as you use the * form it will not drop it at a page break. If the space is stretching then something that you have not shown is adding stretchy space at that point. – David Carlisle Apr 18 '17 at 15:28
  • I have just added a brief test code. :) – Eric Apr 19 '17 at 4:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.