mirror of https://github.com/nanoy42/coope
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
351 B
12 lines
351 B
from django_tex.environment import environment
|
|
|
|
def latex_safe(value):
|
|
return str(value).replace('_', '\_').replace('$', '\$').replace('&', '\&').replace('#', '\#').replace('{', '\{').replace('}','\}')
|
|
|
|
|
|
def my_environment(**options):
|
|
env = environment(**options)
|
|
env.filters.update({
|
|
'latex_safe': latex_safe
|
|
})
|
|
return env
|