groff
[Top][All Lists]
Advanced

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

Re: [Groff] Hanging headings in MS


From: Larry Kollar
Subject: Re: [Groff] Hanging headings in MS
Date: Wed, 31 Mar 2010 12:06:44 -0400


On Mar 31, 2010, at 6:04 AM, Anton Shepelev wrote:

Hello all,

Is it possible to modify the MS macro package
(by adding some macro (re)defintions) so it
would make all headings stick out to the left
by the same abount of space?

1. Heading One

  text text
  text text

...

I can emulate such behaviour using .RS .. .RE but
I'd like to make it automatical.

This is more difficult than it should be IMO. In -ms, the indent is controlled by the number register \n[\n[.ev]:li] — so it can be handled per-environment. The global environment indent is \n[0:li] (zero, not O). But this does allow you to control indentation.

The heading macros (.NH, .SH) call SH-NO-TAG to set things up, so you can reset the indents there. This bit of code should give you the idea:

.\" ------------- set up indents --------------
.nr IN 5n
.am address@hidden
.if '\\n[.ev]'0' .nr \\n[.ev]:li (u;\\n[IN])
..
.nr 0:li \n[IN]
.am SH-NO-TAG
.in 0
..
.\" ------------- the document --------------
.NH 1
This Is a Test
.LP
This is a test, this is only a test.
.NH 2
Conditions
.LP
If this was an actual document,
there would have been something useful here.
.\" -------------- EOF --------------

        Larry



reply via email to

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