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
\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 34
) or the \recalctypearea
command (see
page 36
).
42
Chapter 2.
footlines=number
footheight=height
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 footlines. 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 footlines 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
.
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
43
Chapter 2.
\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 34
) or the \recalctypearea
command (see
page 36
).
\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
correction 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 auto-
matically, 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
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:
44
Chapter 2.
\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 24
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, the format can also be specified in the form height :width . Note that
until version 3.01a
v3.01b
height
and width has been interchanged. This is important if you use
compatibility settings (see option version,
section 2.5
,
page 29
).
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}
45
Chapter 2.
\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=A8,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 34
) or the \recalctypearea command (see
page 36
).
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.
46
Chapter 2.
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 han-
dle 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.
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.
47
Chapter 2.
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
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
few good non-proportional fonts available. Hardly a text typeset in this way looks really good.
In many cases font designers try to increase the serifs on the ‘i’ or ‘l’ to compensate for the
different character width. This cannot work and results in a fragmented and agitated-looking
text. If one uses L
A
TEX for one’s paper, some of these rules have to be either ignored or at
least interpreted generously. For example one may interpret “60 characters per line” not as a
fixed, but as an average or maximal value.
As executed, record regulations are usually intended to obtain a usable result even if the
author does not know what needs to be considered. Usable frequently means readable and
correctable. In the author’s opinion the type area of a text set with L
A
TEX and the typearea
package meets these criteria well right from the start. Thus if one is confronted with regulations
which deviate obviously substantially from it, then the author recommends submitting an
extract from the text to the responsible person and inquiring whether it is permitted to
submit the work despite deviations in the format. If necessary the type area can be moderately
adapted by modification of option DIV. The author advises against the use of \areaset for
48
Chapter 2.
this purpose however. In the worst case one may make use of the geometry package (see
[
Ume10
]), which is not part of KOMA-Script, or change the type area parameters of L
A
TEX.
One may find the values determined by typearea in the log file of one’s document. Thus
moderate adjustments should be possible. However, one should make absolutely sure that
the proportions of the text area correspond approximately to those of the page including
consideration of the binding correction.
If it should prove absolutely necessary to set the text with a line spacing of 1.5, then one
should not under any circumstances redefine \baselinestretch. Although this procedure
is recommended all too frequently, it has been obsolete since the introduction of L
A
TEX2ε in
1994. In the worst case one may use the instruction \linespread. The author recommends
the package setspace (see [
TF11
]), which is not part of KOMA-Script. Also one should let
typearea recalculate a new type area after the conversion of the line spacing. However, one
should switch back to the normal line spacing for the title, preferably also for the table contents
and various listings — as well as the bibliography and the index. The setspace package offers
for this a special environment and its own instructions.
The typearea package, even with option DIV=calc, calculates a very generous text area.
Many conservative typographers will state that the resulting line length is still excessive. The
calculated DIV value may be found in the log file for the respective document. Thus one can
select a smaller value easily after the first L
A
TEX run.
The question is not infrequently put to the author, why he spends an entire chapter dis-
cussing type area calculations, when it would be very much simpler to merely give the world a
package with which anyone can adjust the margins like in a word processor. Often it is added
that such a package would in any case be the better solution, since everyone can judge for them-
selves how good margins are to be chosen, and that the margins calculated by KOMA-Script
are anyway not that great. The author takes the liberty of translating a suitable quotation
from [
WF00
]. One may find the original German words in the German scrguide.
The practice of doing things oneself is long-since widespread, but the results are
often dubious because layman typographers do not see what is incorrect and can-
not know what is important. Thus one becomes accustomed to incorrect and poor
typography.
[. . . ] Now the objection could be made that typography is dependent
on taste. If it concerned decoration, perhaps one could let that argument slip by;
however, since typography is primarily concerned with information, errors cannot
only irritate, but may even cause damage.
49
Chapter 3.
The Main Classes: scrbook, scrreprt, and scrartcl
The main classes of the KOMA-Script bundle are designed as counterparts to the standard
L
A
TEX classes. This means that the KOMA-Script bundle contains replacements for the three
standard classes: book, report, and article. There is also a replacement for the standard
class letter. The document class for letters is described in a separate chapter, because it is
fundamentally different from the three main classes (see
chapter 4
).
The simplest way to use a KOMA-Script class instead of a standard one is to substitute
the class name in the \documentclass command according to
table 3.1
. For example, you
may replace \documentclass{book} by \documentclass{scrbook}. Normally, the document
should be processed without errors by L
A
TEX, just like before the substitution. The look,
however, should be different. Additionally, the KOMA-Script classes provide new possibilities
and options that are described in the following sections.
Allow me an observation before proceeding with the descriptions of the options. It is often
the case that at the beginning of a document one is often unsure which options to choose for
that specific document. Some options, for instance the choice of paper size, may be fixed from
the beginning. But already the question of the size of the text area and the margins could be
difficult to answer initially. On the other hand, the main business of an author — planning the
document structure, writing the text, preparing figures, tables, lists, index, and other data —
should be almost independent of those settings. As an author you should concentrate initially
on this work. When that is done, you can concentrate on the fine points of presentation.
Besides the choice of options, this means correcting hyphenation, optimizing page breaks, and
the placement of tables and figures.
Dostları ilə paylaş: |