groff
[Top][All Lists]
Advanced

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

Re: [Groff] Does groff match my needs?


From: Dorai Sitaram
Subject: Re: [Groff] Does groff match my needs?
Date: Thu, 12 Nov 2015 04:42:33 +0000 (UTC)

For those used to LaTeX, there is a pca-ix.tmac in my github.com/ds26gte/mpca 
that can be used for index generation in -ms documents, using the same 
'makeindex' program that LaTeX relies on, and which is available separately and 
freely for all *nix-y systems.
Usage:
.IX text to be indexed
It has the same syntax as LaTeX (without the enclosing braces). To wit,
@ is used to alter the alphabetization! to separate subentries
.INDX 
is used where the sorted index should be typeset. Any header (e.g., "Index") is 
up to you.
groff should be run a couple of times, the first time to create the index aux 
file and the second time to slurp its sorted version back in. groff does need 
to be run in -U (unsafe) option, so it can write out to the aux file and call 
makeindex on it.
All the user needs is know is how and where to use the .IX and .INDX macros -- 
the pca-ix.tmac file takes care of the rest.

--d 


     On Wednesday, November 11, 2015 11:02 PM, Damian McGuckin <address@hidden> 
wrote:
   
 

 On Wed, 11 Nov 2015, Peter Schaffter wrote:

> On Wed, Nov 11, 2015, address@hidden wrote:
>> Consider that groff itself is somehow like plainTeX.  You may
>> need a macro package for creating documents.  But traditional
>> macro packages do (AFAIK) not provide TOC, index, cross references
>> *compared to LaTeX*.  Up to now I did not test the MOM macros
>> (http://www.schaffter.ca/mom/mom-01.html) but likely they have
>> this functionality.
>
> Mom provides TOC, but not cross-referencing and indices, at least not
> for printed material.  PDF links (internal and external) are
> supported, though, so on-screen cross-references are available.

MM provides TC too.

There is a macro

     .IX [a [b [c [d]]]

which you can use to log things the error output file which can be used to 
help create an index. Assuming you gave it say 4 arguments arguments in a 
place in the document which ended up on Page 16 like

     .IX INDEX N name given
     .IX INDEX N never "do this"
     .IX INDEX N "number registers"
     .IX INDEX N number registers

It writes

     INDEX N name given ... 16

in the standard error output of groff.

It is up to you to then mess with that file to create an index in 
whatever layout takes your fancy. For the above you might do

       N (emboldened)

     name
       given, 16
     never
       do this, 16
     number
       registers, 17
     number registers, 17

Regards - Damian

Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer



 


reply via email to

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