Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rmarkdown html embed pdf/eps

Tags:

r

r-markdown

I'm trying to make an R markdown HTML document in Rstudio. I have a number of images that I have in pdf and eps format. I'm trying to embed these into the output with the \includegraphics{path to image} command. However, the output HTML doesn't show anything.

like image 688
Jake Avatar asked Sep 15 '15 18:09

Jake


1 Answers

R-markdown is also a markdown. Markdown itself doesn't have a mechanism for embedding a PDF, however, Markdown accepts raw HTML in its input and passes it through unaltered.

There are many ways to do this, one of the recommended ways is-

<object data="http://www.africau.edu/images/default/sample.pdf" type="application/pdf" width="700px" height="700px">
    <embed src="http://www.africau.edu/images/default/sample.pdf">
        <p>This browser does not support PDFs. Please download the PDF to view it: <a href="http://www.africau.edu/images/default/sample.pdf">Download PDF</a>.</p>
    </embed>
</object>
like image 71
Abrar Jahin Avatar answered Oct 16 '22 03:10

Abrar Jahin