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



Yüklə 2,49 Mb.
Pdf görüntüsü
səhifə2/47
tarix03.02.2017
ölçüsü2,49 Mb.
#7438
1   2   3   4   5   6   7   8   9   ...   47
Part I.

KOMA-Script for Authors

In this part you may find information for authors of articles, reports, books, and letters. It is

assumed that the average user is less interested in the implementation of KOMA-Script or in

the problems of implementing KOMA-Script. Also, the average user isn’t interested in obsolete

options and instructions. He wants to know how he can achieve things using current options

and instructions. Some users may be interested in typographic background information.

In this part, the few passages that contain additional information and justification, and

therefore are of less interest for the impatient reader, have been set in sans serif font and can be

skipped if necessary. For those who are interested in more information about implementation,

side effects with other packages, and obsolete options and instructions, please refer to

part II

on

page 263



. Furthermore, that part of the KOMA-Script guide describes all the features that

were created specially for writers of packages and classes.



24

Chapter 2.



Construction of the Page Layout with typearea

Many L


A

TEX classes, including the standard classes, present the user with the largely fixed

configuration of margins and typearea. With the standard classes, the configuration deter-

mined is very much dependent on the chosen font size. There are separate packages, such as

geometry (see [

Ume10


]), which give the user complete control, but also full responsibility, of

the settings of typearea and margins.

KOMA-Script takes a somewhat different approach with its typearea package. Here the

user is given several construction setting and automatization possibilities based on established

typography standards in order to help guide him or her in making a good choice.

It should be noted that the typearea package makes use of the scrbase package. The latter

is explained in the expert section of this document in

chapter 12

from

page 263


onwards. The

majority of the rules documented there are however not directed at the user, but rather at

authors of classes and packages.

2.1. Fundamentals of Page Layout

If you look at a single page of a book or other printed materials, you will see that it consists of

top, bottom, left, and right margins, a (running) head area, the text block, and a (running) foot

area. There is also a space between the head area and the text block, and between the text block

and the foot area. The relations between these areas are called the page layout.

The literature contains much discussion of different algorithms and heuristic approaches for

constructing a good page layout [

Koh02


]. Often mentioned is an approach which involves diagonals

and their intersections. The result is a page where the text block proportions are related to the

proportions of the page. In a single-sided document, the left and the right margin should have

equal widths. The relation of the upper margin to the lower margin should be 1:2. In a double-sided

document (e. g. a book) however, the complete inner margin (the margin at the spine) should be

the same as each of the two outer margins; in other words, a single page contributes only half of

the inner margin.

In the previous paragraph, we mentioned and emphasized the page. Erroneously, it is often

thought that with the page format the page is the same as the paper format. However, if you look

at a bound document, it is obvious that part of the paper vanishes in the binding and is no longer

part of the visible page. For the page layout, it is not the format of the paper which is important,

it is the impression of the visible page to the reader. Therefore, it is clear that the calculation

of the page layout must account for the “lost” paper in the binding and add this amount to the

width of the inner margin. This is called the binding correction. The binding correction is therefore

calculated as part of the gutter, not the visible inner margin.

The binding correction depends on the process of actually producing the document and thus

cannot be calculated in general. Every production process needs its own parameter. In professional


25

Chapter 2.

binding, this parameter is not too important since the printing is done on oversized paper which is

then cropped to the right size. The cropping is done in a way so that the relations for the visible

double-sided page are as explained above.

Now we know about the relations of the individual parts of a page. However, we do not yet

know about the width and the height of the text block. Once we know one of these values, we can

calculate all the other values from the paper format and the page format or the binding correction.



textblock height

textblock width page height page width



top margin

foot margin = 1 : 2



left margin

right margin = 1 : 1



half inner margin

outer margin = 1 : 2



page width

paper width − binding correction



top margin

bottom margin page height − textblock height



left margin

right margin page width − textblock width



half inner margin

outer margin page width − textblock width



half inner margin

binding correction gutter

The values left margin and right margin only exist in a single-sided document while

half inner margin

and outer margin only exist in a double-sided document. In these equations,

we work with half inner margin since the full inner margin belongs to a double-page. Thus, one

page has only half of the inner margin, half inner margin.

The question of the width of the textblock is also discussed in the literature. The optimum

width depends on several factors:

• size, width, type of the font used

• line spacing

• word length

• available room

The importance of the font becomes clear once you think about the meaning of serifs. Serifs are

