1

I'm trying to reduce the size of a section of text within a qmd document that needs rendering in docx.

I tried using a styled div:

---
title: "Test"
format: docx
---

The main text will be normal-sized.

::: {style="font-size: 10pt;"}
This block of text should be sized 10pt.
:::

Observed output:

Observed output


Intended outptut:

enter image description here

Of note, my code works well in html.

Is there another way of doing this with a docx output?

Andrea M
  • 2,314
  • 1
  • 9
  • 27

1 Answers1

0

The styling process for docx is a little different: one needs to create a "reference doc", set the styles in that doc and apply it with

---
format:
  docx:
    reference-doc: my-styled-reference.docx
---

See How to specify the font used for word doc exported using pandoc? and How do I add custom formatting to docx files generated in Pandoc? for more details on this process.

tarleb
  • 19,863
  • 4
  • 51
  • 80