groff
[Top][All Lists]
Advanced

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

Re: [Groff] Werner's Margin Notes


From: Tadziu Hoffmann
Subject: Re: [Groff] Werner's Margin Notes
Date: Wed, 19 Jan 2005 10:06:38 +0100
User-agent: Mutt/1.4i

> One is a request, similar to .sp | , that advances from the top edge
> of the page to the *baseline* on which type will sit.  groff's
> present behaviour is to treat, for example,
> 
>     .sp |1i
> 
> as meaning "advance 1 inch from the top edge of the page to the top
> of the tallest ascender of type at the current point size".  I'd
> like to see something that advances to the baseline, not to the top
> of the type.

The behavior implemented in groff is to ensure that when you
say ".sp |1i" then no part of the line that will (eventually)
be output will lie above this place.  (To fine tune this, you
can split the total line spacing into an "ascending part" (vs)
and a "descending part" (pvs).)  In terms of physical type, it
means put a 1-inch block of something at the top of the page
which the following line of type will be shoved up against.

On the other hand, if you just want to output normal text
without any extra line space (as used for over-large items
like equations and such) and want the *baseline* of the
following text to come to lie at 1 inch from the top of the
page, then simply say ".sp |1i-1v".  (Useful for drawing
lines at a specified vertical position. In this case, you
can also set the vertical spacing to zero instead.)


> The other thing I'd really like to see is a single request that
> behaves exactly like .br, except that it doesn't advance on the
> page.  IOW, a single request equivalent to
> 
>     .vs 0
>     .br
> 
> which would have the effect of "carriage return/no linefeed".
> Furthermore, such a request would never spring page traps.
> 
> If such a request existed (let's call it .cr),
> 
>     +-------------------------------------------------+
>     | a b c d e f g                                   |
>     | .cr                                             |
>     |  a b c d e f g  \" Note the space in column one |
>     +-------------------------------------------------+
> 
> would output
> 
>     aabbccddeeffgg 
> 
> (which should be taken as ascii-simulated overprinting).

How about this:


.\" ----------------------------------------------------------------
.de VT
.tl '\m[red]trap sprung!\m[]'''
..
.\" ----------------------------------------------------------------
.de CR
.di XX
.br
.di
.chop XX
\Z'\\*(XX'\c
..
.\" ----------------------------------------------------------------
.fp 1 CB Courier-Bold
.ft 1
.ps 10
.vs 12
.sp |5v+3v-1v
\m[green]\h'-2c'\D'l \n(.lu+2c 0'\h'|-2c'\v'-3p'trap\h'|-2c'\v'12p'position\m[]
.br
.wh 5v+3v VT
.sp |5v
.\" ----------------------------------------------------------------
The general syntax for writing groff documents is relatively easy,
but writing extensions to the roff language can be a bit harder.
1 2 3 4 5 6 7 8
.CR
\m[blue] a b c d e f g h\m[]
The general syntax for writing groff documents is relatively easy,
but writing extensions to the roff language can be a bit harder.
.\" ----------------------------------------------------------------







reply via email to

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