Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change the font of a table with esttab

    Dear all,

    I am trying to change the font of my tables that I export to word. I use the command esttab and I can export the table just fine, but it appears always in Times New Roman, which is apparently the default. I found the command fonttbl(string) in the documentation, but it does not work for me in the way described there. I always get the error message: option fonttbl() not allowed r(198);

    This is the code I use. Without the part: fonttbl(\f0\fnil Arial; ) it works fine.
    Code:
       
    *exporting the table
        esttab mod1 mod2 mod3 mod4  using Reg1.rtf , label replace obslast    /*
        */ order($list1A) r2 compress star(* 0.10 ** 0.05 *** 0.01) /*
        */  fonttbl(\f0\fnil Arial; ) /*
        */ nogaps nonotes t(3) b(%8.3f) addnotes("Control variables" "Time variables") /*
        */ drop(var1 var2)
    Thank you very much in advance. Any help would be appreciated!

    Kind regards
    Johannes

  • #2
    The following code works for me, it change the font to Arial:
    Code:
    sysuse auto, clear
    eststo: reg price i.foreign weight length
    esttab using example.rtf, ti("The Auto Data") label replace obslast r2 compress star(* 0.10 ** 0.05 *** 0.01) fonttbl(\f0\fnil Arial; ) nogaps nonotes t(3) b(%8.3f) addnotes("Control variables" "Time variables")

    Comment


    • #3
      The fonttbl option was added in the estout 20mar2015 update. Ensure you have the latest estout version with adoupdate.

      Comment


      • #4
        Thank you guys. It was indeed the update that helped.

        Comment


        • #5
          Dear all,

          changing the font-type works well. Is there also a way to change the font size? I tried playing around with the option but didn't find anything.

          Cheers!

          Comment


          • #6
            Not only do I not know how to change the default RTF document font-size with esttab, I don't even know how to do it with pure RTF. I'm not sure it's possible. For an individual element, you can use the \fs command in half-points, for example title(\fs144 Table Title).

            Comment

            Working...
            X