groff
[Top][All Lists]
Advanced

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

Re: [Groff] The bottom is always ok, the head never is


From: Miklos Somogyi
Subject: Re: [Groff] The bottom is always ok, the head never is
Date: Thu, 9 Mar 2006 11:38:03 +1100


On 26/02/2006, at 12:04 AM, Werner LEMBERG wrote:


I use me (the macro package, I mean) to produce these things and
more.

I can't comment on -me since I've never used it.


Then I'd like to try the MS package. Could you post the description of the header/footer macros please? Btw, the HT macro that Larry mentioned (HT, PT, BT) is not in /usr/share/groff/1.18.1/tmac/s.tmac

The program also draws text at .sp |19.7c, that is 10 cm from the
bot of page, and the text's top is really at 10 cm height.  A
smaller font at the same .sp |19.7c height plots something below the
10 cm mark.  How do I explain this?

This one I can explain.  From groff.info, after the explanation of the
.vs request (section `Changing Type Sizes'):

   The effective vertical line spacing consists of four components.
   Breaking a line causes the following actions (in the given order).

   * Move the current point vertically by the "extra pre-vertical line
     space".  This is the minimum value of all `\x' escapes with a
     negative argument in the current output line.

   * Move the current point vertically by the vertical line spacing as
     set with the `vs' request.

   * Output the current line.

   * Move the current point vertically by the "extra post-vertical
     line space".  This is the maximum value of all `\x' escapes with
     a positive argument in the line which has just been output.

   * Move the current point vertically by the "post-vertical line
     spacing" as set with the `pvs' request.

[This information is quite hidden in groff.texinfo, I know -- patches
 are welcome to move it to a separate (sub)subsection, with proper
 links from various places to this new node.]

BTW, this isn't new code; groff has always been working like this.

For your example it means that groff, after the `.sp |19.7c'
instruction, moves down the current amount of the vertical spacing as
set with .vs, *then* outputting the `HELLO' string.

You probably get a better understanding if you use this code fragment,
setting the vertical spacing to zero:

  .ps  51.54
  .sp |19.7c
  .vs 0
  HELLO
  .br
  .ps  25.75
  .sp |19.7c
                               \m[red]HELLO\m[]
  .br
  .vs


     Werner



Thanks, this explains it. I think I'll use these macros in lieu of .sp |xx:

.de y-down
.   sp |\\$1-\\n[.v]u
..
.de y-up
.   sp |\\n[.p]u-\\$1-\\n[.v]u
..

Based on the man pages I thought that .ps |xxx was setting the height excactly/absolutely at xxx from the top. Perhaps a sentence in "man" would be welcome to explain what really happens.

Miklos





reply via email to

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