Note: This document is a translation of the German koma script manual


Chapter 2: Construction of the Page Layout with typearea



Yüklə 2,79 Mb.
Pdf görüntüsü
səhifə4/60
tarix03.02.2017
ölçüsü2,79 Mb.
#7439
1   2   3   4   5   6   7   8   9   ...   60

Chapter 2: Construction of the Page Layout with typearea

41

the header or footer is counted as part of the text.

Readers who are unsure about the the correct setting should re-read the above explanations.

Default is usually headinclude=false and footinclude=false, but this can change depend-

ing on KOMA-Script class and KOMA-Script packages used (see

section 3.1

and

chapter 5



).

Please note that when using these options with one of the KOMA-Script classes as in the

example above, they must be used either as a class option, or passed via

\KOMAoptions

or

\KOMAoption



after loading the class. Changing of these options after loading the typearea

package does not result in an automatic recalculation of the type area. Instead, the changes

only take effect at the next recalculation of the type area. For recalculation of the type area,

refer to the

DIV

option with the values last or current (see



page 35

) or the


\recalctypearea

command (see

page 37

).

mpinclude=simple switch



Besides

v2.8q


documents where the head and foot are part of the text area, there are also documents

where the margin-note area must be counted as part of the text body as well. The option

mpinclude

does exactly this. The option, as a simple switch

v3.00

, understands the standard



values for simple switches in

table 2.5

. One may also pass this option without specifying a

value, in which case the value true for simple switch is assumed.

The effect of mpinclude=true is that one width-unit of the text body is taken for the

margin-note area. Using option mpinclude=false, the default setting, the normal margin is

used for the margin-note area. The width of that area is one or one and a half width-unit,

depending on whether one-sided or double-sided page layout has been chosen. The option

mpinclude=true

is mainly for experts and so is not recommended.

In the cases where the option mpinclude is used, often a wider margin-note area is required.

In many cases not the whole margin-note width should be part of the text area, for example if

the margin is used for quotations. Such quotations are typeset as ragged text with the flushed

side where the text body is. Since ragged text gives no homogeneous optical impression, the long

lines can reach right into the normal margin. This can be done using option mpinclude and by

an enlargement of length \marginparwidth after the type area has been set up. The length can

be easily enlarged with the command \addtolength. How much the length has to be enlarged

depends on the special situation and it requires some flair. This is another reason the mpinclude

option is primarily left for experts. Of course one can set up the margin-width to reach a third

right into the normal margin; for example, using

\setlength{\marginparwidth}{1.5\marginparwidth}

gives the desired result.

Currently there is no option to enlarge the margin by a given amount. The only solution is to

either not use the option mpinclude or to set mpinclude to false, and after the type area has

been calculated, one reduces the width of the text body \textwidth and enlarges the margin width


Chapter 2: Construction of the Page Layout with typearea

42

\marginparwidth

by the same amount. Unfortunately, this cannot be combined with automatic

calculation of the DIV value. In contrast

DIV=calc

(see


page 34

) heeds mpinclude.

Please note that when using this option with one of the KOMA-Script classes as in the

example above, it must be used either as a class option, or passed via

\KOMAoptions

or

\KOMAoption



after loading the class. Changing of this option after loading the typearea package

does not result in an automatic recalculation of the type area. Instead, the changes only take

effect at the next recalculation of the type area. For recalculation of the type area, refer to the

DIV


option with the values last or current (see

page 35


) or the

\recalctypearea

command

(see


page 37

).

headlines=number of lines



headheight=height

We have seen how to calculate the type area using the typearea package and how to specify

whether header and footer are part of the text or the margins. However, in particular for the

header, we still have to specify the height. This is achieved with the options headlines and

headheight

v3.00


.

The option headlines is set to the number of header lines. The typearea package uses a

default of 1.25. This is a compromise, large enough for underlined headers (see

section 3.1

)

and small enough that the relative weight of the top margin is not affected too much when the



header is not underlined. Thus in most cases you may leave headlines at its default value

and adapt it only in special cases.



Example: Assume that you want to use a header with two lines. Normally this would result

in an “overfull \vbox” warning for each page. To prevent this from happening,

the typearea package is told to calculate an appropriate type area:

\documentclass[a4paper]{article}

\usepackage[headlines=2.1]{typearea}

If you use a KOMA-Script class, it is recommended to pass this option directly as

a class option:

\documentclass[a4paper,headlines=2.1]{scrartcl}

Commands that can be used to define the contents of a header with two lines are

described in

