def __init__(self, root, branches=(), descendants=(), source=None,<EOL>depth=None, hierarchy=()):
super().__init__()<EOL>assert source is not None, '<STR_LIT>'<EOL>self.source = source<EOL>self.root = root<EOL>self.hierarchy = hierarchy or self.findHierarchy()<EOL>self.depth = depth or self.parseTopDepth()-<NUM_LIT:1><EOL>self.branches = branches or self.parseBranches(descendants)<EOL>self.descendants = descendants or self.expandDescendants(self.branches)<EOL>
Construct TreeOfContents object using source

        :param TexNode source: parsed source
        :param list TreeOfContents branches: list of direct children
        :param list TexNode descendants: all descendants
        :param list str hierarchy: list of latex elements to determine
            hierarchy, which will otherwise be determined by latex syntax