[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie question: wrap text to width of Graphic

From: Mark Hadfield
Subject: Newbie question: wrap text to width of Graphic
Date: Mon, 9 Oct 2000 15:18:12 +1300

Hello all

I am writing a quick-and-dirty (well it was going to be quick when I
started, and it's dirty!) application to bundle a series of EPS graphs into
a PS document of one or more pages. I am using Lout as the formatter,
feeding it code generated by a Python script. I want to keep the Python
script simple; if necessary I will edit the Lout code to fine tune the
results. Lout (which I hadn't heard of a few days ago) seems to be very well
suited for this.

I am bundling each graphic with a caption in a @MyFig object, which is just
a 1-column, 2-row @Tbl. This is how @MyFig is defined

def @MyFig
  named @MyGraph { Missing figure! }
  named @MyCap { Missing caption! }
  @Tbl aformat { @Cell indent { ctr } A }
    { @Rowa A { @MyGraph } @Rowa A { @MyCap } }

And this is an example of how it is used.

  @MyGraph { @IncludeGraphic "sst.eps" }
  @MyCap { SST annual mean (NCEP optimum interpolation analysis) }

Currently the @MyFig objects are put in sequence with whitespace between
them, i.e. they are "words" in a single paragraph. (Lout chokes on this when
there are too many of them & they are too big, so I will probably change

The question: I want the text in the @MyCap object to wrap to the width of
the @MyGraph object. How can I do this? At the moment it doesn't wrap until
it reaches the page width. I know that I can force the text to wrap to a
specified width, e.g.:

  @Tbl aformat { @Cell indent { ctr } A }
    { @Rowa A { @MyGraph } @Rowa A { 5c @Wide @MyCap } }

but I don't know in advance what the width of the @MyGraph is. I have looked
through the User & Expert Guides and I don't see an idiom that says "set the
maximum width of A to the actual width of B". Do I have to look into the EPS
file to get its BoundingBox? Surely not!

Mark Hadfield
address@hidden  http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand

Hi! I'm a .signature virus! copy me into your .signature file to help me

reply via email to

[Prev in Thread] Current Thread [Next in Thread]