0

I have tried to center an image and I have not been able, I have found that you can center text, Centered text , but I have not found examples of how to center an image, thanks in advance to those who know

John_B
  • 41
  • 8

2 Answers2

4

In your chunk options.

{r chunkName, fig.align="center", out.height="90%", out.width = "90%", fig.cap=" Whatever.\\label{whatever}"}

knitr::include_graphics("figures/whatever.png")
Dharman
  • 30,962
  • 25
  • 85
  • 135
geomicrobio
  • 321
  • 1
  • 3
  • 15
  • """![ghost](https://user-images.githubusercontent.com/30079428/123889885-b85fb300-d92c-11eb-93df-07a974e21eb2.gif)""" I am customizing my Github with this gift, this is the line that inserts the gift, your help did not work for me, thank you very much – John_B Jun 30 '21 at 02:13
  • I suggest you provide more information about your problem and some code in order to have more specifications. – geomicrobio Jun 30 '21 at 15:09
0

for those rendering to docs... I accomplished this by having a well-formatted docx template and then specifying that section in my code... In my case heading 3 (###) is centered in my word doc template.

---
output:
  word_document:
    reference_docx: template.docx
---

...your other code...

### ![](image.png){width=250}