fine strokes finishing off the lines of the letters. Letters whose main strokes run orthogonal to the

text line disturb the flow rather than keeping and leading the eye along the line. Those letters

then have serifs at the ends of the vertical strokes so that the horizontal serifs can help lead the

eye horizontally. In addition, they help the eye to find the beginning of the next line more quickly.

Thus, the line length for a serif font can be slightly longer than for a sans serif font.

With leading is meant the vertical distance between individual lines of text. In L

A

TEX, the leading



is set at about 20% of the font size. With commands like \linespread or, better, packages like

setspace (see [

TF11

]), the leading can be changed. A wider leading helps the eye to follow the



26

Chapter 2.

line. A very wide leading, on the other hand, disturbs reading because the eye has to move a

wide distance between lines. Also, the reader becomes uncomfortable because of the visible stripe

effect. The uniform gray value of the page is thereby spoiled. Still, with a wider leading, the lines

can be longer.

The literature gives different values for good line lengths, depending on the author. To some

extent, this is related to the native language of the author. Since the eye jumps from word to

word, short words make this task easier. Considering all languages and fonts, a line length of 60

to 70 characters, including spaces and punctuation, forms a usable compromise. This requires

well-chosen leading, but L

A

TEX’s default is usually good enough. Longer line lengths should only



be considered for highly-developed readers who spend several hours daily reading. However, even

for such readers, line lengths greater than 80 characters are unsuitable. In any case, the leading

must be appropriately chosen. An extra 5% to 10% is recommended as a good rule of thumb.

With fonts such as Palatino, which require some 5% more leading even at normal line lengths,

even more can be required.

Before looking at the actual construction of the page layout, there are just some minor things

left to know. L

A

TEX does not start the first line in the text block of a page at the upper edge of the



text block, but sets the baseline at a defined distance from the top of the text block. Also, L

A

TEX



knows the commands \raggedbottom and \flushbottom. \raggedbottom specifies that the

last line of a page should be positioned wherever it was calculated. This means that the position

of this line can be different on each page, up to the height of one line — in combination of the

end of the page with titles, figures, tables or similar, even more. In double-sided documents this

is usually undesirable. \flushbottom makes sure that the last line is always at the lower edge of

the text block. To achieve this, L

A

TEX sometimes needs to stretch vertical glue more than allowed.



Paragraph skip is such a stretchable, vertical glue, even when set to zero. In order to not stretch

the paragraph skip on normal pages where it is the only stretchable glue, the height of the text

block should be set to a multiple of the height of the text line, including the distance from the

upper edge of the text block to the first line.

This concludes the introduction to page layout as handled by KOMA-Script. Now, we can

begin with the actual construction.



2.2. Page Layout Construction by Dividing

The easiest way to make sure that the text area has the same ratios as the page is as follows:

• First, subtract the part BCOR, required for the binding correction, from the inner edge of

the paper, and divide the rest of the page vertically into DIV rows of equal height.

• Next, divide the page horizontally into the same number (DIV) of columns.

• Then, take the uppermost row as the upper margin and the two lowermost rows as the lower

margin. If you are printing double-sided, you similarly take the innermost column as the inner

margin and the two outermost columns as the outer margin.



27

Chapter 2.

binding

correction



page layout left

page layout right

9

8

7



6

5

4



3

2

1



9

8

7



6

5

4



3

2

1



9

8

7



6

5

4



3

2

1



9 8 7 6 5 4 3 2

Figure 2.1.: Double-sided layout with the box construction of the classical division factor of 9, after

subtraction of a binding correction

• Then add the binding correction BCOR to the inner margin.

What now remains of the page is the text area. The width and the height of the text area and

margins result automatically from the number of rows and columns DIV. Since the margins always

need three stripes, DIV must be necessarily greater than three. In order that the text area occupy

at least twice as much space as the margins, DIV should really be equal to or greater than 9. With

this value, the construction is also known as the classical division factor of 9 (see

figure 2.1

).

In KOMA-Script, this kind of construction is implemented in the typearea package, where the



bottom margin may drop any fractions of a line in order to conform with the minor condition for

the text area height mentioned in the previous paragraph, and thereby to minimize the mentioned

problem with \flushbottom. For A4 paper, DIV is predefined according to the font size (see

table 2.2

,

page 33


). If there is no binding correction (BCOR = 0 pt), the results roughly match

the values of

table 2.1

