Resizing images in RMarkdown

后端 未结 4 858
迷失自我
迷失自我 2021-02-04 12:37

I\'m trying to convert a R markdown .Rmd document to .pdf. Unfortunately, the images are too large. Is there any way to change the size of the image?

4条回答
  •  深忆病人
    2021-02-04 13:08

    There is a simple way to resize Images and still being able to add Captions. Use the following syntax within your RMarkdown code and place the Image's Caption beneath the Image:

    
    \begin{figure}
    \centerline{\includegraphics[width=0.5\textwidth]{your_image_name.png}}
    \caption{Entitäten zur Persistierung der Special Notifications}
    \end{figure}
    

    To scale the image just adapt the width-value from 0.5 to some other percentage-value fitting your needs.

    If you don't want to center the images, just remove the \centerline - Command with it's opening and closing brackets {}.

提交回复
热议问题