[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Fancier placement of PSPICs?
From: |
Ted Harding |
Subject: |
Re: [Groff] Fancier placement of PSPICs? |
Date: |
Wed, 07 Mar 2012 18:09:18 -0000 (GMT) |
On 07-Mar-2012 Cedric Sodhi wrote:
> Are there way to generally place an image different from
> filling a whole page width?
>
> By generically I mean doing so by using PSPIC and without
> particular knowledge of the sourrounding text and the image's
> dimension.
>
> By differently I mean, for example, float the image in the
> text, put multiple images into the same line, etc.
>
> I'm trying to get multiple images into one line and also have
> text flow arround a floating image.
>
> Do I have to write my own version of PSPIC for something like that?
Regarding the first query, the general call for .PSPIC is:
.PSPIC [{-L|-R|-I <n>}] <filename> {<deswid> {<desht>} }
where:
[{-L|-R|-I <n>}]
is an optional placement (default is centred):
-L : left-justified
-R : right-justified
-I <n> : indented by a distance <n>
<filename> is the name of the EPS file
{<deswid> {desht} }
is an optional specification of desired width <deswid> and
(only if <deswid> is given) an optional height <desht>
So you can choose placement and size in the .PSPIC line.
Regarding your further queries, you could think of writing
your own .PSPIC macro, but in view of the generality of your
aims, it may be better to approach it with a tailored usage
of the post-processor request
\X'ps: import file llx lly urx ury width [ height ]'
which positions the bottom left-hand corner of the EPS figure
at the current point (so use \h'...' and \v'...' to re-position
it, maybe enclosing the whole in \Z'....' so that you know
where you are when it's all over). Here, llx lly urx ury are
of course the BoundingBox coordinates. They can be found by
examining the %%BoundingBox line of the EPS file, but you
can also elicit them within groff by
.psbb <filename>
This sets groff registers \n[llx], \n[lly], \n[urx], \n[ury]
from the %%BoundingBox line, and you can then do what you like.
"Floating" text round an embedded graphic is not particularly
straightforward. You could set traps, but in practice I prefer
toe "hand-craft" it. The basis for this is to use the .mk
request when the graphic is about to occur, then enter the
graphic (using \X'ps: import ... ' as above). Then use .rt
to go back to the line where you were when about to import
the graphic, then set any changes in page offset (.po) and/or
line-length (.ll) and/or indentation (.in) to allow for the
space which is occupied by the graphic, enter the text and,
when the text has reached the point where it the next line
will be output below the graphic, re-set to the oroginal
values using .po, .ll, .in; and then carry on as usual.
Hoping this helps (it's a potentially big topic!).
Ted.
then enter the text
-------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Date: 07-Mar-2012 Time: 18:09:15
This message was sent by XFMail
-------------------------------------------------