Announcement

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

  • Issues with special characters in variable labels in esttab output

    I am trying to label variables in Stata for a table in Latex. I have tried several different ways and have run into different issues. The labels as they appear in the Stata variables window are correct, but when I actually run the esttab command, the labels in the tex file either contain additional backslashes or have dropped characters. I suspect this has something to do with needing to escape the characters, but I haven't figured out precisely what is causing the issue.

    When I label the variables in the following way:
    Code:
    la var temp "$\textnormal{Temperature}_{it}$"
    la var tempdev "$\textnormal{u}_{it}$"
    The output in the text file is:
    Code:
    $\textnormal{Temperature}\_{it}$
    $\textnormal{u}\_{it}$
    which causes issues with the subscript when I try to compile the table since it is treating the underscore as a character.

    I have also tried
    Code:
    la var temp "Temperature$_{it}$"
    la var tempdev "u$_{it}$"
    which results in
    Code:
    Temperature{it}$
    u{it}$
    I would really appreciate any help in understanding what is happening here. Most of what I was finding pertained to intentionally adding backslashes, so I am pretty confused about what I need to change to get rid of them.

    Thanks!
    Last edited by Stephanie Stewart; 09 Jan 2023, 16:02.

  • #2
    See https://www.statalist.org/forums/for...n-extra-to-tex

    Comment

    Working...
    X