Reputation: 6741
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></center>
without success.
Upvotes: 1
Views: 1341
Reputation: 6741
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.
Upvotes: 1