groff
[Top][All Lists]
Advanced

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

Re: Fw: [Groff] Underlining in groff


From: Peter Schaffter
Subject: Re: Fw: [Groff] Underlining in groff
Date: Tue, 31 Aug 2010 16:12:50 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

On Tue, Aug 31, 2010, Werner Lemberg wrote:

> Peter, what image support has mom?

Postscript only, via PSPIC.  There's no special image handling in
mom.

> On an unrelated note, there's another thing I can't seem to figure
> out how to do, and that is to insert a full-page illustration in
> the middle of a lot of text.  (I'm using 'mom' and 'mwww', by the
> way.)  I know how to use the www module's .PIMG to put an image
> somewhere, but:
> 
> - The text won't flow around it (.MPIMG is unavailable to me,
> since I'm going to postscript).
> - I don't know where to put the image within the text, since
> basically I want a full-page-sized image to start on wherever a
> natural page break happens to land, not some specific point within
> the text.
> 
> For example, some way to say "display this image as soon as the
> next natural page break occurs, then continue the text after the
> image" would be exactly what I need.  But if that's not possible,
> maybe there is some other way to accomplish this, I don't know.

What's needed is a floating keep, similar to ms's KF/KE. mom
doesn't presently have a mechanism for keeps; it's on my TODO
list.  However, you can abuse the page header macros so they insert
a full page image at the next page break regardless of where the
image is inserted in the source file.  Example follows.  To keep
things simple, it assumes a document that doesn't otherwise have
page headers.

.de image
. image*2
..
.
.de insert-image \" Main macro; arg is the image file
.  ev image
.  vs 0
.  di image*1
.   PSPIC "\\$1"
.  di
.  nr image-depth \\n[dn]
.  nr centre-image (\\n[.p] - \\n[image-depth] / 2)
.  di image*2
.   sp |(\\n[centre-image]u - 1v)
.   image*1
\!. HEADERS off
\!. NEWPAGE
.  di
.  HEADER_RECTO LEFT "\\*[image]" \" arg LEFT is arbitrary
.  ev
..
.
.TITLE "Floating Full Page Image Test
.PRINTSTYLE TYPESET
.HEADER_RULE off
.HEADERS off
.START

With this in place at the top of the source file,

  .insert-image <file>

at any point in the text will do what you want.

The example should be taken as proof-of-concept, not real world,
given that I don't know what page formatting is used throughout the
document.

-- 
Peter Schaffter

Author of The Binbrook Caucus
http://www.schaffter.ca



reply via email to

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