我想对Rmarkdown html文件中的文本进行两端对齐。我知道如何在YAML标头后使用<style> body {text-align: justify} </style>
(按照this的答案):
---
output: html_document
---
<style> body {text-align: justify} </style> <!-- Justify text. -->
# Text that is justified on both sides
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML,PDF,and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this. This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML,and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this.
但是,我想找到一种直接在YAML标头中指定此方法的方法,而不是在YAML标头后指定方法,而不必求助于同一存储库中的其他.css文件。换句话说,我不想将一小段html代码放在单独的.css文件中并通过
调用output:
html_document:
css: justify.css
,我不希望它出现在Rmarkdown文件的主体中。我该怎么办?