On Fri, Jul 31, 2009, Blake McBride wrote: > I'd like to label nested lists with the enclosing list's number using MM > like the following: > > 1. First item > 1.1. First sub-item of the first list > 1.2. Second sub-item of the first list > 2. Second item > 2.1. First sub-item of the second list > 2.2. Second sub-item of the second list > > What I attempted to do was specify a label while accessing the internal > counter information. By accessing those registers I could create any label > I wanted and still retain the auto-numbering. > > Is this easy to do in MOM?
Mom doesn't do this natively, but defining a macro like the following before invoking LIST does the trick. .eo .de SUBLIST . rr sublist-digit . nr headlist-digit \n[#ENUMERATOR\n[#DEPTH]] . nr sublist-digit -1 1 . ds item-number \n[headlist-digit].\En+[sublist-digit].\" . LIST USER \*[item-number] .. .ec To reproduce your example, here's the usage: .LIST DIGIT .ITEM First item .SUBLIST .ITEM First sub-item of the first list .ITEM Second sub-item of the first list .LIST back .ITEM Second item .SUBLIST .ITEM First sub-item of the second list .ITEM Second sub-item of the second list .QUIT_LISTS Don't know if that's what you consider easy, but it's a solution. :) Things would get a bit more complicated if you wanted deeper levels of nesting that followed the same scheme. -- Peter Schaffter