def __init__(self, element):
        if type(element) in (str, unicode):
            tree = ET.fromstring('<html_example>' + element + "</html_example>")
            self.el = tree
        else:
            self.el = element

        from ist.utils.texlist2 import TexList

        self.tex = TexList()
示例#2
0
    def format(items):
        tex = TexList()
        #Logger.instance().info('Processing items...')
        for item in items:
            # do no format certain objects
            #Logger.instance().info('processing: %s (%s)' % (item, item.href_id))
            if not item.include_in_format():
                #Logger.instance().info('  - skipped')
                continue

            #Logger.instance().info('  +++ formatting +++')
            fmt = LatexFormatter.get_formatter_for(item)
            if fmt is not None:
                fmt.format(item)
                tex.extend(fmt)

        return tex
    def format(items):
        tex = TexList()

        Logger.instance().info('Processing items...')
        for item in items:
            # do no format certain objects
            if not item.include_in_format():
                Logger.instance().info(' - item skipped: %s' % str(item))
                continue

            Logger.instance().info(' - formatting item: %s' % str(item))
            # l = LatexRecord()
            # l.format(item)
            # print l
            # exit()
            fmt = LatexFormatter.get_formatter_for(item)
            if fmt is not None:
                fmt.format(item)
                tex.extend(fmt)

        return tex
    def format(items):
        tex = texlist()

        Logger.instance().info('Processing items...')
        for item in items:
            # do no format certain objects
            if not item.include_in_format():
                Logger.instance().info(' - item skipped: %s' % str(item))
                continue

            Logger.instance().info(' - formatting item: %s' % str(item))
            a = TexList()
            a.macro_record_type(item)
            print a
            exit()
            fmt = LatexFormatter.get_formatter_for(item)
            if fmt is not None:
                tex.extend(fmt.format(item))
                tex.newline()
                tex.newline()

        return tex