'Append latex href and pdfbookmarks for titles.'

def bookmark(self, node):

    if node.parent['ids']:
        for id in node.parent['ids']:
            self.body.append(('\\hypertarget{%s}{}\n' % id))
        if (not self.use_latex_toc):
            l = self.section_level
            if (l > 0):
                l = (l - 1)
            text = self.encode(node.astext())
            for id in node.parent['ids']:
                self.body.append(('\\pdfbookmark[%d]{%s}{%s}\n' % (l, text, id)))