chapter 5

.

In some cases it is useful to be able to specify the header height not in lines but directly as a



length measurement. This is accomplished with the aid of the alternative option headheight.

For height any lengths and sizes that L

A

TEX understands are valid. It should be noted though



that when using a L

A

TEX length such as \baselineskip its value at the time of the calculation



of the type area and margins, not at the time of setting of the option, is decisive.

Please note that when using these options with one of the KOMA-Script classes as in the

example above, they must be used either as a class option, or passed via

\KOMAoptions

or


Chapter 2: Construction of the Page Layout with typearea

43

\KOMAoption

after loading the class. Changing of these options after loading the typearea

package does not result in an automatic recalculation of the type area. Instead, the changes

only take effect at the next recalculation of the type area. For recalculation of the type area,

refer to the

DIV

option with the values last or current (see



page 35

) or the


\recalctypearea

command (see

page 37

).

footlines=number of lines



footheight=height

\footheight

As

v3.12


well as we needed a height value for the head, we need a height value for the page footer.

But in difference to the height of the head, L

A

TEXitself do not provide a length for the height of



the page footer. So typearea defines the new length \footheight, if it does not exist. Wether

or not this length will be used by classes or packages depends on the classes and packages,

that will be used. The KOMA-Script package scrlayer-scrpage incorporates \footheight and

actively cooperates with typearea. The KOMA-Script classes do not recognize \footheight,

because without any package assistance they provide only page styles with single-line page

footers.


You can use footlines to setup the number of lines in the page footer, similar to

headlines

for the number of lines in the page header. By default typearea uses 1.25 foot-

lines. This is a compromise, large enough for overlining or underlining footers and small

enough that the relative weight of the bottom margin is not affected too mich when the footer

is neither over- nor underlined. Thus in most cases you may leave number of lines at its

default value and adapt it only in special cases.

Example: Assume a two-lined copyright note should be placed in the page footer. Indeed,

L

A



TEX itself does not test, whether or not the footer has room enough for that, ex-

ceeding of the available height would probably could result in unbalanced margins.

Moreover, for example package scrlayer-scrpage, that may be used to define such a

page footer, would definitely do such a test and would notify a recognised oversize.

So it makes sense, to declare the needed footheight already for the calculation of

the text area and the margins:

\documentclass[a4paper]{article}

\usepackage[footlines=2.1]{typearea}

Again, if you use a KOMA-Script class, it is recommended to pass this option

directly a a class option:

\documentclass[footlines=2.1]{scrartcl}

Commands that can be used to define the contents of a footer with two lines are

described in

chapter 5

.


Chapter 2: Construction of the Page Layout with typearea

44

In some cases it is useful to be able to specify the footer height not in lines but directly as a

length measurement. This is accomplished with the aid of the alternative option footheight.

For height any lengths and sizes that L

A

TEX understands are valid. It should be noted though



that when using a L

A

TEX length such as \baselineskip its value at the time of the calculation



of the type area and margins, not at the time of setting of the option, is decisive.

Please note that when using these options with one of the KOMA-Script classes as in the

example above, they must be used either as a class option, or passed via

\KOMAoptions

or

\KOMAoption



after loading the class. Changing of these options after loading the typearea

package does not result in an automatic recalculation of the type area. Instead, the changes

only take effect at the next recalculation of the type area. For recalculation of the type area,

refer to the

DIV

option with the values last or current (see



page 35

) or the


\recalctypearea

command (see

page 37

).

\areaset[BCOR ]{width }{height }



So far we have seen how a good or even very good type area is calculated and how the typearea

package can support these calculations, giving you at the same time the freedom to adapt the

layout to your needs. However, there are cases where the text body has to fit exactly some

specified dimensions. At the same time the margins should be well spaced and a binding correc-

tion should be possible. The typearea package offers the command \areaset for this purpose.

As parameters this command accepts the binding correction and the width and height of the

text body. Width and position of the margins will then be calculated automatically, taking

account of the options

headinclude

,

headinclude=false



,

footinclude

and

footinclude=



false

where needed. On the other hand, the options

headlines

and


headheight

are ignored!

The default of BCOR is 0 pt. If you want to re-use the current binding correction, e. g. the

value set by option

BCOR

, you can use the symbolic value current at the optional argument.



Example: Assume a text, printed on A4 paper, should have a width of exactly 60 characters

of typewriter font and a height of exactly 30 lines. This could be achieved as

follows:

\documentclass[a4paper,11pt]{article}

\usepackage{typearea}

