summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/details/details-finetuningfloats.tex
blob: 71e0772d19c6451c618e9e037539884234a4c5fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
% language=uk

% todo: \setlayeranchored[text-1]{HELLO WORLD}

\environment details-environment

\startcomponent details-finetuningfloats

\startchapter[title={Finetuning graphics}]

In this chapter we will discuss a few more tricks to control float placement.
This control is needed if you want to typeset documents in a semi desk top
publishing way.

When you combine technical graphics, you may wish to align the content optically.
This can be done with the \type {offset} command. We will demonstrate this with a
couple of \METAPOST\ graphics:

\startbuffer
\startreusableMPgraphic{alpha}
  fill fullsquare xyscaled(  2cm,  2cm) withcolor \MPcolor{red} ;
  fill unitsquare xyscaled(+.5cm,+.5cm) withcolor \MPcolor{gray} ;
\stopreusableMPgraphic

\startreusableMPgraphic{beta}
  fill fullsquare xyscaled(  2cm,  2cm) withcolor \MPcolor{red} ;
  fill unitsquare xyscaled(+.5cm,-.5cm) withcolor \MPcolor{gray} ;
\stopreusableMPgraphic

\startreusableMPgraphic{gamma}
  fill fullsquare xyscaled(  2cm,  2cm) withcolor \MPcolor{red} ;
  fill unitsquare xyscaled(-.5cm,-.5cm) withcolor \MPcolor{gray} ;
\stopreusableMPgraphic

\startuseMPgraphic{delta}
  fill fullsquare xyscaled(  2cm,  2cm) withcolor \MPcolor{red} ;
  fill unitsquare xyscaled(-.5cm,+.5cm) withcolor \MPcolor{gray} ;
\stopuseMPgraphic
\stopbuffer

\typebuffer \getbuffer

\startbuffer
\startcombination[2*2]
  {\reuseMPgraphic{alpha}} {alpha}
  {\reuseMPgraphic {beta}}  {beta}
  {\reuseMPgraphic{gamma}} {gamma}
  {\reuseMPgraphic{delta}} {delta}
\stopcombination
\stopbuffer

\typebuffer

In \in {figure} [fig:offset-1] we place these graphics in a \type {2*2} grid. As
you can see, the centers don't align well.

\placefigure[here][fig:offset-1]{}{\getbuffer}

In \in {figure} [fig:offset-2] the centers of the graphic align well. This is
accomplished by adding some space around the graphics.

\startbuffer
\startcombination[2*2]
  {\ruledhbox{\offset[rightoffset=1cm]  {\reuseMPgraphic{alpha}}}} {alpha}
  {\ruledhbox{\offset[bottomoffset=.5cm]{\reuseMPgraphic {beta}}}}  {beta}
  {\ruledhbox{\offset[bottomoffset=.5cm]{\reuseMPgraphic{gamma}}}} {gamma}
  {\ruledhbox{\offset[leftoffset=1cm]   {\reuseMPgraphic{delta}}}} {delta}
\stopcombination
\stopbuffer

\placefigure[here][fig:offset-2]{}{\getbuffer}

\starttyping
\startcombination[2*2]
  {\offset[rightoffset=1cm]  {\reuseMPgraphic{alpha}}} {alpha}
  {\offset[bottomoffset=.5cm]{\reuseMPgraphic {beta}}}  {beta}
  {\offset[bottomoffset=.5cm]{\reuseMPgraphic{gamma}}} {gamma}
  {\offset[leftoffset=1cm]   {\reuseMPgraphic{delta}}} {delta}
\stopcombination
\stoptyping

If we align the centers vertically, as demonstrated in \in {figure}
[fig:offset-2] we can stick to a few bottom offsets.

\starttyping
\startcombination[4*1]
                             {\reuseMPgraphic{alpha}}  {alpha}
  {\offset[bottomoffset=.5cm]{\reuseMPgraphic {beta}}}  {beta}
  {\offset[bottomoffset=.5cm]{\reuseMPgraphic{gamma}}} {gamma}
                             {\reuseMPgraphic{delta}}  {delta}
\stopcombination
\stoptyping

\startbuffer
\startcombination[4*1]
  {\ruledhbox                           {\reuseMPgraphic{alpha}}}  {alpha}
  {\ruledhbox{\offset[bottomoffset=.5cm]{\reuseMPgraphic {beta}}}}  {beta}
  {\ruledhbox{\offset[bottomoffset=.5cm]{\reuseMPgraphic{gamma}}}} {gamma}
  {\ruledhbox                           {\reuseMPgraphic{delta}}}  {delta}
