def generate_latex(html, **kwargs): """ Generate latex from html. Args: key, value pairs are passed in from main latex command. """ # Options used by html2latex conversion config = dict() for option in ['hrule', 'site', 'headings']: config[option] = kwargs.pop(option) # Build latex h2l = Translator(extensions=[BasicExtension(**config), MooseExtension(**config)]) tex = h2l.convert(html) return tex, h2l