mirror of
https://github.com/nanoy42/coope
synced 2024-11-26 06:32:27 +00:00
12 lines
No EOL
351 B
Python
12 lines
No EOL
351 B
Python
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 |