'Return the section name at the given level for the specific
document class.
Level is 1,2,3..., as level 0 is the title.'

def section(self, level):

    sections = ['section', 'subsection', 'subsubsection', 'paragraph', 'subparagraph']
    if (self.document_class in ('book', 'report', 'scrreprt', 'scrbook')):
        sections.insert(0, 'chapter')
    if self._with_part:
        sections.insert(0, 'part')
    if (level <= len(sections)):
        return sections[(level - 1)]
    else:
        return sections[(-1)]
