groff
[Top][All Lists]
Advanced

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

Re: [Groff] pspic: Text around picture?


From: Werner LEMBERG
Subject: Re: [Groff] pspic: Text around picture?
Date: Sun, 02 Jan 2011 09:16:40 +0100 (CET)

>> In rfloat.tmac need to take environment attributes into account.
>> For example line length (this works for raw troff without a macro
>> package):
> 
> Thank you VERY much!! Unfortunately, the space between text and output
> is gone, now. May I ask again for aid?

This is a bug (or feature?) in -me: It internally redefines .ll to be
a macro, accepting only a single argument.  Below an updated version.


    Werner


======================================================================


.\" rfloat.tmac
.\"
.\"   Version 1.1 (2011-Jan-02)
.\"
.
.
.\" Adjust PSPIC to provide a correct width within a diversion.
.am PSPIC
.  vpt 0
\h'(\\n[ps-offset]u + \\n[ps-deswid]u)'
.  sp -1
.  vpt 1
..
.
.de end
..
.
.\" Prepare environment.
.ev rfloat-div-env
.  in 0
.  ti 0
.ev
.
.
.\" rfloat <image> <in-paragraph>
.\"
.\" Position an image to the right so that text is floating around the image.
.\" We assume that there is enough vertical space available for the image.
.\"
.\" If there is a second argument, start the image one line below.  This is
.\" necessary if `rfloat' is called in the middle of a paragraph.
.\"
.\" The horizontal separation between the image and the floating text is
.\" given in register `\n[rfloat-hori-sep]' (set initially to 1m), the
.\" vertical separation in register `\n[rfloat-vert-sep]' (set initially
.\" to 0v since we measure from the base of the current line).
.
.nr rfloat-hori-sep 1m
.nr rfloat-vert-sep 0v
.
.de rfloat
.  ie '\\$2'' \
.    nr rfloat-in-par 0
.  el \
.    nr rfloat-in-par 1
.
.  ev rfloat-env
.    di rfloat-div
.      PSPIC -L \\$1
.    di
.  ev
.
.  \" The vertical and horizontal dimensions of the image are now stored in
.  \" \n[dn] and \n[dl], respectively.  We disable vertical traps so that we
.  \" can safely return to the current position.
.  nr rfloat-width \\n[dl]
.  nr rfloat-start \\n[nl]
.  nr rfloat-end (\\n[nl] + \\n[dn] + \\n[rfloat-in-par]v)
.
.  vpt 0
.  mk
.  ev rfloat-div-env
.    evc 0
.    in (\\n[.l]u - \\n[rfloat-width]u)
.    sp +(\\n[rfloat-vert-sep]u + \\n[rfloat-in-par]v)
.    rfloat-div
.    sp +\\n[rfloat-vert-sep]u
.  ev
.  rt
.  vpt 1
.
.  \" Reduce right margin.  For -me, `.ll' is macro, accepting a single
.  \" argument only, thus we must compute the value in advance.
.  nr float-ll (\\n[rfloat-width] + \\n[rfloat-hori-sep])
.  ll -\\n[float-ll]u
.
.  \" Define macro to reset right margin and to remove trap.  Since the
.  \" effect of `.ll' is delayed until the current partial line is emitted,
.  \" we position the trap one line higher.
.  de rfloat-end-trap end
.    ll
.    wh (\\n[rfloat-end]u - 1v)
.  end
.
.  \" Set trap.
.  wh (\\n[rfloat-end]u - 1v) rfloat-end-trap
..



reply via email to

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