haghish / markdoc

A literate programming package for Stata which develops dynamic documents, slides, and help files in various formats
http://haghish.com/markdoc
87 stars 30 forks source link

esttab with html #27

Closed cdsamii closed 5 years ago

cdsamii commented 5 years ago

Thank you for the excellent package. I am trying to insert an esttab table into html using the //IMPORT arguments. The rendering is not so good, however. The problem can be produced with the following code:

set linesize 80
qui log using esttab-example, replace
/***
We will attempt to insert a table from esttab into html:
***/

/***/ sysuse auto, clear
eststo clear
eststo: reg price mpg
eststo: reg price mpg foreign
esttab using test-reg.html, b(2) se(2) replace l page

//IMPORT test-reg.html

qui log c

markdoc esttab-example, replace export(html) install

The table with regression results is not rendered properly from esttab-example.html, although if one simply opens test-reg.html the rendering appears okay.

haghish commented 5 years ago

I checked your code and I could reproduce the problem. However, it was caused by PANDOC. I don't know if you have been following the code, but I've made it clear that the future of markdoc is its mini engine. The mini engine does require any dependencies...

I re-run your code with the mini engine (which does not use pandoc) and there was no problem at all. Just add the mini option to your command:

 . markdoc esttab-example, replace export(html) mini