I want to change the font size for my title/caption in the table made using xtable
. The following code changes the size of the text in the table, but not the caption/title.
Tab <- xtable::xtable(myTable, caption="\\tt Title")
print(Tab, floating=TRUE, size="\\fontsize{6pt}{8pt}\\selectfont")
However, if using longtable
(for which you need \usepackage{longtable}
) as shown below, the caption has the correct font size.
Tab <- xtable::xtable(myTable, caption="\\tt Title")
print(Tab, floating=TRUE, tabular.environment="longtable", size="\\fontsize{6pt}{8pt}\\selectfont")