Trouble with the Word Themes in Bookdown knit

Hi,
I’m using bookdown and I’m trying to change the style of my word document output when I build the book. I have a word document called “wordtemplate.docx” and in it general text with the styles I like, sotred with the markdown files.
In the index (YAML part) of my book down I have a section:
word_document2:
reference_docx: "wordtemplate.docx"

I followed the instructions here but when I update the template, nothing changes in the output, the styles of text are not the way I want them, or specify in my template doc (e.g. the size of headings)
I’m not sure where I am going wrong, but if anyone is able to offer some insight I would really appreciate it!

Hi,

Do you have a more precise example to share ? This should work as expected when you follow these steps

  1. Render the document once
  2. Save the result document with a new name to be the template, modify the styles as you wish
  3. Use the document as template using the reference_docx: key. Be sure to check YAML indentation so that the YAML key is correctly found.

This simple examples works for me

---
title: "test"
output:
  bookdown::word_document2:
    reference_docx: test-template.docx
---

# something

I just modified the heading 1 Style to change color.

Depending on what is not working for you, it is possible that you are tweaking the wrong style or the customization is not supported. But I would be surprise. It is just a guess - I need more information.

Thanks so much for your reply! I ended up deleting and re-writing the index, and it fixed so I must have made a small mistake in the YAML indentation!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.