R Blogdown: insert images side by side using knitr

徘徊边缘 提交于 2020-01-05 09:14:23

问题


I am working on a personal website using blogdown. I know about the handy addin for inserting an image - it works well, but for only one image. Is there a way, using knitr::include_graphics, to insert multiple images side-by-side?

I'm aware of using something like this: ![image text](path/to/image.png) ![other image text](path/to/image2.png)

But this cannot adjust the size of each image, which is an important formatting option for me.

Note:
While poking around for a solution before I post this question, I found this github issue which seems to be similar to what I'm talking about.

Edit:
Using something like this: <img src="path/to/image.png" width="50%"/><img src="path/to/image2.png" width="50%"/> Was suggested, but it only displays the images on top of each other in the document.


回答1:


I'll post the solution mentioned in the above comments since it worked the best for me, and I'll certainly come back to this post to use this in the future. The answer here seems to be the only thing that works for me. If getting the path name correct is difficult, run the command getwd() in the line above to make sure readPNG is looking in the right place.



来源:https://stackoverflow.com/questions/53382240/r-blogdown-insert-images-side-by-side-using-knitr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!