groff
[Top][All Lists]
Advanced

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

Re: [Groff] How to switch off line filling?


From: Joerg van den Hoff
Subject: Re: [Groff] How to switch off line filling?
Date: Mon, 21 Jan 2008 14:24:15 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

On Mon, Jan 21, 2008 at 01:33:19PM +0100, Dan H wrote:
> On Mon, 21 Jan 2008 12:35:05 +0100
> Joerg van den Hoff <address@hidden> wrote:
> 
> > On Mon, Jan 21, 2008 at 10:22:12AM +0100, Dan H wrote:
> > > I use groff
> > > with the mm package (because it is, as far as I know, the only
> > > one that offers nested lists).
> 
> > I'm sure, `ms' provides everything you'd need as well.
> 
> I like ms better in general, but this is all its manpage has to say
> about lists:
> 
> --------------------
> 
> Lists
>        The IP macro handles duties for all lists.  Its syntax is as
> follows:
> 
>        .IP [marker [width]]
> 
>               The marker is usually a bullet character \(bu for
> unordered lists, a number (or auto-incrementing  num??? ber register)
> for numbered lists, or a word or phrase for indented (glossary-style)
> lists.
> 
>               The  width specifies the indent for the body of each
> list item.  Once specified, the indent remains the same for all list
> items in the document until specified again.
> 
> --------------------
> 
> That's exactly all. Not even how to make a list item, how to end a
> list, or if ot is possible to nest them. For practical purposes lists
> are non-existent in ms.

what do you need? I'm rather content with, e.g.

.IP 1.
this is my first entry
.IP 2.
this is the second
.RS
.IP a)
which can include a sublist
.IP b)
with more text
.RE
.IP 3.
before this goes on.

otherwise I'd rather use `tbl' to "keep things together".

for convenience I have defined some
private ms-macros `BP', `NP', `RNP' as below:

.\"====================================CUT==============================================
.\"-----------------------------------------------------------------------------
.\"
.\"---
.de BP
.\"---
.\"a simple one
.   IP \(bu
..
.\"
.\"-----------------------------------------------------------------------------
.ig
   autonumbered indented paragraph.
   usage: like .IP (but marker generated automatically)
   set/reset variables with '.RNP'.
..
.\"
.\"
.\"---
.de NP
.\"---
.\"call: .NP some_text (more or less as second argument of IP call).
.\"'some_text' is appended to the autoincremented marker.
.\"
.\" absence of 'np_defa_init taken' as evidence that RNP has never been called:
.   if !d np_defa_format  .RNP
.\"
.   IP "\\*[np_delim_1]\\n+[np_air]\\*[np_delim_2]  \\$1" \\*[np_indent]
..
.\"-----------------------------------------------------------------------------
.\"
.\"-----------------------------------------------------------------------------
.\"
.\"----
.de RNP
.\"----
.\"call: .RNP  np_format  np_delim_2  np_delim_1 np_indent np_init
.\"set/reset variables for the 'NP' macro.
.\"arguments are  optitional (and default to 1 '.', '', \\n[PI], and 0, 
respectively)
.\"'np_format' is any of the number register formats known to groff (e.g. 'i' 
or 'I'
.\"for lower or upper case roman numerals). 'np_delim_2' and 'np_delim_1' 
.\"are trailing and leading delimiters for the autoincrement register.
.\"please note the order of appearance. 
.\"'np_indent is the indent for IP
.\"'np_init' is the initial value of the autoincrement register.
.\"
.\" defaults definition:
.   if !d np_defa_format  .ds np_defa_format    1
.   if !d np_defa_delim_2 .ds np_defa_delim_2   .
.   if !d np_defa_delim_1 .ds np_defa_delim_1
.   if !d np_defa_indent  .ds np_defa_indent    \\n[PI]u
.   if !r np_defa_init    .nr np_defa_init      0
.\"
.   ie '\\$1'' \{\
.      ds np_format \\*[np_defa_format]
\}
.   el \{\
.      ds np_format \\$1
\}
.   ie '\\$2'' \{\
.      ds np_delim_2 \\*[np_defa_delim_2]
\}
.   el \{\
.      ds np_delim_2 \\$2
\}
.   ie '\\$3'' \{\
.      ds np_delim_1 \\*[np_defa_delim_1]
\}
.   el \{\
.      ds np_delim_1 \\$3
\}
.   ie '\\$4'' \{\
.      ds np_indent \\*[np_defa_indent]
\}
.   el \{\
.      ds  np_indent \\$4
\}
.   ie '\\$5'' \{\
.      nr np_init \\n[np_defa_init]
\}
.   el \{\
.      nr  np_init \\$5
\}
.   nr np_air \\n[np_init] 1
.   af np_air \\*[np_format]
..
.\"====================================CUT==============================================

they are rather q&d but suit me fine. especially for simply auto-numbering
lists:

.NP 
some text
.NP
more text
.RNP
.NP
start new numbering
.NP
and so forth
.RNP I .) (
.NP
use different
.NP "maybe augment with more information here
numbering scheme

maybe you can modify these macros to your needs.

> 
> > .pl 500c
> > 
> > (assuming  a  5 meter long page is enough :-) ) and chop off
> > trailing empty lines in  the  end.
> 
> OK, I got so far as well, but there must be a proper way to get rid
> of pagination. I mean, man pages are not paginated, but I couldn't
> get my head around the man tmac code to find out how they turn it
> off.
> 
> > in `troff' with 
> > 
> > .po 0i
> 
> Yeah, found that by now. Thanks.
> 
> --D.
> 
> 




reply via email to

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