Following this previous question, I thought I could first convert the output of stargazer (latex code for summary statistics table) to png, using R commands (like dvi, dvips, ...) inside an R chunk or, in the worst case, invoking system commands (see this post), and then import the produced png into my Rmd file, using a command like
![alt text](summary_lm.png)
Do you think this is possible? Could you show me how to do it, because I had no luck?
You can use the
object
tag to embed a PDF file in an HTML file (but it is not supported by all web browsers).One tricky point is that the size of the PDF files generated by LaTeX has to be set in advance; but, to display a table, you may prefer if the PDF file had exactly the size of the table, to avoid large empty margins and/or scrolling bars. You can use GhostScript to crop the PDF file.
Here is an example.