Centering image and text in R Markdown for a PDF report

后端 未结 9 1676
情深已故
情深已故 2020-12-28 12:10

I want to center an image and/or text using R Markdown and knit a PDF report out of it.

I have tried using:

->Text<-

->![](image1.jpg)<-         


        
9条回答
  •  清酒与你
    2020-12-28 12:30

    I used the answer from Jonathan to google inserting images into LaTeX and if you would like to insert an image named image1.jpg and have it centered, your code might look like this in Rmarkdown

    \begin{center}
    \includegraphics{image1}
    \end{center}
    

    Keep in mind that LaTex is not asking for the file exention (.jpg). This question helped me get my answer. Thanks.

提交回复
热议问题