yihui/knitr — pull request #852 by juba (2014-10-07 14:15:43+00:00)
Title: Make kable() escape LaTeX special characters

When a table contains special characters such as `%` or `_`, they are not escaped by `kable()`, making the LaTeX file compilation fail.

For example, the following `Rnw` file will not compile :

\documentclass{article}
\begin{document}

<<>>=
library(knitr)
kable(data.frame(x=c("10%","5%"),col_name=c("3_8","40_6")), format="latex")
@

\end{document}

This very small patch just apply `escape_latex` to column names and table elements.