s/comment --- transform a list of nodenames followed by a ---/&/ s/comment --- chapter or a section name, into a Sed script ---/&/ s/comment --- which adds chapter, section numbers to menus. ---/&/ /^@node[ ]/ { N s/\n/!!=!!/ /^@node *Top[^a-z]/d s/^@node *\([^,][^,]*\),.*!!=!!@\([a-z][a-z]*\)[ ][ ]*\([0-9]\(\.*[0-9]\)*\).*/s|\\( \\)\1--|\\1\2 \3 \1--|/ s/chapter \([0-9][0-9.]*\)/\1./ s/section \([0-9][0-9.]*\)/\1/ }