,

page 32



.

In addition to the predefined values, one can specify BCOR and DIV as options when loading the

package (see

section 2.4

, from

page 30


onwards). There is also a command to explicitly calculate

the type area by providing these values as parameters (also see

section 2.4

,

page 36



).

The typearea package can automatically determine the optimal value of DIV for the font and

leading used. Again, see

section 2.4

,

page 33


.

28

Chapter 2.



2.3. Page Layout Construction by Drawing a Circle

In addition to the page layout construction method previously described, a somewhat more classical

method can be found in the literature. The aim of this method is not only to obtain identical

ratios in the page proportions, but it is considered optimal when the height of the text block is the

same as the width of the page. The exact method is described in [

Tsc87


].

A disadvantage of this late Middle Age method is that the width of the text area is no longer

dependent on the font. Thus, one does not choose the text area to match the font, but the author

or typesetter has to choose the font according to the text area. This can be considered a “must”.

In the typearea package this construction is changed slightly. By using a special (normally

meaningless) DIV value or a special package option, a DIV value is chosen to match the perfect

values of the late Middle Age method as closely as possible. See also

section 2.4

,

page 33


.

2.4. Early or late Selection of Options

In this section a peculiarity of KOMA-Script is presented, which, apart from the typearea

package, is also relevant to other KOMA-Script packages and classes. Such that the user can

find all information corresponding to a single package or a single class in the relevant chapter,

this section is found almost identically in several chapters. Users who are not only interested

in a particular package or class, but wish to gain an overview of KOMA-Script as a whole,

may read the section in one chapter and may thereafter skip it wherever coming across it in

the document.

\documentclass[option list ]{KOMA - Script class }

\usepackage[option list ]{package list }

In L

A

TEX, provision is made for the user to pass class options as a comma-separated list of



keywords as optional arguments to \documentclass. Apart from being passed to the class,

these options are also passed on to all packages which can understand the options. Provision

is also made for the user to pass optional arguments as a comma-separated list of keywords

as optional arguments to \usepackage. KOMA-Script expands

v3.00

the option mechanism for the



KOMA-Script classes and various packages to use further possibilities. Thus, most KOMA-

Script options can also take a value. An option may have not only the form Option , but

may also have the form option =value . Apart from this difference \documentclass and

\usepackage

function the same in KOMA-Script as described in [

Tea05b


] or any introduction

to L


A

TEX, for example [

OPHS11

].

When using a KOMA-Script class, no options should be passed on unnecessary, explicit



loading of the typearea or scrbase packages. The reason for this is that the class already loads

these packages without options and L

A

TEX refuses multiple loadings of a package with different



option settings.

You should note, that in opposite to the interface described below the options interface of

\documentclass

and \usepackage is not robust. So commands, lengths, counters and such



29

Chapter 2.

constructs may break inside the optional argument of these commands. Because of this, the

usage of a L

A

TEX length inside the value of an option would cause an error before KOMA-Script



can get the control over the option execution. So, if you want to use a L

A

TEX length, counter



or command a part of the value of an option, you have to use \KOMAoptions or \KOMAoption.

These commands will be described next.

\KOMAoptions{option list }

\KOMAoption{option }{value list }

KOMA-Script

v3.00


offers most class and package options the opportunity to change the value of

options even after loading of the class or package. One may then change the values of a list of

options at will with the \KOMAoptions command. Each option in the option list has the

form option =value .

Some options also have a default value. If one does not give a value, i. e., gives the option

simply in the form option , then the default value will be used.

Some options can assume several values simultaneously. For such options there exists the

possibility, with the help of \KOMAoption, to pass a single option a list of values. The

individual values are given as a comma-separated value list .

To implement this possibility KOMA-Script uses the commands \FamilyOptions and

\FamilyOption

with the family “KOMA”. For more information in these commands see

part II

,

section 12.2



,

page 268


.

2.5. Compatibility with Earlier Versions of KOMA-Script

Those who achieve their documents in source code set utmost value to the fact that future

L

A

TEX runs will yield exactly the same result. Nevertheless, in some cases improvement and bug



corrections of packages will result in changes of the behaviour and make-up. But sometimes

this is not wanted.

version=value

version=first

version=last

Since


v2.96a

v2.9t


v3.01b

version 2.96a of KOMA-Script, for scrlttr2 since version 2.9t, and for typearea since

version 3.01b, it’s your choice if your source code should result in the same make-up at fu-

