summaryrefslogtreecommitdiff
path: root/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-changemargin.html
blob: 9c95b56aff832b320f8bdbc7d8641c07b8017e8e (plain)
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
<head>
<title>UK TeX FAQ -- question label changemargin</title>
</head><body>
<h3>Changing the margins in LaTeX</h3>
<p>Changing the layout of a document's text on the page involves several
subtleties not often realised by the beginner.  There are interactions
between fundamental TeX constraints, constraints related to the
design of LaTeX, and good typesetting and design practice, that
mean that any change must be very carefully considered, both to ensure
that it "works" and to ensure that the result is pleasing to the
eye.
<p>Lamport's warning to beginners in his section on 'Customizing the
Style' - "don't do it" - needs to be taken seriously. One-inch
margins on A4 paper are fine for 10- or 12-pitch typewriters, but not
for 10pt (or even 11pt or 12pt) type because readers find such wide,
dense, lines difficult to read: there should ideally be no more than
75 characters per line (though the constraints change for two-column
text).
<p>The 'ultimate' tool for adjusting the dimensions and position of the
printed material on the page is the <i>geometry</i> package; a very
wide range of adjustments of the layout may be relatively
straightforwardly programmed, and package documentation is good and
comprehensive.
<p>Somewhat simpler to use is the <i>vmargin</i> package, which has a
canned set of paper sizes (a superset of that provided in LaTeX2e),
provision for custom paper, margin adjustments and provision for
two-sided printing.
<p>LaTeX controls the page layout with a number of parameters, which
allow you to change the distance from the edges of a page to the left
and top edges of your typeset text, the width and height of the text,
and the placement of other text on the page.  However, they are
somewhat complex, and it is easy to get their interrelationships wrong
when redefining the page layout. The layout package defines a
<code>\</code><code>layout</code> command which draws a diagram of your existing page
layout, with the dimensions (but not their interrelationships) shown.
This FAQ recommends that you use a package to establish
consistent settings of the parameters: the interrelationships are
taken care of in the established packages, without you needing to
think about them.
<p>If you're still eager to "do it yourself", start by familiarising yourself
with LaTeX's page layout parameters. For example, see section C.5.3 of the
LaTeX manual (pp. 181-182), or corresponding sections in many of the other
good LaTeX manuals (see <a href="FAQ-books.html">LaTeX books</a>). 
<p>The text height and width, <code>\</code><code>textheight</code> and <code>\</code><code>textwidth</code>,
require more care than you might expect: the height should be set to
fit an integral number of text lines, and the width should be
constrained by the number of characters per line, as mentioned above.
<p>Margins are controlled by three parameters. The pair
<code>\</code><code>oddsidemargin</code> and <code>\</code><code>evensidemargin</code> are so-called because it
is conventionally taken that odd-numbered pages appear on the
right-hand side of a two-page spread ('recto') and even-numbered pages
on the left-hand side ('verso'). Both parameters refer to the
left-hand margin; the right-hand margin is specified by implication,
from the size of <code>\</code><code>textwidth</code> and the width of the paper. The
"origin" (the zero position) on the page is one inch from the top of
the paper and one inch from the left side; positive horizontal
measurements extend right across the page, and positive vertical
measurements extend down the page. Thus, the parameters
<code>\</code><code>evensidemargin</code>, <code>\</code><code>oddsidemargin</code> and <code>\</code><code>topmargin</code>, should
be set to be 1 inch less than the true margin; for margins closer to
the left and top edges of the page than 1 inch, the margin parameters
must be set to negative values.
<p>Another surprise is that you cannot change the width or height of the
text within the document, simply by modifying the text size
parameters. The simple rule is that the parameters should only be
changed in the preamble of the document, i.e., before the
<code>\</code><code>begin{document}</code> statement. To adjust text width within a
document we define an environment:
<blockquote>
<pre>
\newenvironment{changemargin}[2]{%
  \begin{list}{}{%
    \setlength{\topsep}{0pt}%
    \setlength{\leftmargin}{#1}%
    \setlength{\rightmargin}{#2}%
    \setlength{\listparindent}{\parindent}%
    \setlength{\itemindent}{\parindent}%
    \setlength{\parsep}{\parskip}%
  }%
  \item[]}{\end{list}}
</pre>
</blockquote>
This environment takes two arguments, and will indent the left and
right margins, respectively, by the parameters' values. Negative
values will cause the margins to be narrowed, so
<code>\</code><code>begin{changemargin}{-1cm}</code>{-1cm} narrows the left and right
margins by 1cm.
<p>The <i>chngpage</i> package provides ready-built commands to do the
above; it includes provision for changing the shifts applied to your
text according to whether you're on an odd or an even page of a
two-sided document.  The package's documentation (in the file itself)
suggests a strategy for changing text dimensions between pages - as
mentioned above, changing the text dimensions within the body of a
page may lead to unpredictable results.
<dl>
<dt><tt><i>chngpage.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/misc/chngpage.sty">macros/latex/contrib/misc/chngpage.sty</a>
<dt><tt><i>geometry.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/geometry.zip">macros/latex/contrib/geometry</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/geometry.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/geometry/">browse</a>)
<dt><tt><i>layout.sty</i></tt><dd>Distributed as part of <a href="ftp://cam.ctan.org/tex-archive/macros/latex/required/tools.zip">macros/latex/required/tools</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/required/tools.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/required/tools/">browse</a>)
<dt><tt><i>vmargin.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/vmargin.zip">macros/latex/contrib/vmargin</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/vmargin.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/vmargin/">browse</a>)
</dl>
<p><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=changemargin">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=changemargin</a>
</body>