Announcement

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

  • esttab: add footnootes to latex that are formatted consistently across multiple lines

    Hello,
    I am trying to export regression tables in latex using esttab.
    I am having trouble finding a way to format very long footnotes. The code I am using is something like this

    Code:
    sysuse auto, clear
    
    reg price weight length
    eststo reg1
    
    reg price weight length mpg
    eststo reg2
    
    esttab reg1 reg2 using "testtex.tex", replace ///
    label se star(* 0.10 ** 0.05 *** 0.01) b(3) se(3) compress ///
    noobs nomtitle collabels(none)  nonotes nogaps ///
     title("This is a table with very long footnotes") ///
     substitute([htbp] [!htbp] \begin{tabular} \small\begin{tabular}) ///
     addnotes("This is a very long footnote that I would like to have formatted across multiple lines withouth affecting the column spacing" ///
     "I am aware I can split the footnote in multiple lines. But this is not what I want to do")
    in LaTex the table looks something like this.
    Click image for larger version

Name:	Screenshot 2021-05-12 at 19.19.29.png
Views:	1
Size:	34.9 KB
ID:	1609209



    I would like the footnote to automatically change the line once it reaches the table witdth. without distorting the column space. Does anyone know how I could do this directly using esttab?

    thanks a lot in advance for your help


  • #2
    If anyone is interested I found the solution. it is simply necessary to substitute the `{l}` with `{p{\linewidth}}` in the footnotes. It can be achieved simply by adding this to the endo of the substitute command

    Code:
     
     substitute([htbp] [!htbp] \begin{tabular} \small\begin{tabular} {l} {p{\linewidth}})

    Comment


    • #3
      Hi Tom Ford, This is of great help! Thanks!

      In a similar vein, Is col (2) wider because of the footnote? If not, how would you get similar column wide in cols (1) and (2)? Thanks.

      Comment

      Working...
      X