conv = {'&': '\\&', '%': '\\%', '$': '\\$', '#': '\\#', '_': '\\_', '{':
    '\\{', '}': '\\}', '~': '\\textasciitilde{}', '^': '\\^{}', '\\':
    '\\textbackslash{}', '<': '\\textless', '>': '\\textgreater'}
How can i escape latex special characters inside django templates