diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-chngmargonfly.html')
-rw-r--r-- | Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-chngmargonfly.html | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-chngmargonfly.html b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-chngmargonfly.html new file mode 100644 index 00000000000..18c0bec481d --- /dev/null +++ b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-chngmargonfly.html @@ -0,0 +1,67 @@ +<head> +<title>UK TeX FAQ -- question label chngmargonfly</title> +</head><body> +<h3>Changing margins “on the fly”</h3> +<p/>One of the surprises characteristic of TeX use is that you cannot +change the width or height of the text within the document, simply by +modifying the text size parameters; TeX can’t change the text width +on the fly, and LaTeX only ever looks at text height when starting +a new page. +<p/>So 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 (so before any typesetting has +happened. +<p/>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><p> +The 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}{-1cm}</code> narrows the left and right +margins by 1 centimetre. +<p/>Given that TeX can’t do this, how does it work? — well, the +environment (which is a close relation of the LaTeX +<code>quote</code> environment) <em>doesn’t</em> change the text width +as far as TeX is concerned: it merely moves text around inside the +width that TeX believes in. +<p/>The <i>changepage</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 (<em>recto</em>) or an even +(<em>verso</em>) page of a two-sided document. +<p/>The (earlier) package <i>chngpage</i> provides the same facilities, +but it uses rather different syntax. <i>Changepage</i>’s structure +matches that of the <i>memoir</i> class, and it should be used for +any new work. +<p/>Changing the vertical dimensions of a page is more clumsy still: the +LaTeX command <code>\</code><code>enlargethispage</code> adjusts the size of the current +page by the size of its argument. Common uses are +<blockquote> +<pre> +\enlargethispage{\baselineskip} +</pre> +</blockquote><p> +to make the page one line longer, or +<blockquote> +<pre> +\enlargethispage{-\baselineskip} +</pre> +</blockquote><p> +to make the page one line shorter. +<dl> +<dt><tt><i>changepage.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/misc/changepage.sty">macros/latex/contrib/misc/changepage.sty</a> +<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> +</dl> +<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=chngmargonfly">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=chngmargonfly</a> +</body> |