onecolumn_re = re.compile('\\\\onecolumn')
preMudelaExample_re = re.compile('\\\\def\\\\preMudelaExample')
postMudelaExample_re = re.compile('\\\\def\\\\postMudelaExample')
-boundingBox_re = re.compile('%%BoundingBox: ([0-9]*) ([0-9]*) ([0-9]*) ([0-9]*)')
+boundingBox_re = re.compile('%%BoundingBox: ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)')
def file_exist_b(name):
try:
# 'tex' or 'eps'
self.graphic_type = 'tex'
self.code_type = 'unknown'
+ self.code_type_override = None
def write (self, line):
# match only if there is nothing but whitespace before \begin HACK
if re.search('^\s*\\\\begin{mudela}', line):
else:
optlist = []
if 'fragment' in optlist:
- print "warning: obsolete option: fragment"
- if 'floating' in optlist:
- print "warning: obsolete option: floating, change to eps"
+ self.code_type_override = 'fly'
+ if 'nonfragment' in optlist:
+ self.code_type_override = 'ly'
if 'eps' in optlist:
self.graphic_type = 'eps'
for pt in fontsize_pt2i.keys():
def close (self):
if self.code_type == 'unknown':
self.code_type = 'fly'
- if self.code_type == 'ly':
- self.write_red_tape()
- for l in self.__lines:
- self.file.write(l)
- else:
- self.write_red_tape()
- for l in self.__lines:
- self.file.write(l)
+ if self.code_type_override:
+ self.code_type = self.code_type_override
+ print "override:", self.code_type_override
+ self.write_red_tape()
+ for l in self.__lines:
+ self.file.write(l)
+ if self.code_type == 'fly':
self.file.write('}}')
self.file.close()
else:
file.write(line)
file.close()
+
class Tex_input:
def __init__ (self, filename):
for fn in [filename, filename+'.tex', filename+'.doc']:
else:
opts = ', '+opts
(start, rest) = string.split(line, r_mud.group(), 1)
- retlines.append(start+'\n')
+ retlines.append(start)#+'\n')
v = string.split(defined_mudela_cmd[r_mud.groups()[0]], '\n')
for l in v[1:-1]:
l = re.sub(r'\\fontoptions', opts, l)