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: Keith Marshall
Subject: Re: [Groff] How to switch off line filling?
Date: Mon, 21 Jan 2008 20:23:51 +0000
User-agent: KMail/1.9.1

On Monday 21 January 2008 12:33, Dan H wrote:
> 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.

With respect, I beg to differ; ms has very capable support for lists, 
(bulleted, numbered or glossary), nested to *any* arbitrary level.  I 
know this to be the case, for I have been using ms almost exclusively 
for a number of years, and many of my documents include lists, often 
with two or three levels of nesting.

So, let's address your issues, one at a time:--

1) To make a list item...

As the manpage says, you use the .IP macro.  This macro is one of the 
paragraph break class, and each list item extends from its opening .IP 
until the next paragraph break macro is encountered; (if you want an 
item to appear to extend over more than one paragraph, you may 
introduce the subsequent paragraphs with .IP, *omitting* both the 
marker *and* the width arguments).

2) To end a list...

It follows from (1), that each list item ends at the next paragraph 
break, following the .IP which introduced it.  The list, as a whole, 
ends when the paragraph break following its final item is *any* of the 
paragraph break macros *other* than .IP, (typically .PP or .LP), or a 
section heading macro, (.SH or .NH), which also causes a paragraph 
break.

3) To include a nested list...

Use .RS ... .RE, or .QS ... .QE to bracket each inner list; (my own 
preference is .QS ... .QE, which indents both margins, by the amount 
specified by the QI number register, whereas .RS ... .RE indents only 
on the left, by the amount specified by the PI number register).  Both 
of these may be nested to any arbitrary level, with the indent being 
cumulative at each level, and in addition to the list indent set by the 
width argument to .IP; (indeed, I don't believe I've ever specified a 
width argument with .IP -- the default seems to suit me fine).

> However, there are a couple of things that I’d like to do to make
> things perfect: 
>
> 1.  Turn off pagination. Like I said, it’s mostly for email and
>     therefore doesn’t require separate pages. I don’t know how the
>     man formatter does it. 

I can answer that, (and you won't find it in an.tmac, or indeed any 
other macro package).

man invokes troff using a traditional pipeline, with the source for the 
manpage being inserted into the input stream using cat.  Immediately 
before the `cat manpage.n' command, it inserts an `echo ".pl 1100i"', 
so setting an arbitrarily long page of 1,100 inches, (closer to 28 
metres than the five Joerg suggested).  Thus, man pages *are* actually 
paginated, but the effective page length is so long that the first page 
is unlikely to be filled.  Finally, to avoid the runout of a huge 
length of blank page, after formatting the manpage, a second echo 
command is appended, following the `cat manpage.n', to reset the page 
length to slightly more than the actual length occupied by the manpage 
text, on the very long page: `echo ".pl \n(nlu+10"'.

For your needs, you could probably just include similar .pl requests at 
the beginning and end of your document template, respectively.

Regards,
Keith.




reply via email to

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