Announcement

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

  • Stata output directly inline with Markdoc 3.6.4 .ado

    Can you get Stata output directly inline using the Markdoc .ado?

    For example, in R Markdown, you'd write something like
    "the mean frequency is `r mean(WASHB$treatw, na.rm=TRUE)`."

    and then in the output you wouldn't be able to tell where the paper ended and the output began.

    "I think the mean frequency is 47. Then directly on to the next line in the paper."

    The closest thing I know of is you can use the txt ado, as follows:
    txt "mean of Price variable is " %9.2f r(mean) " and SD is " %9.2f r(sd)

    But then the output(both the text and the numbers) appears offset, and doesn't read nicely.

    Thanks,
    Garret

  • #2
    Garret Christensen

    What do you mean the output appears offset? Perhaps a reproducible example could help me understand your point better?
    I have attached a do-file along with a Microsoft Word docx output from markdoc. Does yours look like this as well? Here's the code:

    Code:
    qui log using example, replace smcl
    
    /***
    Writing dynamic text in MarkDoc
    ===============================
    
    Use the `txt` command to write dynamic text in **MarkDoc** as shown below:
    ***/
    
    //OFF
    sysuse auto, clear
    summarize price
    //ON
    
    txt "mean of Price variable is " %9.2f r(mean) " and SD is " %9.2f r(sd)
    
    qui log c
    
    
    markdoc example, replace export(docx)
    Attached Files
    ——————————————
    E. F. Haghish, IMBI, University of Freiburg
    [email protected]
    http://www.haghish.com/

    Comment

    Working...
    X