[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Macro rename - what am I doing wrong?
From: |
Werner LEMBERG |
Subject: |
Re: [Groff] Macro rename - what am I doing wrong? |
Date: |
Sat, 25 Feb 2006 14:32:37 +0100 (CET) |
> I'm trying to make some macros that will build up the SEE ALSO list
> [...]
>
> The approach I took was to try and rename the .SH macro to something else
> and stick my code in there. That flopped, what am I doing wrong?
You have first to call .TH within the man page (.TH defines .SH), then
redefining .SH.
Below is a snippet which does what you want.
Werner
======================================================================
.TH foo
.
.rn SH ORIGINAL_SH
.
.de1 SH
. if d SEE_ALSO \{\
. nop \\*[SEE_ALSO]
. rm SEE_ALSO
. \}
. ORIGINAL_SH \\$@
..
.
.de SA
. if d SEE_ALSO \
. as SEE_ALSO , \"
. as SEE_ALSO \\$1
..
.
.
.SH SEE ALSO
.SA foo
.SA bar
.SA blech
.
.SH SOMETHING_ELSE
bar