lout-users
[Top][All Lists]

## Solution: text around illustrations

 From: Valeriy E. Ushakov Subject: Solution: text around illustrations Date: Fri, 20 Aug 1999 06:09:29 +0400

```On Fri, Aug 13, 1999 at 10:40:24AM +1000, Jeff Kingston wrote:

> Compared with that huge effort, it would be a minor thing to
> add a symbol to Lout which took its height from whatever was
> inside itself already (like, say, @VContract does now) but which
> refused to enlarge itself to accommodate material from incoming
> galleys.  It would in fact be a @High symbol which took its height
> not from a parameter but rather from the height of its initial
> contents - trivial really.

So trivial in fact, that it's already implemented: @VLimited! ;-)

So the draft solution to the flowing text follows:

import @BasicSetup
def @Flow
left picture
named @Place     { Left } # "Left" or "Right"
named inmargin   { 0.5v } # between text and picture
named outmargin  { 0f   } # between picture and the outside
named topmargin  { 0f   } # above picture
named footmargin { 0f   } # below picture
right text
{
def @ParPlace    { @Galley }
def @EndParPlace { @Galley }

def @LineList
{
//1vx @LineList
}

def @ParGalley horizontally into { @ParPlace&&preceding }
right x
{
x
}

def @EndPar force into { @EndParPlace&&following } { @Null }

def @InlinePicture
{
@HContract @VContract { //topmargin picture //footmargin }
}

@VLimited {
@Place @Case {
Left @Yield {
||outmargin @InlinePicture
||inmargin  @VExpand { //1rt @LineList }
}
Right @Yield {
@VExpand { //1rt @LineList } ||inmargin
@InlinePicture               ||outmargin
}
}
}
//     @ParGalley { text & @EndPar &1rt }
//0.5v @LineList
//     @EndParPlace
}

Example usage:

@PP
Text text text text text text text text text text text text text text.
Text text text text text text text text text text text text text text.

@LLP
{
@Figure
@Location { Raw }
@Caption { The problem }
@Diag {
A:: @Node { A } |1c B:: @Node B
//
@Arrow from { A } to { B }
}
}
@Flow topmargin { 0.3v } inmargin { 0.7v } {
Text text text text text text text text text text text text text text.
#... more text here ...
Text text text text text text text text text text text text text text.
}

@PP
Text text text text text text text text text text text text text text.

Some gaps are slightly wrong.  The interparagraph gap before the flow
is applied to the object whose mark is at the top, not to the hmark of
the first short line - hence the @LLP.  The interline gap between the
last short line and the first long line is in fact between the bottom
of the picture (plus footmargin), not the hmark of the last short line
- hence the empiric //0.5v before the @LineList.

You will most likely want to tweak the topmargin since Lout can't
guess that he can add a little strut at the top to accomodate one more
line.

Note the braces around the @Figure - this is because of precedenses.

You can't use any fancy features (even @PP) inside the right parameter
to @Flow.

Hmm, it should be possible to use ordinary (vertical) galleys instead.
Have to try it out later, not in 6 in the morning.

SY, Uwe
--