epub: images in content.opf
[librarian.git] / librarian / embeds / mathml.py
1 # -*- coding: utf-8 -*-
2 from lxml import etree
3 from librarian import get_resource
4 from . import TreeEmbed, create_embed, downgrades_to
5
6
7 class MathML(TreeEmbed):
8     @downgrades_to('application/x-latex')
9     def to_latex(self):
10         xslt = etree.parse(get_resource('res/embeds/mathml/mathml2latex.xslt'))
11         output = self.tree.xslt(xslt)
12         return create_embed('application/x-latex', data=unicode(output))