I want to center image in R markdown in knit word.
I search result almost is CSSor HTML code.
But I need center image in word.
This my code
{ width=5cm }
Thanks!
I want to center image in R markdown in knit word.
I search result almost is CSSor HTML code.
But I need center image in word.
This my code
{ width=5cm }
Thanks!
I encountered the same problem and managed to solve it using a .docx file template that I declared at the beginning of the document:
---
output:
word_document:
reference_docx: template.docx
---
Just open your template file, select a figure, then press Ctrl + Shift + s to display the style panel for Microsoft Word. Change the alignment style of the text to "centered". Save your template.docx then knit your document as usual.