On Sat, Jan 09, 2016 at 04:06:36PM +0000, Gavin Smith wrote:
> On 9 January 2016 at 12:39, Sebastian Wiesner <[email protected]> wrote:
> > Hello,
> >
> > I would like to generate a "local" table of contents inside a node.
> > This table of contents should sit at the beginning of the node and
> > list all sections and subsections within this node.  As an example,
> > consider the following node:
> >
> > @node Foos and Bars
> > @appendix Foos and Bars
> >
> > @c TOC HERE
> >
> > @unnumberedsec foo
> > @anchor foo
> >
> > @unnumberedsec bar
> > @anchor bar
> >
> > When generating the manual, I'd like to have a table of contents
> > listing "foo" and "bar" at "TOC HERE".
> >
> The following appears to work:
> 
> @node Foos and Bars
> @appendix Foos and Bars
> 
> @menu
> * foo::
> * bar::
> @end menu
> 
> @anchor{foo}
> @unnumberedsec foo
> 
> @anchor{bar}
> @unnumberedsec bar
> 
> If you get errors about invalid menus you may need to give extra
> arguments to @node, but don't worry about it unless it happens.

Otherwise, maybe something that should work and not need fiddling with
@node would be using a @detailmenu (not tested).

@menu
@detailmenu
* foo::
* bar::
@end detailmenu
@end menu

The advantage of using an @itemize with @ref is that it will appear in
formats that do not take menu into account, such as TeX and DocBook.  It
is more syntaxic, however, which is not perfect.

-- 
Pat

Reply via email to