parsetypes.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:latex-pandoc-preprocessor 作者: JBorrow 项目源码 文件源码
def convert_figure(self):
        r""" This uses pandoc to convert the explicit table text only. """

        pandoc_args = ["--mathjax"]

        try:
            converted_table = pypandoc.convert_text(
                self.table_text,
                to='markdown',
                format='latex',
                extra_args = pandoc_args)

        except AttributeError:
            # for pypandoc version before 1.2
            converted_table = pypandoc.convert(
                self.table_text,
                to='markdown',
                format='latex',
                extra_args=pandoc_args) 

        if self.label_text:
            this_label = self.label_text
        else:
            this_label = "tbl:" + self.uid

        converted_caption = ": {} {{#{}}}".format(self.caption_text.replace("\n", " "), this_label)

        self.output_content = "{}{}".format(converted_table, converted_caption)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号