当我用 Quarto 创建一个 docx 文件时,我可以证明我的文本吗?

Can I justify my text when I create a docx file with Quarto?

我已经在 R 中使用 quarto 几天了。

我需要生成带有对齐文本和 Times New Roman 字体的 .docx

为了在 .rmd 文件中证明合理,我将 <div style="text-align: justify"> 放在文件的开头并以 </div>.

结尾

但这不适用于 quarto。我该如何解决?

此外,如何更改 quarto 中的主要字体?

我的代码:

---
title: "My simple title"
description: | 
  Text proof
author: "My name and ID"
format: 
  docx:
    geometry: 
      - top=30mm
      - left=30mm
editor: visual
---

<div style="text-align: justify"> 

**UNIVERSIDADE DE SÃO PAULO - USP**

-   Program

-   Date: 10/05/2022

-   Subject: Calc

-   Professor: Marcelo 

# Question
**1)** Text textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textText textxt textText textText textText textText textText textText textText textText textText textText textText textText textxt textText textText textText textText textText textText textText textText textText textText textText textText text

</div>

我刚刚用 https://quarto.org/docs/output-formats/ms-word-templates.html

解决了

首先您创建一个引用 .docx 并定义文档的样式,如标题、作者、第一段等。

比你在 .qmd 添加的要多

format:
  docx:
    reference-doc: custom-reference-doc.docx