\newlength{\CharsLX}% Width of 60 characters

\newlength{\LinesXXX}% Height of 30 lines

\settowidth{\CharsLX}{\texttt{1234567890}}

\setlength{\CharsLX}{6\CharsLX}

\setlength{\LinesXXX}{\topskip}

\addtolength{\LinesXXX}{29\baselineskip}

\areaset{\CharsLX}{\LinesXXX}

You need only 29 instead of 30, because the base line of the topmost text line

is \topskip below the top margin of the type area, as long as the height of the



Chapter 2: Construction of the Page Layout with typearea

45

topmost line is less than \topskip. Thus, the uppermost line does not require any

height. The descenders of characters on the lowermost line, on the other hand,

hang below the dimensions of the type area.

A poetry book with a square text body with a page length of 15 cm and a binding

correction of 1 cm could be achieved like this:

\documentclass{poetry}

\usepackage{typearea}

\areaset[1cm]{15cm}{15cm}

DIV=areaset

In

v3.00


rare cases it is useful to be able to reconstruct the current type area anew. This is possible

via the option DIV=areaset, where

\KOMAoptions

{DIV=areaset}

corresponds to the

\areaset[current]{\textwidth}{\textheight}

command. The same result is obtained if one uses

DIV=last


and the typearea was last set

with


\areaset

.

The typearea package was not made to set up predefined margin values. If you have to do



so you may use package geometry (see [

Ume10


]).

2.7. Paper Format Selection

The paper format is a definitive characteristic of any document. As already mentioned in

the description of the supported page layout constructions (see

section 2.1

to

section 2.3



from

page 25


onwards), the entire page division and document layout depends on the paper format.

Whereas the L

A

TEX standard classes are restricted to a few formats, KOMA-Script supports



in conjunction with the typearea package even exotic paper sizes.

paper=format

The option paper

v3.00


is the central element for format selection in KOMA-Script. Format sup-

ports first of all the American formats letter, legal, and executive. In addition, it supports

the ISO formats of the series A, B, C, and D, for example A4 or — written in lowercase — a4.

Landscape formats are supported by specifying the option again, this time with value

landscape

or seascape

v3.02c

. The difference is that application dvips rotates at landscape by



-90 °, while it rotates by +90 ° at seascape. So you may use seascape whenever a PostScript

viewer application shows landscape pages upside-down. But you may see the difference only

if you do not deactivate option

pagesize


, which will be described next.

Additionally

v3.01b

, the format can also be specified in the form height :width or



width :height

. Whether

v3.22

the first or the second value is the height or width depends



Chapter 2: Construction of the Page Layout with typearea

46

on the paper orientation. With paper=landscape or paper=seascape the smaller value is

the height and the larger one is the width . With paper=portrait the smaller value is the

width

and the larger one is the height .

Note that until version 3.01a the first value was always the height and the second one

the width . From version 3.01b until version 3.21, the first value was always the width and

the second one the height . This is important if you use compatibility settings (see option

version


,

section 2.5

,

page 30


).

Example: Assume one wishes to print on ISO A8 file cards in landscape orientation. Margins

should be very small, no header or footer will be used.

\documentclass{article}

\usepackage[headinclude=false,footinclude=false,

paper=A8,landscape]{typearea}

\areaset{7cm}{5cm}

\pagestyle{empty}

\begin{document}

\section*{Supported Paper Sizes}

letter, legal, executive, a0, a1 \dots%

b0, b1 \dots\ c0, c1 \dots\ d0, d1 \dots

\end{document}

If the file cards have the special format (height:width) 5 cm : 3 cm, this can be

achieved using the following code.

\documentclass{article}

\usepackage[headinclude=false,footinclude=false,%

paper=landscape,paper=5cm:3cm]{typearea}

\areaset{4cm}{2.4cm}

\pagestyle{empty}

\begin{document}

\section*{Supported Paper Sizes}

letter, legal, executive, a0, a1 \dots%

b0, b1 \dots\ c0, c1 \dots\ d0, d1 \dots

\end{document}

As part of the predefined defaults, KOMA-Script uses A4 paper in portrait orientation.

This is in contrast to the standard classes, which by default use the American letter paper

format.

Please note that when using these options with one of the KOMA-Script classes, it must



be used either as a class option, or passed via

\KOMAoptions

or

\KOMAoption



after loading

the class. Changing of this option after loading the typearea package does not result in an

automatic recalculation of the type area. Instead, the changes only take effect at the next

recalculation of the type area. For recalculation of the type area, refer to the