ture L


A

TEX runs or if you like to participate in all improvements of new releases. You may

select the compatible version of KOMA-Script with option version. Compatibility to the

lowest supported KOMA-Script release may be achieved by version=first or version=2.9

or version=2.9t. Setting value to an unknown release number will result in a warning

message and selects version=first for safety.

With version=last the most recent version will be selected at every L

A

TEX run. Be warned,



though, that using version=last poses possibilities of compatibility issues for future L

A

TEX



30

Chapter 2.

runs. Option version without any value means the same.

v3.01a


This is the default behaviour as

long as you do not use any deprecated options.

If you use a deprecated option of KOMA-Script 2, KOMA-Script 3 will switch to

version=first

automatically. This will also result in a warning message that explains how to

prevent this switching. Alternatively you may select another adjustment using option version

with the wanted compatibility after the deprecated option.

Compatibility is primarily make-up compatibility. New features not related to the mark-up

will be available even if you switch compatibility to a version before first implementation of

the feature. Option version does not influence make-up changes that are motivated by bug

fixes. If you need bug compatibility you should physically save the used KOMA-Script version

together with your document.

Please note that you cannot change option version anymore after loading the package

typearea. Therefore, the usage of option version within the argument of \KOMAoptions or

\KOMAoption

is not recommended and will cause an error.



2.6. Options and Macros to Influence the Page Layout

The package typearea offers two different user interfaces to influence type area construction.

The more important method is to load the package with options. For information on how to

load packages and to give package options, please refer to the L

A

TEX literature, e. g. [



OPHS11

]

and [



Tea05b

], or the examples given here. Since the typearea package is loaded automatically

when using the KOMA-Script main classes, the package options can be given as class options

(see


section 3.1

).

In this section the protocol class will be used, not an existing KOMA-Script class but a



hypothetical one. This documentation assumes that ideally there exists a class for every

specific task.

BCOR=correction

With the aid of the option BCOR=correction

v3.00

one may specify the absolute value of the binding



correction, i. e., the width of the area which will be lost from the paper width in the binding

process. This value is then automatically taken into account in the page layout construction

and in the final output is added to the inner (or the left) margin. For the correction

specification any measurement unit understood by TEX is valid.



Example: Assume one is creating a financial report, which should be printed out single-sided

on A4 paper, and finally kept in a clamp folder. The clamp will hide 7.5 mm. The

stack of pages is very thin, thus through paging at most another 0.75 mm will be

lost. Therefore, one may write:

\documentclass[a4paper]{report}

\usepackage[BCOR=8.25mm]{typearea}



31

Chapter 2.

or

\documentclass[a4paper,BCOR=8.25mm]{report}



\usepackage{typearea}

when using BCOR as a global option.

When using a KOMA-Script class, the explicit loading of the typearea package can

be omitted:

\documentclass[BCOR=8.25mm]{scrreprt}

The option a4paper could be omitted with scrreprt, since this is a predefined setting

for all KOMA-Script classes.

If the option is only later set to a new value, one may then use, for example, the

following:

\documentclass{scrreprt}

\KOMAoptions{BCOR=8.25mm}

Thus, at the loading of the scrreprt class standard settings will be used. When

changing the setting with the use of the command \KOMAoptions or \KOMAoption

a new page layout with new margins will automatically be calculated.

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. The typearea package should neither be loaded explicitly

with \usepackage when using a KOMA-Script class, nor should the option be given as an

optional argument thereto. If the option is changed via \KOMAoptions or \KOMAoption after

loading the package, the textblock and margins are automatically recalculated anew.

DIV=Factor

With the aid of the option DIV=Factor

v3.00


the number of stripes into which the page is divided

horizontally and vertically during the page layout construction is set. The exact construction

method is found in

section 2.2

. Of importance is that the larger the Factor , the larger the

text block and the smaller the margins. Any integer value greater than 4 is valid for Factor .

Please note that large values can lead to unfulfillment of various minor conditions in the type

area, depending on further options chosen. Thus, in an extreme case, the header may fall

outside of the page. Users applying the option DIV=Factor are themselves responsible for

fulfillment of the marginal conditions and setting of a typographically aesthetic line length.

In

table 2.1



are found the type area sizes for several DIV factors for an A4 page without

binding correction. Here the minor conditions dependent on font size are not considered.



Yüklə 2,49 Mb.

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




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

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin