groff
[Top][All Lists]
Advanced

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

[Groff] \*SN] question


From: Joerg van den Hoff
Subject: [Groff] \*SN] question
Date: Mon, 12 Feb 2007 15:23:35 +0100
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)

hi, second try (something went wrong the first time...):

I stumbled over the following:

I have some ms-macros to collect .NH section headings automatically in a table 
of content
(TOC) with the correct section number. a stripped down variant is attached. in 
order to
account for .SH sections as well I modifed this recently. the calling syntax is

.NHH n heading


where `n' is the level and `heading' the section header. if `n' is set to  0 a 
`.SH'
section should be inserted, otherwise a level-n `.NH' section. I now noted that 
inserting

.NHH 0 heading

calls in the document leads to omission of the \*[SN] information from the TOC 
despite
correct numbering in the  document. only if one uncomments the third line in 
the attached
example (i.e. `.rm SN') everything is ok.


question: can someone explain to me what actually is going on? somehow 
something seems to
go wrong with the `.als SN SN-DOT' or I unintentionally mask the correct 
definition of
\*[SN] or whatever. I don't get it why the `.NH' calls work, but \*[SN] no 
longer contains
the correct information if I insert the `.SH' option in the macro definition. 
why have I
explicitely `.rm SN' first??

any ideas would be appreciated :-)

joerg



.de NHH
.ie (\\$1 > 0) \{\
.\"rm SN   \"uncomment to `repair' TOC
.NH \\$1
\\$2\
\}
.el \{\
.SH
.\"ds SN this  would prevent the `SN undefined' warning
\\$2\
\}
.XS
.ie '\\*[SN]'' \\$2
.el \\*[SN] \\$2
.XE
..
.\"-------------------------------------------------------------------------------
.NHH 0 heading1
.LP
SN register content: >>>\*[SN]<<<
.\"-------------------------------------------------------------------------------
.NHH 1 heading2
.LP
SN register content: >>>\*[SN]<<<
.\"-------------------------------------------------------------------------------
.NHH 2 heading3
.LP
SN register content: >>>\*[SN]<<<
.\"-------------------------------------------------------------------------------
.PX


reply via email to

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