getStataLabel<-function ()
{
chunklist<-knitr:::knit_code$get()
#找stataChunk
StataLabel<-unlist(lapply(chunklist,
function(x){
chunk_opts<-attr(x,"chunk_opts")
if(!is.null(chunk_opts$engine)
&& chunk_opts$engine=="stata")
return(chunk_opts$label)
else return ("");
}))
return(StataLabel[StataLabel!=""])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.