9

I want to change the font size of the table using print.xtable.

Using

print(xT, size="\\tiny")

works but I don't know other options for size. Something like size="7pt" would be nice.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
b4154
  • 353
  • 3
  • 4
  • 14

1 Answers1

16

You may choose a particular font size with the \fontsize{<size>}{<line space>} command:

print(xt, size="\\fontsize{9pt}{10pt}\\selectfont")
rcs
  • 67,191
  • 22
  • 172
  • 153
  • what are the options {9pt}{10pt} after fontsize – b4154 Nov 30 '15 at 08:57
  • fontsize and line space – rcs Nov 30 '15 at 09:02
  • 1
    Using \resizebox{\textwidth}{!}{% for setting the table to 100% width size disables the options size="\\fontsize{9pt}{10pt}\\selectfont". What can I do to use fontsize{9pt}{10pt} but setting the table width to 100%? – b4154 Nov 30 '15 at 09:05
  • @rcs This doesn't work for me. It outputs the desired .tex table file, but doesn't change the size or spacing. Does one of my options below disable the `size` option? `print(xtable(results), only.contents=TRUE, include.rownames=F, include.colnames=T, floating=F, hline.after=NULL, size="\\fontsize{9pt}{10pt}\\selectfont", file = '~/Dropbox/Paper/table.tex')` – Dr. Beeblebrox May 24 '16 at 08:55