DIV

option with



the values last or current (see

page 35


) or the

\recalctypearea

command (see

page 37


).

Chapter 2: Construction of the Page Layout with typearea

47

pagesize=output driver

The above-mentioned mechanisms for choice of paper format only affect the output insofar as

internal L

A

TEX lengths are set. The typearea package then uses them in the division of the page



into type area and margins. The specification of the DVI formats, however, does not include any

indications of paper format. If printing is done directly from DVI format to a low-level printer

language such as PCL or ESC/P2, this is usually not an issue since with this output also the

zero-position is at the top left, identical to DVI. If, however, translation is made into a language

such as PostScript or PDF, in which the zero-position is at a different point, and in which also the

paper format should be specified in the output data, then this information is missing. To solve this

problem, the respective drivers use a predefined paper size, which the user can change either by

means of an option or via a corresponding command in the TEX source file. When using the DVI

driver dvips the information can be given in the form of a \special command. With pdfTEX or

VTEX one sets instead two lengths.

With option pagesize you may select an output driver for writing the paper size into

the destination document. Supported output drivers are listed at

table 2.6

. The default

v3.17

is

pagesize



. This usage without value is same like pagesize=auto.

Example: Assume that a document should be available both as a DVI data file and in PDF

format for online viewing. Then the preamble might begin as follows:

\documentclass{article}

\usepackage[paper=A4,pagesize]{typearea}

If the pdfTEX engine is used and PDF output is activated, then the two lengths

\pdfpagewidth

and \pdfpageheight are set appropriately. If, however, a DVI

data file is created — regardless of whether by L

A

TEX or by pdfL



A

TEX — then a

\special

is written at the start of this data file.

It is recommended always to specify this option. Generally the method without output

driver

, or with auto or automedia, is useful.



2.8. Tips

For theses many rules exist that violate even the most elementary rules of typography. The

reasons for such rules include typographical incompetence of those making them, but also

the fact that they were originally meant for mechanical typewriters. With a typewriter or

a primitive text processor dating back to the early 1980s, it was not possible to produce

typographically correct output without extreme effort. Thus rules were created that appeared

to be achievable and still allowed easy correction. To avoid short lines made worse by ragged

margins, the margins were kept narrow and the line spacing was increased to 1.5 for corrections.

Before the advent of modern text processing systems, single-spaced would have been the only

alternative — other than with TEX. In such a single-spaced document even correction signs



Chapter 2: Construction of the Page Layout with typearea

48

Table 2.6.: Output driver for option pagesize=output driver

auto

Uses output driver pdftex if pdfTEX-specific registers \pdfpagewidth and



\pdfpageheight

are defined. In addition, output driver dvips will be used.

automedia

Almost the same as auto but if the VTEX-specific registers \mediawidth and

\mediaheight

are defined, they will be set additionally.

false

, no, off



Does not set any output driver and does not send page size information to the output

driver.


dvipdfmx

v3.05a


Writes paper size into DVI files using \special{pagesize=width ,height }. The

name of the output driver is dvipdfmx because application dvipdfmx handles such

specials not only at document preamble but at the document body too.

dvips


Using this option at the document preamble sets paper size using \special

{pagesize=width ,height }

. While application dvips cannot handle changes of

paper size at the inner document pages a hack is needed to achieve such changes.

Use changes of paper size after \begin{document} on your own risk, if you are using

dvips


!

pdftex


Sets paper size using the pdfTEX-specific registers \pdfpagewidth and

\pdfpageheight

. You may do this at any time in your document.

would have been difficult to add. When computers became more widely available for text

processing, some students tried to use a particularly “nice” font to make their work look

better than it really was. They forgot however that such fonts are often more difficult to read

and therefore unsuitable for this purpose. Thus two bread-and-butter fonts became widely

used which neither fit together nor are particularly suitable for the job. In particular Times

is a relatively narrow font which was developed at the beginning of the 20

th

century for the

narrow columns of British newspapers. Modern versions usually are somewhat improved. But

still the Times font required in many rules does not really fit to the margin sizes prescribed.

L

A

TEX already uses sufficient line spacing, and the margins are wide enough for corrections.



Thus a page will look generous, even when quite full of text.

To some extent, the questionable rules are difficult to implement in L

A

TEX. A fixed number



of characters per line can be kept only when a non-proportional font is used. There are very


Yüklə 2,79 Mb.

Dostları ilə paylaş:
1   2   3   4   5   6   7   8   9   ...   60




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©www.azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin