|
@ -10,8 +10,7 @@ import os |
|
|
import re |
|
|
import re |
|
|
import json |
|
|
import json |
|
|
|
|
|
|
|
|
from patacrep import encoding |
|
|
from patacrep import encoding, errors, files |
|
|
from patacrep import errors |
|
|
|
|
|
|
|
|
|
|
|
_LATEX_SUBS = ( |
|
|
_LATEX_SUBS = ( |
|
|
(re.compile(ur'\\'), ur'\\textbackslash'), |
|
|
(re.compile(ur'\\'), ur'\\textbackslash'), |
|
@ -38,7 +37,8 @@ _VARIABLE_REGEXP = re.compile(ur""" |
|
|
. # Match any single character |
|
|
. # Match any single character |
|
|
)* # Repeat as often as possible |
|
|
)* # Repeat as often as possible |
|
|
) # End of capturing group 1 |
|
|
) # End of capturing group 1 |
|
|
\(\*\ *endvariables\ *\*\) # until (* endvariables *) is matched.""", |
|
|
\(\*\ *endvariables\ *\*\) # until (* endvariables *) is matched. |
|
|
|
|
|
""", |
|
|
re.VERBOSE|re.DOTALL) |
|
|
re.VERBOSE|re.DOTALL) |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -96,6 +96,8 @@ class TexRenderer(object): |
|
|
self.texenv.trim_blocks = True |
|
|
self.texenv.trim_blocks = True |
|
|
self.texenv.lstrip_blocks = True |
|
|
self.texenv.lstrip_blocks = True |
|
|
|
|
|
|
|
|
|
|
|
self.texenv.globals["path2posix"] = files.path2posix |
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|
self.template = self.texenv.get_template(template) |
|
|
self.template = self.texenv.get_template(template) |
|
|
except TemplateNotFound as exception: |
|
|
except TemplateNotFound as exception: |
|
|