5

After reading about the differences between \pagebreak and \newpage I have noticed that the \pagebreak doesn't work as it is supposed to. Why is that? Am I missing something? Is there something I should add to the preamble?

This happens with both \pagebreak{} and with \pagebreak[4]

Code:

%% LyX 2.2.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{setspace}
\onehalfspacing

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth


\@ifundefined{date}{}{\date{}}
\makeatother

\usepackage{babel}
\begin{document}
asdgf g dfh adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf
g dfh adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh
adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf
afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf afgsd
fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf afgsd fdh gjhsfdgag
ag gfd gsg sdhgfsdg

asdgf g dfh adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf
g dfh adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh
adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf
afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf afgsd
fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf afgsd fdh gjhsfdgag
ag gfd gsg sdhgfsdg

asdgf g dfh adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf
g dfh adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh
adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf
afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf afgsd
fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf afgsd fdh gjhsfdgag
ag gfd gsg sdhgfsdg

asdgf g dfh adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf
g dfh adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh
adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf
afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf afgsd
fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf afgsd fdh gjhsfdgag
ag gfd gsg sdhgfsdg

asdgf g dfh adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf
g dfh adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh
adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf
afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf afgsd
fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf afgsd fdh gjhsfdgag
ag gfd gsg sdhgfsdg

\pagebreak[4]

asdgf g dfh adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf
g dfh adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh
adfgsdaf afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf
afgsd fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf afgsd
fdh gjhsfdgag ag gfd gsg sdhgfsdgasdgf g dfh adfgsdaf afgsd fdh gjhsfdgag
ag gfd gsg sdhgfsdg
\end{document}

Output:

  • What do you expect to get? – Sigur Oct 13 '18 at 13:22
  • @Sigur something like this, stretched text – Jon Oct 13 '18 at 13:24
9

You must enable \flushbottom. The default in article is \raggedbottom.

enter image description here

  • How do i do that? – Jon Oct 13 '18 at 13:28
  • Add the command to the preamble. – Ulrike Fischer Oct 13 '18 at 13:28
  • 1
    @Jon Although the mystery is solved (+1) instead of manual \pagebreaks maybe you want really a shrinkable and stretchable \parskip? The parskip package could be even a better option in more complex documents. – Fran Oct 13 '18 at 22:21

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.