\stopcombination
\stopbuffer

\placefigure[here][fig:offset-3]{}{\getbuffer}

These examples demonstrate that the dimensions change with the offset. You can
retain the dimensions but still align them by using the \type {x} and \type {y}
parameter. This kind of manipulations will often result in a ugly spacing because
the placement macros handle on the original dimensions. \in {Figure}
[fig:offset-4] demonstrates this.

\starttyping
\startcombination[4*1]
                   {\reuseMPgraphic{alpha}}  {alpha}
  {\offset[y=-.5cm]{\reuseMPgraphic {beta}}}  {beta}
  {\offset[y=-.5cm]{\reuseMPgraphic{gamma}}} {gamma}
                   {\reuseMPgraphic{delta}}  {delta}
\stopcombination
\stoptyping

\startbuffer
\startcombination[4*1]
  {\ruledhbox                 {\reuseMPgraphic{alpha}}}  {alpha}
  {\ruledhbox{\offset[y=-.5cm]{\reuseMPgraphic {beta}}}}  {beta}
  {\ruledhbox{\offset[y=-.5cm]{\reuseMPgraphic{gamma}}}} {gamma}
  {\ruledhbox                 {\reuseMPgraphic{delta}}}  {delta}
\stopcombination
\stopbuffer

\placefigure[here][fig:offset-4]{}{\getbuffer}

In the previous chapter we demonstrated how a side float can be moved up or down
by providing a placement directive or by preceding the placement with \type
{\movesidefloat}. Such a move can be used to align a graphic with particular line
of text. This command can also be used for alignment purposes similar to the
\type {\offset} command. We will demonstrate this with the following graphics.

\startbuffer
\startreusableMPgraphic{gnu}
  fill fullsquare xyscaled( 4cm, 1cm) withcolor \MPcolor{red} ;
  fill unitsquare xyscaled(-1cm,.5cm)
                   shifted (0,-.25cm) withcolor \MPcolor{gray} ;
\stopreusableMPgraphic

\startreusableMPgraphic{gnat}
  fill fullsquare xyscaled( 4cm, 1cm) withcolor \MPcolor{red} ;
  fill unitsquare xyscaled(+1cm,.5cm)
                   shifted (0,-.25cm) withcolor \MPcolor{gray} ;
\stopreusableMPgraphic
\stopbuffer

\typebuffer \getbuffer

In the next two examples we shift the \type {gnu} and \type {gnat} graphics
horizontally in order to get them aligned. The move does not change the
dimensions of the float, but they do influence the paragraph shape.

\startbuffer[a]
\movesidefloat [x=.5cm]
\placefigure   [left,none] {} {\reuseMPgraphic{gnu}}
\stopbuffer

\startbuffer[b]
\movesidefloat [x=-.5cm]
\placefigure   [left,none] {} {\reuseMPgraphic{gnat}}
\stopbuffer

\typebuffer[a,b]

\getbuffer[a] \fakewords{50}{100}
\getbuffer[b] \fakewords{50}{100}

\blank

It is possible to shift vertically by setting \type {y}, but this is often a bad
idea and definitely may spoil alignment of graphics to the grid. If you have to
revert to this trick, you are probably working in document screw||up mode. This
is why in grid mode, we automatically round to an equal number of lines.

If you know what text you're dealing with and also can be sure about the height
of a graphic, you can trick \CONTEXT\ to ignore the dimensions of a graphic. Here
we use the graphic:

\startbuffer
\startreusableMPgraphic{gnome}
  fill fullsquare xyscaled(2cm, 1cm) withcolor \MPcolor{red} ;
  fill fullsquare xyscaled(1cm,.5cm) withcolor \MPcolor{gray} ;
\stopreusableMPgraphic
\stopbuffer

\typebuffer \getbuffer

\startbuffer
\placefigure[leftmargin,none,reset]{}{\reuseMPgraphic{gnome}}
\stopbuffer

\typebuffer \getbuffer

The graphic is moved into the margin (\type {leftmargin}), has no caption (\type
{none}), and all kind of tricky housekeeping is reset (\type {reset}).

\startbuffer
\placefigure[left,none,high,low]{}{\reuseMPgraphic{gnome}}
\stopbuffer

\getbuffer

Now the next graphic is not influenced by the previous one, so we can place them
close to each other. Use these tricks with care, especially if your document
source is reused and the typeset products are not carefully checked.

\typebuffer

When \CONTEXT\ tries to determine if a float fits, it makes a couple of
assumptions, for instance that the available room equals the text height minus
the height of the text so far. You can slightly influence the way these values
are interpreted by setting the calculation method. You can set the methods as
follows:

