Esempio n. 1
0
#!/usr/bin/env python

__version__ = '9.3'

import string, re
from DOM import Element, Text, Node, DocumentFragment, Document
from Tokenizer import Token, BeginGroup, EndGroup, Other
from plasTeX import Logging, encoding

log = Logging.getLogger()
status = Logging.getLogger('status')
deflog = Logging.getLogger('parse.definitions')

#
# Utility functions
#

def idgen():
    """ Generate a unique ID """
    i = 1
    while 1:
        yield 'a%.10d' % i
        i += 1
idgen = idgen()

def subclasses(o):
    """ Return all subclasses of the given class """
    output = [o]
    for item in o.__subclasses__():
        output.extend(subclasses(item))
    return output
Esempio n. 2
0
#!/usr/bin/env python

__version__ = '2.1'

from typing import Optional, Union
from plasTeX import Logging, encoding
from plasTeX.DOM import Element, Text, Node, DocumentFragment, Document
from plasTeX.Tokenizer import Token, BeginGroup, EndGroup, Other
import string
import re

log = Logging.getLogger()
status = Logging.getLogger('status')
deflog = Logging.getLogger('parse.definitions')

#
# Utility functions
#

def idgen():
    """ Generate a unique ID """
    i = 1
    while 1:
        yield 'a%.10d' % i
        i += 1
idgen = idgen()

def subclasses(o):
    """ Return all subclasses of the given class """
    output = [o]
    for item in o.__subclasses__():
Esempio n. 3
0
#!/usr/bin/env python

"""
C.6.2 List-Making Environments
C.6.3 The list and trivlist Enviroments

"""

from plasTeX import Environment, Command, DimenCommand
from plasTeX import Logging

log = Logging.getLogger()

class enuminame(Command): unicode = ''
class enumiiname(Command): unicode = ''
class enumiiiname(Command): unicode = ''
class enumivname(Command): unicode = ''

class List(Environment):
    """ Base class for all list-based environments """
    depth = 0
    counters = ['enumi','enumii','enumiii','enumiv']
    blockType = True

    class item(Command):
        args = '[ term ]'
        counter = 'enumi'
        position = 0
        forcePars = True

        def invoke(self, tex):
Esempio n. 4
0
#!/usr/bin/env python

"""
C.6.2 List-Making Environments
C.6.3 The list and trivlist Enviroments

"""

from plasTeX import Environment, Command, DimenCommand
from plasTeX import Logging

log = Logging.getLogger()

class enuminame(Command): unicode = ''
class enumiiname(Command): unicode = ''
class enumiiiname(Command): unicode = ''
class enumivname(Command): unicode = ''

class List(Environment):
    """ Base class for all list-based environments """
    depth = 0
    counters = ['enumi','enumii','enumiii','enumiv']
    blockType = True

    class item(Command):
        args = '[ term ]'
        counter = 'enumi'
        position = 0
        forcePars = True

        def invoke(self, tex):
Esempio n. 5
0
#!/usr/bin/env python

import string, re
from DOM import Element, Text, Node, DocumentFragment, Document
from Tokenizer import Token, BeginGroup, EndGroup, Other
from plasTeX import Logging

log = Logging.getLogger()
status = Logging.getLogger("status")
deflog = Logging.getLogger("parse.definitions")

#
# Utility functions
#


def idgen():
    """ Generate a unique ID """
    i = 1
    while 1:
        yield "a%.10d" % i
        i += 1


idgen = idgen()


def subclasses(o):
    """ Return all subclasses of the given class """
    output = [o]
    for item in o.__subclasses__():