def enumerate_section section
@next_section_index = (section.index = @next_section_index) + 1
if (sectname = section.sectname) == 'appendix'
section.number = @document.counter 'appendix-number', 'A'
if (caption = @document.attributes['appendix-caption'])
section.caption = %(#{caption} #{section.number}: )
else
section.caption = %(#{section.number}. )
end
elsif sectname == 'chapter'
section.number = @document.counter 'chapter-number', 1
else
@next_section_number = (section.number = @next_section_number) + 1
end if section.numbered
nil
end