1

I have an old Lyx file that used to work, but quit working after updating R to 3.03 and updating packages.

Issue is with xtable in a longtable environment with the character % in the caption.

Here is a minimal example:

<<tabtest,results='asis'>>=
library(xtable)
table=matrix(1:12,nrow=3)
rownames(table)=c("row 1","row 2","row 3")
colnames(table)=c("c1","c2","c3","c4")
table.x=xtable(table,caption="table of %")
print(table.x,tabular.environment="longtable",floating=FALSE)
@

have \usepackage{longtable} in preamble

As presented, you get a no legal end error.
If you change the % to percent it works.

tonytonov
  • 25,060
  • 16
  • 82
  • 98

1 Answers1

1

Escape the % sign using \%, since it implies a line-comment in TeX. So use

table.x=xtable(table,caption="table of \%")
Werner
  • 14,324
  • 7
  • 55
  • 77