1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This document is an unofficial reference manual for LaTeX, a
document preparation system, version of October 2018.
This manual was originally translated from LATEX.HLP v1.0a in the
VMS Help Library. The pre-translation version was written by
George D. Greenwade of Sam Houston State University. The
LaTeX 2.09 version was written by Stephen Gilmore. The
LaTeX2e version was adapted from this by Torsten Martinsen. Karl
Berry made further updates and additions, and gratefully acknowledges
using Hypertext Help with LaTeX, by Sheldon Green, and
LaTeX Command Summary (for LaTeX 2.09) by
L. Botway and C. Biemesderfer (published by the TeX Users
Group as TeXniques number 10), as reference material. We also
gratefully acknowledge additional material appearing in
latex2e-reference by Martin Herbert Dietze. (From these references no
text was directly copied.)
Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013,
2014, 2015, 2016, 2017, 2018 Karl Berry.
Copyright 1988, 1994, 2007 Stephen Gilmore.
Copyright 1994, 1995, 1996 Torsten Martinsen.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions. -->
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Page breaking (LaTeX2e unofficial reference manual (October 2018))</title>
<meta name="description" content="Page breaking (LaTeX2e unofficial reference manual (October 2018))">
<meta name="keywords" content="Page breaking (LaTeX2e unofficial reference manual (October 2018))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="latex2e_0.html#Top" rel="start" title="Top">
<link href="latex2e_30.html#Index" rel="index" title="Index">
<link href="latex2e_0.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="latex2e_0.html#Top" rel="up" title="Top">
<link href="latex2e_11.html#Footnotes" rel="next" title="Footnotes">
<link href="latex2e_9.html#g_t_005clinebreak-_0026-_005cnolinebreak" rel="prev" title="\linebreak & \nolinebreak">
<style type="text/css">
<!--
body {margin: 1em; margin-top: 0px; padding-top: 1px}
a.anchor {float: right}
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body id="top" lang="en">
<a name="Page-breaking" class="anchor"></a>
<a name="Page-breaking-1" class="anchor"></a>
<h2 class="chapter">Page breaking</h2>
<a name="index-page-breaking" class="anchor"></a>
<a name="index-breaking-pages" class="anchor"></a>
<p>Ordinarily LaTeX automatically takes care of breaking output into
pages with its usual aplomb. But if you are writing commands, or
tweaking the final version of a document, then you may need to
understand how to influence its actions.
</p>
<p>LaTeX’s algorithm for splitting a document into pages is more complex
than just waiting until there is enough material to fill a page and
outputting the result. Instead, LaTeX typesets more material than
would fit on the page and then chooses a break that is optimal in some
way (it has the smallest badness). An example of the advantage of this
approach is that if the page has some vertical space that can be
stretched or shrunk, such as with rubber lengths between paragraphs,
then LaTeX can use that to avoid widow lines (where a new page starts
with the last line of a paragraph; LaTeX can squeeze the extra line
onto the first page) and orphans (where the first line of paragraph is
at the end of a page; LaTeX can stretch the material of the first
page so the extra line falls on the second page). Another example is
where LaTeX uses available vertical shrinkage to fit on a page not
just the header for a new section but also the first two lines of that
section.
</p>
<p>But LaTeX does not optimize over the entire document’s set of page
breaks. So it can happen that the first page break is great but the
second one is lousy; to break the current page LaTeX doesn’t look as
far ahead as the next page break. So occasionally you may want to
influence page breaks while preparing a final version of a document.
</p>
<p>See <a href="latex2e_5.html#Layout">Layout</a> for more material that is relevant to page breaking.
</p>
<hr>
<a name="g_t_005cclearpage-_0026-_005ccleardoublepage" class="anchor"></a>
<a name="g_t_005cclearpage-_0026-_005ccleardoublepage-1" class="anchor"></a>
<h3 class="section"><code>\clearpage</code> & <code>\cleardoublepage</code></h3>
<a name="index-_005cclearpage" class="anchor"></a>
<a name="index-flushing-floats-and-starting-a-page" class="anchor"></a>
<a name="index-starting-a-new-page-and-clearing-floats" class="anchor"></a>
<a name="index-_005ccleardoublepage" class="anchor"></a>
<a name="index-starting-on-a-right_002dhand-page" class="anchor"></a>
<p>Synopsis:
</p>
<div class="example">
<pre class="example">\clearpage
</pre></div>
<p>or
</p>
<div class="example">
<pre class="example">\cleardoublepage
</pre></div>
<p>End the current page and output all of the pending floating figures and
tables (see <a href="latex2e_5.html#Floats">Floats</a>). If there are too many floats to fit on the
page then LaTeX will put in extra pages containing only floats. In
two-sided printing, <code>\cleardoublepage</code> also makes the next page of
content a right-hand page, an odd-numbered page, if necessary inserting
a blank page. The <code>\clearpage</code> command is robust while
<code>\cleardoublepage</code> is fragile (see <a href="latex2e_12.html#g_t_005cprotect">\protect</a>).
</p>
<p>LaTeX’s page breaks are optimized so ordinarily you only use this
command in a document body to polish the final version, or inside
commands.
</p>
<p>The <code>\cleardoublepage</code> command will put in a blank page, but it
will have the running headers and footers. To get a really blank
page, use this command.
</p>
<div class="example">
<pre class="example">\let\origdoublepage\cleardoublepage
\newcommand{\clearemptydoublepage}{%
\clearpage
{\pagestyle{empty}\origdoublepage}%
}
</pre></div>
<p>If you want LaTeX’s standard <code>\chapter</code> command to do this then
add the line <code>\let\cleardoublepage\clearemptydoublepage</code>.
</p>
<p>The command <code>\newpage</code> (see <a href="#g_t_005cnewpage">\newpage</a>) also ends the current
page, but without clearing pending floats. And, if LaTeX is in
two-column mode then <code>\newpage</code> ends the current column while
<code>\clearpage</code> and <code>\cleardoublepage</code> end the current page.
</p>
<hr>
<a name="g_t_005cnewpage" class="anchor"></a>
<a name="g_t_005cnewpage-1" class="anchor"></a>
<h3 class="section"><code>\newpage</code></h3>
<a name="index-_005cnewpage" class="anchor"></a>
<a name="index-new-page_002c-starting" class="anchor"></a>
<a name="index-starting-a-new-page" class="anchor"></a>
<p>Synopsis:
</p>
<div class="example">
<pre class="example">\newpage
</pre></div>
<p>End the current page. This command is robust (see <a href="latex2e_12.html#g_t_005cprotect">\protect</a>).
</p>
<p>LaTeX’s page breaks are optimized so ordinarily you only use this
command in a document body to polish the final version, or inside
commands.
</p>
<p>While the commands <code>\clearpage</code> and <code>\cleardoublepage</code> also
end the current page, in addition they clear pending floats
(see <a href="#g_t_005cclearpage-_0026-_005ccleardoublepage">\clearpage & \cleardoublepage</a>). And, if LaTeX is in
two-column mode then <code>\clearpage</code> and <code>\cleardoublepage</code> end
the current page, possibly leaving an empty column, while
<code>\newpage</code> only ends the current column.
</p>
<p>In contrast with <code>\pagebreak</code> (see <a href="#g_t_005cpagebreak-_0026-_005cnopagebreak">\pagebreak & \nopagebreak</a>),
the <code>\newpage</code> command will cause the new page to start right where
requested. This
</p>
<div class="example">
<pre class="example">Four score and seven years ago our fathers brought forth on this
continent,
\newpage
\noindent a new nation, conceived in Liberty, and dedicated to the
proposition that all men are created equal.
</pre></div>
<p>makes a new page start after ‘<samp>continent,</samp>’ and the cut-off line is
not right justified. In addition, <code>\newpage</code> does not vertically
stretch out the page, as <code>\pagebreak</code> does.
</p>
<hr>
<a name="g_t_005cenlargethispage" class="anchor"></a>
<a name="g_t_005cenlargethispage-1" class="anchor"></a>
<h3 class="section"><code>\enlargethispage</code></h3>
<a name="index-_005cenlargethispage" class="anchor"></a>
<a name="index-enlarge-current-page" class="anchor"></a>
<p>Synopsis, one of:
</p>
<div class="example">
<pre class="example">\enlargethispage{size}
\enlargethispage*{size}
</pre></div>
<p>Enlarge the <code>\textheight</code> for the current page. The required
argument <var>size</var> must be a rigid length (see <a href="latex2e_14.html#Lengths">Lengths</a>). It may be
positive or negative. This command is fragile (see <a href="latex2e_12.html#g_t_005cprotect">\protect</a>).
</p>
<p>A common strategy is to wait until you have the final text of a
document, and then pass through it tweaking line and page breaks. This
command allows you some page size leeway.
</p>
<p>This will allow one extra line on the current page.
</p>
<div class="example">
<pre class="example">\enlargethispage{\baselineskip}
</pre></div>
<p>The starred form <code>\enlargesthispage*</code> tries to squeeze the material
together on the page as much as possible, for the common use case of
getting one more line on the page. This is often used together with an
explicit <code>\pagebreak</code>.
</p>
<hr>
<a name="g_t_005cpagebreak-_0026-_005cnopagebreak" class="anchor"></a>
<a name="g_t_005cpagebreak-_0026-_005cnopagebreak-1" class="anchor"></a>
<h3 class="section"><code>\pagebreak</code> & <code>\nopagebreak</code></h3>
<a name="index-_005cpagebreak" class="anchor"></a>
<a name="index-_005cnopagebreak" class="anchor"></a>
<a name="index-page-break_002c-forcing" class="anchor"></a>
<a name="index-page-break_002c-preventing" class="anchor"></a>
<p>Synopses:
</p>
<div class="example">
<pre class="example">\pagebreak
\pagebreak[<var>zero-to-four</var>]
</pre></div>
<p>or
</p>
<div class="example">
<pre class="example">\nopagebreak
\nopagebreak[<var>zero-to-four</var>]
</pre></div>
<p>Encourage or discourage a page break. The optional <var>zero-to-four</var>
is an integer that allows you to soften the request. The default is 4,
so that without the optional argument these commands entirely force or
prevent the break. But for instance <code>\nopagebreak[1]</code> suggests to
LaTeX that another spot might be preferable. The higher the number,
the more insistent the request. Both commands are fragile
(see <a href="latex2e_12.html#g_t_005cprotect">\protect</a>).
</p>
<p>LaTeX’s page endings are optimized so ordinarily you only use this
command in a document body to polish the final version, or inside
commands.
</p>
<p>If you use these inside a paragraph, they apply to the point following
the line in which they appear. So this
</p>
<div class="example">
<pre class="example">Four score and seven years ago our fathers brought forth on this
continent,
\pagebreak
a new nation, conceived in Liberty, and dedicated to the proposition
that all men are created equal.
</pre></div>
<p>does not give a page break at ‘<samp>continent,</samp>’ but instead at
‘<samp>nation,</samp>’ since that is where LaTeX breaks that line. In
addition, with <code>\pagebreak</code> the vertical space on the page is
stretched out where possible so that it extends to the normal bottom
margin. This can look strange, and if <code>\flushbottom</code> is in effect
this can cause you to get ‘<samp>Underfull \vbox (badness 10000) has
occurred while \output is active</samp>’. See <a href="#g_t_005cnewpage">\newpage</a> for a command that
does not have these effects.
</p>
</body>
</html>
|