0

I'm experimenting with pandoc and the R knitr package in order to export R Markdown files to Microsoft Word. As part of the knitr/pandoc process, the final docx output copies the formats of a specified reference.docx. For example, level 1 section headers would follow the style of level 1 headings specified in the reference.docx's styles pane.

Knitr and pandoc do a pretty good job of forcing the new docx file to adhere to the specified formats in the reference.docx with the exception of figure captions: the final docx file has figure captions without numbering and they're below their respective figures.

In my reference.docx file, I have modified the caption style to do section level numbering (example: "Figure 1-1: Caption here"), and the captions are above the images in the reference.docx file. Unfortunately, I wasn't able to do this through the styles pane. It was a one-shot adjustment that doesn't change any default settings. I think that if I could change the default settings of figure captioning in the reference.docx through the styles pane, I could resolve this issue, but I cannot find any option to modify the default setting of the caption's location and prefix (example: "Figure 1-1: ").

1 Answer 1

0

There is no setting or preference that controls it, but this seems to work:

  • In Word, open the Normal.dotm template
    (normally found at C:\Users\USERNAME\AppData\Roaming\Microsoft\Templates\Normal.dotm)
  • Insert a Figure of some sort
  • Create a Caption using the wanted positioning
  • Save the template
  • Delete the Figure and the Caption (don't use Undo)
  • Close and Save the template again
  • Quit Word.

From now on you should find that this positioning is selected by default position.

Note: If Word does not let you save over the normal.dotm file, save it as normal2.dotm in the same folder, before deleting the figure and caption and saving it again. After quitting Word, delete the original version of normal.dotm and rename normal2.dotm as normal.dotm.

4
  • This didn't work for me. Word did not let me save the normal.dotm file so I followed the instructions in your note. I'm on Mac so I had to find the file in '~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Templates.localized'. I didn't get any changes in default caption placement after going through each of these steps. Commented Nov 14, 2019 at 19:19
  • I'm not on the Mac, but I saw one source saying the file is found in ~/Library/Application Support/Microsoft/Office/User Templates/ . Commented Nov 14, 2019 at 19:28
  • I have the directory ~/Library/Application Support/ but I don't have a Microsoft folder. Commented Nov 14, 2019 at 19:34
  • Word for Mac is different from Windows. But one last try: Remove normal.dotm (copy first elsewhere), start Word which will create a new one, close Word, then redo the above procedure. Commented Nov 14, 2019 at 19:49

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.