我有我用它來生成LaTeX文件我怎樣才能逃避內部Django模板LaTeX的特殊字符?
\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}
但我沒有列是非常大的,使他們能夠包含它們當中的任何特殊字符這個Django的模板。生成pdf文件時出現錯誤。
我怎麼能逃避所有列的所有文本?
不要忘了還包括r'\ textgreater'r'\ textless' – blueberryfields 2013-05-14 01:55:58
或r'\ ensuremath {<}'和r'\ ensuremath {>}' – sastanin 2014-09-15 10:53:23