File: Lengths.py

package info (click to toggle)
plastex 3.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,132 kB
  • sloc: python: 23,341; xml: 18,076; javascript: 7,755; ansic: 46; makefile: 40; sh: 26
file content (41 lines) | stat: -rw-r--r-- 881 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
C.13.1 Length (p215)

"""

from plasTeX import Command, DimenCommand


class fill(DimenCommand):
    value = DimenCommand.new('1fill')

class stretch(Command):
    args = 'num:dimen'

class newlength(Command):
    args = 'name:cs'
    def invoke(self, tex):
        self.ownerDocument.context.newdimen(self.parse(tex)['name'])

class setlength(Command):
    args = 'name:cs len:nox'
#   def invoke(self, tex):
#       a = self.parse(tex)
#       ownerDocument.createElement(a['name']).setlength(a['len'])

class addtolength(Command):
    args = 'name:cs len:nox'
#   def invoke(self, tex):
#       a = self.parse(tex)
#       self.ownerDocument.createElement(a['name']).addtolength(a['len'])

class settowidth(Command):
    args = 'name:cs text:nox'
    
class settoheight(Command):
    args = 'name:cs text:nox'

class settodepth(Command):
    args = 'name:cs text:nox'