\starttyping
\setupfloats[textmethod=0,sidemethod=1]
\stoptyping

Method~0 just looks at the raw dimensions, while method~1 lessens the maximum
text height by one percent, thereby playing safe. Method~2 takes a window of
1~point. This may lead to better decisions since we may run into rounding errors
of several scaled points (which is small but troublesome). Method~2 is well
suited when typesetting on a grid, because there everything has to fit in a
rounded number of lines, which leaves no room for rounding errors.

\starttabulate[||c|c|]
\NC \bf grid mode     \NC \bf yes  \NC \bf no   \NC \NR
\NC \type{sidemethod} \NC \type{2} \NC \type{1} \NC \NR
\NC \type{textmethod} \NC \type{2} \NC \type{0} \NC \NR
\stoptabulate

\startusableMPgraphic{demo-1}{color}
  path p ;
  p := fullsquare xyscaled (3cm,2LineHeight) ;
  fill p withcolor \MPvar{color} ;
\stopusableMPgraphic

\startusableMPgraphic{demo-2}{color,morecolor}
  path p ; p := fullsquare xyscaled (6cm,4LineHeight) ;
  path q ; q := fullsquare xyscaled (3cm,2LineHeight) ;
  fill p withcolor \MPvar{color} ;
  setbounds currentpicture to q ;
  fill q withcolor \MPcolor{morecolor} ;
\stopusableMPgraphic

As you may know by now, we can use the directives \type {high}, \type {low},
\type {height}, \type {depth} and \type {line} to influence the spacing around a
side float. A real tight spacing can be achieved with \type {fit}.

\starttyping
\placefigure[left,fit,none]{}{some graphic}
\stoptyping

\placefigure[left,fit,none]{}{\useMPgraphic{demo-1}{color=red}}

This kind of placements only make sense in special situations, because normally
you don't want the graphic to touch the text.

If you think that this is all a user may want, you're wrong. It is not imaginary
that graphics have small pieces sticking out and|/|or lots of white space as part
of their design. In that case, the bounding box can be set to a smaller size.

\placefigure
  [left,fit,none]
  {}
  {\setlayer
      [graphics]
      {\useMPgraphic{demo-2}{color=red,morecolor=tgreen}}}

Now, when handling a side float, \CONTEXT\ first places the float, and then
starts with typesetting the paragraph, cleverly avoiding the graphic. However,
when the graphic is virtually larger than its known size, it may cover part of
the preceding paragraph.

How come that the graphic starting this paragraph does not do that? It is because
we explicitly moved it to the background. This involves some preparation. At the
document level, we define a layer called \type {graphic}.

\starttyping
\definelayer[graphics][position=yes]
\stoptyping

The position directive tells \CONTEXT\ that it should honour the position of the
graphic. Next we must make sure that this layer is placed.

\starttyping
\setupbackgounds[page][background=graphics]
\stoptyping

Now we're ready to move graphics to this layer:

\starttyping
\placefigure
  [left,fit,none]
  {}{\setlayer[graphics]{graphic}}
\stoptyping

It's now a small step to more advanced movements. Say that you want to move the
graphic a little bit to the left. In that case you can tell the layer placement
to do so.

\starttyping
\placefigure
  [left,fit,none]{}{\setlayer[graphics][hoffset=-12pt]{graphic}}
\stoptyping

From this you can deduce that there is also a movement in the vertical direction
using \type {voffset}. In addition you can anchor the graphic using the \type
{location} parameter and provide offsets.

\placefigure
  [left,fit,none]
  {}
  {\setlayer
     [graphics][hoffset=-12pt]
     {\useMPgraphic{demo-2}{color=red,morecolor=tgreen}}}

As soon as you run into situations where float placement is to be consistently
enforced, you will feel the need for dedicate placement macros. For example:

\startbuffer
\definefloat
  [somefloat]
  [figure]

\setupfloat
  [somefloat]
  [sidespaceafter=,
   sidespacebefore=,
   default={left,none}]
\stopbuffer

\typebuffer \getbuffer

Instead of resetting the side spacing, we could have default to \type {high,low},
but this way we can overload the default placement and still get zero spacing.

Throughout this manual we discuss features related to overlays and layers. These
permit you to move content around in ways that either or not depend on the text
flow. We have now come to another trick based on these mechanisms: bleeding.

When printing a document, you need to take into account that when graphics go
beyond the page boundary, you need to compensate for inaccuracies in cutting the
pages. Such graphics are called bleeding graphics and the amount of bleed is
often a few millimeters.

