LaTeXファイルを生成するために使用するこのdjangoテンプレートがあります
\documentclass[11pt]{report}
\begin{document}
\begin{table}
\centering
\begin{tabular}{lcr}
\hline
{% for col in head %}
\textbf{ {{col}} }
{% if not forloop.last %}
&
{% endif %}
{% endfor %}
\\
\hline
{% for row in table %}
{% for cell in row %}
{% if not forloop.last %}
&
{% endif %}
{% endfor %}
\\
{% endfor %}
\hline
\end{tabular}
\caption{Simple Phonebook}
\label{tab:phonebook}
\end{table}
\end{document}
しかし、列の数は非常に大きいため、特殊文字を含めることができます。PDF ファイルの生成中にエラーが発生します。
すべての列のすべてのテキストをエスケープするにはどうすればよいですか?