title: How can I escape LaTeX special characters inside django templates?
body: <p>I have this django template which I use to generate LaTeX files</p>
  
  <pre><code>\documentclass[11pt]{report}
  
  \begin{document}
  \begin{table}
      \centering
      \begin{tabular}{lcr}
      \hline
      {% for col in head %}
          \textbf{ {{col}} }
          {% if not forloop.last %}
             &amp;
          {% endif %}
      {% endfor %} 
      \\
      \hline
      {% for row in table %}
          {% for cell in row %}
  
              {% if not forloop.last %} 
                 &amp;
              {% endif %}
          {% endfor %}
          \\
      {% endfor %}
      \hline
      \end{tabular}
      \caption{Simple Phonebook}
      \label{tab:phonebook}
  \end{table}
  
  \end{document}
  </code></pre>
  
  <p>But  my no of columns are very large so they can contain any special characters in them. I am getting error while generating pdf file.</p>
  
  <p>How can I escape all the text in all columns?</p>