127
r
– right
i
– inner margin in two-sided layout
o
– outer margin in two-sided layout
Default setting is to the right of the content of the environment. This default
v3.00
my be changed us-
ing option
captions
(see
page 120
) with values like innerbeside, leftbeside, outerbeside,
and rightbeside. If either o or i are used you may need to run L
A
TEX twice to obtain the
correct placement.
Per default the content of the environment and the caption text title fill the entire available
text width. However, using the optional parameter width , it is possible to adjust the width
used. This width could even be larger than the current text width.
When supplying a width the used width is usually centered with respect to the text width.
Using the optional parameter offset , you can shift the environment relative to the left margin.
A positive value corresponds to a shift to the right, whereas a negative value corresponds to
a shift to the left. An offset of 0 pt gives you a left-aligned output.
Adding a star to the optional parameter offset makes the the value mean a shift relative
to the right margin on left hand pages in two-sided layout. A positive value corresponds to
a shift towards the outer margin, whereas a negative value corresponds to a shift towards
the inner margin. An offset of 0 pt means alignment with the inner margin. As mentioned
before, in some cases it takes two L
A
TEX runs for this to work correctly.
The default vertical alignment is bottom. This means that the bottommost base lines of the
contents of the environment and of the caption are aligned. This setting
v3.00
may be changed using
option
captions
(see
page 120
) with value topbeside, centeredbeside, or bottombeside.
With setting topbeside the topmost base lines of the environment contents and caption will
be aligned. With centeredbeside they will be centered vertically. In this context it should
be known, that the base line of a pictures is mostly at the bottom of the picture. This may
be changed, e. g., using \raisebox.
Example: An example for the usage of the captionbeside environment can be found in
figure 3.4
. This figure was typeset with:
\begin{figure}
\begin{captionbeside}[Example: Figure beside description]%
{A figure description which is neither above nor
below, but beside the figure}[i][\linewidth][%
[i][\linewidth][%
\dimexpr\marginparwidth+\marginparsep\relax]*
\fbox{%
\parbox[b][5\baselineskip][c]{.25\textwidth}
{%
\hspace*{\fill}\KOMAScript
\hspace*{\fill}\par
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
128
Figure 3.4.: A figure description which is neither above nor below, but
beside the figure
KOMA-Script
}%
}
\end{captionbeside}
\ label{fig:\LabelBase.captionbeside}
\end{figure}
The total width is thus the currently available width \linewidth. However, this
width is shifted \marginparwidth + \marginparsep to the outside. The caption
text or description is placed on the inner side beside the figure. The figure itself is
shifted 2 em into the outer margin.
With \dimexp a ε-TEX command has been used. This should not be a problem at
all, because KOMA-Script itself needs ε-TEX and every almost up-to-date L
A
TEX
distribution uses ε-TEXalready.
Figure 3.5
shows a centered caption with:
\KOMAoption{captions}{centeredbeside}
Even if you are not a typographer you may see, that this is not a recommended
suggestion.
In opposite to the centered example, the top aligned from
figure 3.6
may be used.
To show how to change the baseline using \raisebox, the complete example code
follows:
\documentclass[captions=topbeside]{scrbook}
\usepackage[english]{babel}
\usepackage{graphics}
\begin{document}
\chapter{An Example}
\begin{figure}
Figure 3.5.: A figure description which is neither above nor below, but
centered beside the figure
KOMA-Script
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
129
Figure 3.6.: A figure description which is neither above nor below, but
top beside the figure
KOMA-Script
\begin{captionbeside}%
[Example: Figure title top beside]%
{A figure description which is neither above nor
below, but top beside the figure}%
[i][\linewidth][%
\dimexpr\marginparwidth+\marginparsep\relax
]*
\raisebox{%
\ dimexpr\ baselineskip-\ totalheight\ relax
}{%
\includegraphics{examplepicture}%
}%
\end{captionbeside}
\label{fig:\LabelBase.captionbesidetop}
\end{figure}
\end{document}
You may use such a movement not only at graphics replacements like show, but
also using \includegraphics (see [
Car05
]).
\begin{captionofbeside}{ float type }[ entry ]{ title }[ placement ][ width ][ offset ]
. . . \end
{captionofbeside}
\begin{captionofbeside}{float type }[entry ]{title }[placement ][width ][offset ]*
. . . \end
{captionofbeside}
This
v3.10
environment corresponds to
captionbeside
in the same manner like \captionof corre-
sponds to
\caption
. The float type is not defined by a floating environment but by the first
mandatory argument.
komaabove
komabelow
If you use the float package the appearance of the float environments is solely defined by the
float
float
style. This includes whether captions above or below are used. In the float package there
is no predefined style which gives you the same output and offers the same setting options (see
below) as KOMA-Script. Therefore KOMA-Script defines the two additional styles komaabove
and komabelow. When using the float package these styles can be activated just like the styles
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
130
plain
, boxed or ruled defined in float. For details refer to [
Lin01
]. The style komaabove inserts
\caption
,
\captionabove
and
\captionbelow
above, whereas komabelow inserts them below
the float content.
\captionformat
In KOMA-Script there are different ways to change the formatting of the caption text. The
definition of different font styles was already explained above. This or the caption delimiter
between the label and the label text itself is specified in the macro \captionformat. In
contrast to all other \...format commands, in this case it does not contain the counter but
only the items which follow it. The original definition is:
\newcommand*{\captionformat}{:\ }
This too can be changed with \renewcommand.
Example: For some inexplicable reasons you want a dash with spaces before and after instead
of a colon followed by a space as label delimiter. You define:
\renewcommand*{\captionformat}{~--~}
This definition should be put in the preamble of your document.
\figureformat
\tableformat
It was already mentioned that
\captionformat
does not contain formatting for the label
itself. This situation should under no circumstances be changed using redefinitions of the
commands for the output of counters, \thefigure or \thetable. Such a redefinition would
have unwanted side effects on the output of \ref or the table of contents, list of figures and
list of tables. To deal with the situation, KOMA-Script offers two \...format commands
instead. These are predefined as follows:
\newcommand*{\figureformat}{\figurename~\thefigure\autodot}
\newcommand*{\tableformat}{\tablename~\thetable\autodot}
They also can be adapted to your personal preferences with \renewcommand.
Example: From time to time captions without any label and of course without delimiter are
desired. In KOMA-Script it takes only the following definitions to achieve this:
\renewcommand*{\figureformat}{}
\renewcommand*{\tableformat}{}
\renewcommand*{\captionformat}{}
It should be noted, however, that although no numbering is output, the internal
counters are nevertheless incremented. This becomes important especially if this
redefinition is applied only to selected figure or table environments.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
131
\setcapindent{indent }
\setcapindent*{xindent }
\setcaphanging
As mentioned previously, in the standard classes the captions are set in a non-hanging style,
that is, in multi-line captions the second and subsequent lines start directly beneath the label.
The standard classes provide no direct mechanism to change this behaviour. In KOMA-Script,
on the contrary, beginning at the second line all lines are indented by the width of the label
so that the caption text is aligned.
This behaviour, which corresponds to the usage of \setcaphanging, can easily be changed
by using the command \setcapindent or \setcapindent*. Here the parameter indent
determines the indentation of the second and subsequent lines. If you want a line break after
the label and before the caption text, then you can define the indentation xindent of the
caption text with the starred version of the command instead: \setcapindent*. Using a
negative value of indent instead, a line break is also inserted before the caption text and only
the first line of the caption text but not subsequent lines are indented by the absolute value
of indent .
Whether one-line captions are set as captions with more than one line or are treated sep-
arately is specified with the option
captions
. For details please refer to the explanations of
these option at
page 121
.
Example: For the examples please refer to figures
3.7
to
3.10
. As you can see the usage of a
fully hanging indentation is not advantageous when combined with narrow column
width. To illustrate, the source code for the second figure is given here with a
modified caption text:
\begin{figure}
\setcapindent{1em}
\fbox{\parbox{.95\linewidth}{\centering{\KOMAScript}}}
\caption{Example with slightly indented caption
starting at the second line}
\end{figure}
As can be seen the formatting can also be changed locally within the figure envi-
ronment. The change then affects only the current figure. Following figures once
again use the default settings or global settings set, for example, in the preamble
of the document. This also of course applies to tables.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
132
KOMA-Script
Figure 3.7.:
Equivalent to the standard
setting, similar to the usage of
\setcaphanging
KOMA-Script
Figure 3.8.:
With slightly hanging inden-
tation starting at the second line using
\setcapindent{1em}
KOMA-Script
Figure 3.9.:
With hanging indentation starting at the
second line and line break before the de-
scription using \setcapindent*{1em}
KOMA-Script
Figure 3.10.:
With indentation in the second line only
and line break before the description using
\setcapindent{-1em}
\setcapwidth[justification ]{width }
\setcapdynwidth[justification ]{width }
\setcapmargin[margin left ]{margin }
\setcapmargin*[margin inside ]{margin }
Using
v2.8q
these three commands you can specify the width and justification of the caption text.
In general the whole text width or column width is available for the caption.
With the command \setcapwidth you can decrease this width . The obligatory argument
determines the maximum width of the caption. As an optional argument you can supply
exactly one letter which specifies the horizontal justification. The possible justifications are
given in the following list.
l
– left-aligned
c
– centered
r
– right-aligned
i
– alignment at the inner margin in double-sided output
o
– alignment at the outer margin in double-sided output
The justification inside and outside corresponds to left-aligned and right-aligned, respectively,
in single-sided output. Within longtable tables the justification inside or outside does not work
correctly. In particular, the captions on subsequent pages of such tables are aligned according
to the format of the caption on the first page of the table. This is a conceptual problem in
the implementation of longtable.
Please
v3.20
note, \setcapwidth sets the width immediately to the value of parameter width like
\setlength
would do. If you instead want the value of width when the caption is set, you
can use \setcapdynwidth. There can be differences in the result, if you, e. g., use lengths like
\linewidth
or other commands as argument width .
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
133
With the command \setcapmargin you can specify a margin which is to be left free next
to the description in addition to the normal text margin. If you want margins with dif-
ferent widths at the left and right side you can specify these using the optional argument
margin left
. The starred version \setcapmargin* defines instead of a margin left a
margin inside
in a double-sided layout. In case of longtable tables you have to deal with the
same problem with justification inside or outside as mentioned with the macro \setcapwidth.
Furthermore, the usage of \setcapmargin or \setcapmargin* switches on the option
3.20
(see
page 121
) for the captions which are typeset with this margin setting.
You can also submit negative values for margin and margin left or margin inside . This
has the effect of the caption expanding into the margin.
Experts and advanced users may find a tricky usage of \setcapwidth in [
Koh14a
].
origlongtable
If the table captions produced by the longtable package (see [
Car04
]) should not be redefined
by the KOMA-Script classes, activate the origlongtable option. This option has to be used
at the optional argument of
\documentclass
. It may not be used as a setting of
\KOMAoptions
or
\KOMAoptions
.
listof=setting
Normally
v3.00
lists of floating environments — like list of tables or list of figures will neither get an
entry at the table of contents nor have a number at the heading. More information about that
may be found in
section 3.9
. Alternative to the view from the table of contents to the lists of
floating environments, you may reconsider a view from the lists of floating environments into
the table of contents. Because of this, there are not only the options
3.9
,
3.9
, and
3.9
described
in
section 3.9
,
page 69
, but also listof=notoc, listof=totoc, and listof=numbered with
the same meaning.
By default the headings of the lists of floating environments use the topmost level below
\part
. This is the chapter level at scrbook and scrreprt and the section level at scrartcl. With
v3.06
listof=leveldown
a one step lower level will be used instead.
Example: At a book you want to move the list of figures and the list of tables as sub-lists
into a common list named “Figures and Tables”. With
\KOMAoption{listof}{leveldown}
you first declare to use the section instead of the chapter level for both lists and
then you use:
\addchap*{Figures and Tables}
\listoffigures
\listoftables
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
134
for the new list, that contains the list of figures and the list of tables. More infor-
mation about the command
\addchap*
may be found in
section 3.16
at
page 100
.
Normally
v2.8q
the lists of floating environments use a constant with to place the caption number
of the entries. Additionally all entries will be indented a little bit. This corresponds to setting
listof=graduated
.
If the numbers of the figures or tables, become very wide — i. e., if you have a lot of tables or
figures — their may be not enough width predefined. There’s a setting listof=flat for the
lists of floating environment similar to
3.9
for the table of contents. Thereby the needed with
for printing the number will be determined at each L
A
TEX run. See option
3.9
,
section 3.9
,
page 70
for information about how it works. Please note again, that you need more than one
L
A
TEX runs until the lists of floating environments will become their final result.
Setting listof=entryprefix
v3.06
will automatically activate listof=flat too. Normally it
would not make sense to add the prefix “figure” to each entry of the list of figures and the
prefix “table” to each entry of the list of tables, because nothing else than figures would be and
should be expected at the list of figures and nothing else than tables would be and should be
expected at the list of tables. So this prefixes would not give any additional information and
for this would not be useful. Nevertheless, such prefixes may be added using option listof=
entryprefix
. With this all entries of the same list will get the same prefix. The prefix will
depend on the file extension of the helper file, that will be used for the corresponding list. For
the list of figures the file extension would be “lof” and therefor \listoflofentryname would
be used. For the list of tables, the file extension would be “lot” and \listoflotentryname
would be used.
Within classes scrbook and scrreprt KOMA-Script adds a vertical gap to the lists of floating
scrbook
,
scrreprt
environments whenever a new chapter starts. This behaviour, that is same at the standard
classes, structures the lists by chapters. At KOMA-Script it corresponds to setting
v3.00
listof=
chaptergapsmall
. In this case a gap of width 10 pt will be used. With option listof=
chaptergapline
a gap of the height of one standard text line will be used. The gap may be
switched of with listof=nochaptergap. Option listof=chapterentry is somehow special.
Instead of a gap it adds the table of contents entry for the chapter additionally to the lists of
floating environments. Please note, that this would also happen, if the chapter does not have
any floating environment. Additional influence of chapters to the lists of floating environments
is available with option
chapteratlists
. See
section 3.16
,
page 94
for more information about
that.
An overview about all settings to option listof may be found at
table 3.20
.
Chapter 3: The Main Classes: scrbook, scrreprt, and scrartcl
135
Table 3.20.: Available values for option listof to modify contents and formation of the lists of floating
environments
chapterentry
, withchapterentry
Marks chapter starts at the lists of floating environments by a copy of their entries
to the table of contents.
chaptergapline
, onelinechaptergap
Marks chapter starts at the lists of floating environments by a vertical gap of the
height of one standard text line.
chaptergapsmall
, smallchaptergap
Marks chapter starts at the lists of floating environments by a small vertical gap.
entryprefix
v3.06
Adds a prefix depending on the file extension of the list to each entry of the lists
of floating environments. The prefix additionally depends on the language, e. g., in
English “Figure” would be used for the entries to the list of figures and “Table” for
the entries to the list of tables. Both prefixes will be followed by a white space.
flat
, left
The lists of floating environments will be printed like a kind of table. The caption
numbers will be the first column, the caption texts the second column, and the page
numbers the last column. The width of the first column depends on the previous
L
A
TEX run.
graduated
, indent, indented
The lists of floating environments will be printed in hierarchical form. The width
for the caption numbers will be limited.
leveldown
The lists of floating environments will use a heading of one step lower sectioning
level than default.
nochaptergap
, ignorechapter
Chapter starts are not marked at the lists of floating environments.
notoc
, plainheading
The lists of floating environments, e. g., list of figures and list of tables do not generate
an entry at the table of contents.
. . .
|