Announcement

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

  • cross-referencing tables produced with esttab in markstat

    Referencing equations and figures (as described here: https://data.princeton.edu/stata/markdown/crossref) works well for my purposes, but I'm struggling to extend this to tables produced using -esttab-.

    Is it possible to label tables produced with -esttab- inside a markstat (.stmd) file?

  • #2
    The key to labeling tables with -esttab- for reference in a document knitted together with the help of -markstat- is to first output the table to tex format and label the table in the title:


    Code:
    qui esttab some_estimate using "table-of-estimates.tex", booktabs replace title("This is a title\label{table1}")

    Then you can insert the table in your .stmd file:


    Code:
    \input{table-of-estimates.tex}
    And reference the table accordingly:


    Code:
    \ref{table1}
    Finally, for this all to work you must keep the intermediary latex output and use -pdflatex- to complete a second conversion:

    Code:
    markstat using file.stmd, pdf strict keep(do tex)
    whereis pdflatex
    ! "`r(pdflatex)'" file.tex
    view browse file.pdf

    I want to thank German Rodriguez for creating -markstat-. Consider visiting his website to learn more: https://data.princeton.edu.

    Comment


    • #3
      Hi Giovanni Colitti. Sorry I missed your question last week, but glad to see that you sorted it out. I have modified the discussion of cross-references at https://data.princeton.edu/stata/markdown/crossref by adding a short paragraph with a link to your question and answer on this post. Thanks!

      Comment

      Working...
      X