The best way to handle such graphics is to use the correct dimensions and play
with the edge widths and distances in combination with backspace and cut space. In
a properly set up layout and by using a well designed set of predefined graphic
placements, you can handle this quite well. A bleeding figure can be defined as
follows:

\startbuffer
\definefloat
  [edgefigure]
  [figure]

\setupfloat
  [edgefigure]
  [default={inner,height,high,low,none},
   maxwidth=4cm]

\defineexternalfigure
  [edgefigure]
  [width=\dimexpr\backspace+4cm-1mm\relax,
   lines=4]
\stopbuffer

\typebuffer \getbuffer

The default placement is pre|-|configured to have no additional vertical space and
align on the height of a line (this is default behaviour so the \type {height}
key is redundant here. The 1mm in the previous definition simulates what happens
when a page is cut off slightly wrong: we get an annoying gap.

\startbuffer[a]
\placeedgefigure
  {}
  {\externalfigure[hacker][edgefigure]}
\stopbuffer

\typebuffer[a] \getbuffer[a] \fakewords{50}{100}

One of the nice things about \TEX\ is that you can fine tune dimensions pretty
well. So, instead of the previous placement, which turns out rather ugly, we can
come up with a better one:

\startbuffer
\setupfloat
  [edgefigure]
  [default={inner,height,high,low,none},
   maxwidth=4cm,
   margin=\strutdepth]

\defineexternalfigure
  [edgefigure]
  [width=\dimexpr\backspace+4cm+2mm\relax,
   height=\dimexpr3\lineheight+\strutheight\relax]
\stopbuffer

\typebuffer \getbuffer

This time we take no risk and add 2mm to the dimensions so that we can be sure
that the edge of the graphic falls outside the page boundary.

\getbuffer[a] \fakewords{50}{100}

The \CONTEXT\ resourse library modules provide means to report back the
dimensions of graphics used in a document, so that you can develop (tune) them
with the proper dimensions. In practice a slightly wider than normal graphic
(scaling it horizontally a few millimeters more) does not harm the visual
appearance that much, so adapting a graphic to this kind of bleeding is not
really needed.

In addition to this (rather natural) way of adding bleed to a graphic, you can
apply the \type {\bleed} macro. In the previously discussed method the figure
placement mechanisms work with the real dimensions. The \type {bleed} macro is
using scaling in a different way: from the perspective of \CONTEXT\ the graphic
remains its original dimensions and the figure placement mechanisms will act
accordingly. We will give a couple of examples of using this macro.

Permitted bleeding locations are \type {l}, \type {r}, \type {t}, \type {b},
\type {lr}, \type {bl}, \type {br}, \type {tl} and \type {tr}.

\startbuffer
\placesomefloat
  [left,none,fit]
  {}
  {\setupbleeding[offset=5mm]%
   \bleed[width=5cm,height=1cm,location=l]
     {\externalfigure[mill][bleed]}}
\stopbuffer

\typebuffer \getbuffer \fakewords{50}{100}

\startbuffer
\placesomefloat
  [left,none,fit]
  {}
  {\setupbleeding[offset=2mm]%
   \bleed[width=5cm,height=1cm,location=l]
     {\externalfigure[mill][bleed]}}
\stopbuffer

\typebuffer \getbuffer \fakewords{50}{100}

The amount of bleeding depends on the postprocessing. In the previous paragraph
we used a bleed offset of 5mm, and here we used 2mm. Because the graphic is
scaled in order to match the bleed, it will be slightly distorted. With small
values this will go unnoticed. You can set the offset with:

\starttyping
\setupbleeding[offset=5mm]
\stoptyping

Bleeding itself is accomplished by the \type {\bleed} macro as in:

\starttyping
\bleed
  [width=5cm,height=1cm,location=l]
  {\externalfigure[mill][width=\bleedwidth,height=\bleedheight]}
\stoptyping

It is kind of awkward to pass those two dimensions so here is a shorter way of
doing the same:

\starttyping
\bleed
  [width=5cm,height=1cm,location=l]
  {\externalfigure[mill][bleed]}
\stoptyping

In fact, this uses the following definition:

\starttyping
\defineexternalfigure[bleed][width=\bleedwidth,height=\bleedheight]
\stoptyping

You can influence the scaling of a graphic by setting the \type {stretch}
parameters. The location parameter determines the direction of the stretch: \type
{l}~(left), \type {r}~(right), \type {t}~(top), \type {b}~(bottom) or a
combination of these. We will now combine the previous example code with this
knowledge.

\startbuffer
\placefigure
  [left]
  {}
  {\bleed
     [stretch=no,voffset=0pt,hoffset=1cm]
     {\externalfigure[detcow][bleed]}}
\stopbuffer

\typebuffer \getbuffer \fakewords {100} {150}

\startbuffer
\placefigure
  [left]
  {}
  {\bleed
     [width=5cm,height=3cm,location=l]
     {\externalfigure[detcow][bleed]}}
\stopbuffer

\typebuffer \getbuffer \fakewords {100} {150}

\startbuffer
\placefigure
  [right]
  {}
  {\bleed
     [width=5cm,height=3cm,location=r]
     {\externalfigure[detcow][bleed]}}
\stopbuffer

\typebuffer \getbuffer \fakewords {100} {150}

You can combine this feature with layers. We will now show a few applications
which may look like magic at first glance, but will become natural to your
repertoire once you have played with them.

The next example moves the graphic to a layer associated with the (current) page.

\startbuffer
\placefigure
  [right,none]
  {}
  {\setlayer
     [graphics]
     {\bleed
        [width=5cm,height=3cm,location=rb]
        {\externalfigure[detcow][bleed]}}}
\stopbuffer

\typebuffer \getbuffer \fakewords {100} {150}

You can also predefine locations where graphics (or other content) needs to be
anchored. A direct call to anchor looks as follows:

\starttyping
\placefigure
  [left,none]
  {}
  {\anchor
     [text-1]
     [location=lt,hoffset=max,voffset=max]
     [width=3cm,height=3cm,frame=on]%
     {\externalfigure[detcow][width=5cm,frame=on]}}
\stoptyping

This will anchor a graphic in one of the text layers, but at the cost of
specifying this in the document source. One way around this is to predefine
anchors.

\startbuffer
\defineanchor[rightbottom][text-1][location=lt,hoffset=max,voffset=max]
\defineanchor[righttop]   [text-1][location=lb,hoffset=max]
\defineanchor[leftbottom] [text-1][location=rt,voffset=max]
\defineanchor[lefttop]    [text-1][location=rb]
\stopbuffer

\startbuffer
\defineanchor[rightbottom][text-1][preset=rightbottom]
\defineanchor[righttop]   [text-1][preset=righttop]
\defineanchor[leftbottom] [text-1][preset=leftbottom]
\defineanchor[lefttop]    [text-1][preset=lefttop]
\stopbuffer

\typebuffer \getbuffer

We will apply this to a predefined float type.

\startbuffer
\definefloat[myfigure][figure]
\setupfloat[myfigure][sidespaceafter=,sidespacebefore=]
\stopbuffer

\typebuffer \getbuffer

Our previous example can now be reduced to:

\startbuffer
\placemyfigure
  [left,none]
  {}
  {\anchor[rightbottom]
     {\externalfigure[detcow][width=5cm,frame=on]}}
\stopbuffer

\typebuffer \getbuffer \fakewords {100} {150}

You can still specify dimensions and anchors can be combined with bleeding. Of
course this kind of mixed usage means that you need to have some feeling for what
these mechanisms do.

\startbuffer
\placemyfigure
  [left,none]
  {}
  {\anchor
     [rightbottom]
     [width=5cm,height=3cm,frame=on]
     {\bleed
        [width=5cm,height=3cm,location=l]
        {\externalfigure[detcow][bleed]}}}
\stopbuffer

\typebuffer \getbuffer \fakewords {100} {150}

\startbuffer
\placemyfigure
  [right,none]
  {}
  {\anchor
     [rightbottom]
     [width=5cm,height=3cm,frame=on]
     {\bleed
        [width=5cm,height=3cm,location=r]
        {\externalfigure[detcow][bleed]}}}
\stopbuffer

\typebuffer \getbuffer \fakewords {100} {150}

\startbuffer
\placemyfigure
  [left,none]
  {}
  {\anchor
     [lefttop]
     [width=3cm,height=3cm,frame=on]
     {\externalfigure[detcow][width=5cm,frame=on]}}
\stopbuffer

\typebuffer \getbuffer \fakewords {100} {150}

\startbuffer
\placemyfigure
  [left,none]
  {}
  {\anchor
     [lefttop]
     [width=3cm,height=3cm,frame=on]
     [offset=.5cm]
     {\externalfigure[detcow][width=5cm,frame=on]}}
\stopbuffer

\typebuffer \getbuffer \fakewords {100} {150}

\blank {\em Todo: parameter specifications of all those macros.}

\stopchapter

\stopcomponent