groff
[Top][All Lists]
Advanced

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

Re: Re: RE: [Groff] Newbie help for documenting code snippets


From: Jon Snader
Subject: Re: Re: RE: [Groff] Newbie help for documenting code snippets
Date: Thu, 13 Jan 2005 09:23:14 -0500
User-agent: Mutt/1.4.2.1i

On Thu, Jan 13, 2005 at 06:45:10AM -0000, mahesh wrote:
> Reg. loom, I didn't understand how to use it (even after reading the man 
> page).
> Now my understanding is, i should place comments like the foll. in the .C 
> file (say a.c)
>     /* include mark1 */
>     some code
>     ...
>     /* end mark1 */
> 
> and write this in the .t file
>     %include a.c mark1
> 
> and loom will pull a copy of mark1 section into the .t
> 

I'll send you a couple of marked up C files offline.

> 
> I seek a couple of clarifications,
> 1) .Ls sslecho.c 50
>    Do i have to key in the '50'. Can loom help ?
>    I mean if line 50 today were to become 51 tomorrow, then
>    we go out of sync.
> 

Normally I omit the second parameter (50 in this case).  The
second parameter is useful for a longer program where you want to
break it up into sections.  You could, of course, always start at
1, even for the subsequent sections of the same program.

> 2) Could you help me with the .CP macro also.
> 

Here's the relevant part of CP:

\" print line numbers, if provided
.       \" .Mn sets the LI strings, which we print with gtroff's Z
.ie \\n(.$>1 \{\
.   Mn \\$1 \\$2
\Z'\h'-\w'\\*(LI'u-0.06i'\\*(LI'\h'\\n(pIu'\c\}
.el .ti +\\n(pIu
.       \" next line of text is indented
..

The pI register contains the paragraph indent.

> One request.
> Can this package/technique be made available through kohala please.
> It is so very neat and useful.
> 

Well Rich died some time ago, and the site is kept alive, but not
updated by Gary Wright, so we probably can't do anything there.
I've talked to Larry Kollar about adding a chapter to the revised
UTP (when we get to it) on how I use groff to typeset books, so
eventually we'll get all this stuff documented.

jcs




reply via email to

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