Announcement

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

  • esttab, @span and the additional column introduced by "labcol2"

    Hi,

    I'm printing my regression tables using esttab and TeX. mgroups() allows me to create column headers combining multiple columns. In particular when I use

    Code:
    prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))
    the resulting tables look very appealing with horizontal lines spanning all the columns bundeled under one heading.

    Unfortunately, once I use labcol2(), @span gets confused and doesn not count the additional column.

    Is there an easy fix for that? Something like; @span+1 ?

    Full example
    Code:
    esttab est1 est2 est3, mgroups("first two" "last one", pattern(1 0 1) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) labcol2("var1" "var2" "var3")
    Best,

    S

  • #2
    I found a solution from the TeX side, which I'm posting here for completeness:

    Code:
     prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidruleshifted{@span}))
    And in TeX I write:
    Code:
    \newcommand{\cmidruleshifted}[1]{\cmidrulehelp#1\relax}
    \def\cmidrulehelp#1-#2\relax{\cmidrule(lr){\numexpr#1+1\relax-\numexpr#2+1\relax}}
    I got that from Steven Segletes through: http://tex.stackexchange.com/questio...n-to-the-right

    Comment


    • #3
      Actually, just update estout. This was fixed in 3.21.

      Comment

      Working...
      X