On 12-Feb-07 Joerg van den Hoff wrote:
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
I tried your example (your code not reproduced here) with
groff-1.18.1, without making any changes to it, and got
no earnings, and the following output:
heading1
SN register content: >>><<<
1. heading2
SN register content: >>>1.<<<
1.1. heading3
SN register content: >>>1.1.<<<
Table of Contents
heading1 ................................1
1. heading2 .............................1
1.1. heading3............................1
[spaces in the tab leader removed in the above]
That looks to me like what should have been produced.
Was your result different, and, if so, what is supposed to
be wrong with it?
Bestwishes,
Ted.