I would like to include an image in a RMarkdown document and have it centered in the output Word.
Is this possible?
As suggested here, I have used:
<center>![My caption](myImage.png)</center>
without success.
I would like to include an image in a RMarkdown document and have it centered in the output Word.
Is this possible?
As suggested here, I have used:
<center>![My caption](myImage.png)</center>
without success.
This is not fully satisfactory, but what I did in the end was to add a macro in my styles document:
Sub Center_All_Images()
'
' Center_All_Images Macro
'
'
For Each oILShp In ActiveDocument.InlineShapes
oILShp.Select
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Next
End Sub
I still need to run the macro manually. I wish it was run automatically when the document is created from the template.