[comp.text] Eroff, -me floating keeps & PostScript

ebm@ebm.almaden.ibm.com (Eli Messinger) (02/03/90)

I am trying to include a PostScript figure inside a floating keep, using
Elan's eroff as,

    Some introductory text about the Figure,
    .(z
    .hl
    .cS figure.ps 5i 3i
    Figure Title Text
    .hl
    .)z
    and some more text afterwards.

The problem is that the PostScript figure is placed at the point where it
is encountered in input (that is, it appears immediately following the word
"Figure,"), wihle everything else (the .hl horizontal lines and the "Figure
Title Text") are floated appropriately.

I've tried using the \! operator before the .cS command, but it still
interpolates the PostScript in the wrong place.

Any suggestions?

--
	      "It's a fine line between hypnotized and bored."

  CSNET: ebm@ibm.com / UUCP: ...!uunet!ibmarc!ebm / BITNET: ebm@almvma.bitnet

jaap+@andrew.cmu.edu (Jaap Akkerhuis) (02/06/90)

Excerpts from netnews.comp.text: 2-Feb-90 Eroff, -me floating keeps &..
Eli Messinger@ebm.almade (792)

> I am trying to include a PostScript figure inside a floating keep, using
> Elan's eroff as,

>     Some introductory text about the Figure,
>     .(z
>     .hl
>     .cS figure.ps 5i 3i
>     Figure Title Text
>     .hl
>     .)z
>     and some more text afterwards.

> The problem is that the PostScript figure is placed at the point where it
> is encountered in input (that is, it appears immediately following the word
> "Figure,"), wihle everything else (the .hl horizontal lines and the "Figure
> Title Text") are floated appropriately.

> I've tried using the \! operator before the .cS command, but it still
> interpolates the PostScript in the wrong place.

> Any suggestions?

Yup. I don't have eroff or its macros available, but the basic problem
is likely caused by the fact that one doesn't know when the .cS will be
evaluated. Try something on the lines of

.de mS
.ie '\\n(.z'' .cS \\$1 \\$2 \\$3
.el \\!.mS \\$1 \\$2 \\$3
..

and call .ms as in
.mS fig.ps 5i 3i

The macro will keep calling itself when being diverted, and will finally
call .cS when not.

	jaap

rauletta@gmuvax2.gmu.edu (R. J. Auletta) (02/07/90)

In article <sZnPX0W00VswAGplIN@andrew.cmu.edu> jaap+@andrew.cmu.edu (Jaap Akkerhuis) writes:
>Excerpts from netnews.comp.text: 2-Feb-90 Eroff, -me floating keeps &..
>Eli Messinger@ebm.almade (792)
>
>> I am trying to include a PostScript figure inside a floating keep, using
>> Elan's eroff as,
>
>>     Some introductory text about the Figure,
>>     .(z
>>     .hl
>>     .cS figure.ps 5i 3i
>>     Figure Title Text
>>     .hl
>>     .)z
>>     and some more text afterwards.

This may not be a solution but here is a little macro that uses
the eroff macros to center a EPS figure based on the bounding box
information at the top of the EPS.

.\" This macro centers an EPS file based on the bounding box information.
.\" Usage: .BB file Bounding_Box  Example: .BB test.eps 143 413 469 613
.\" Assumes the usage of Elan's macro package.
.\"
.de BB
.cS \\$1 \\$4p-\\$2p \\$5p-\\$3p ((\n(.l-(\\$4p-\\$2p)/2)-\\$2p)u \\$3p
..

--R J Auletta
  rauletta@gmuvax2.gmu.edu