当RMarkdown.rmd
文档被编织为 PDF,文本正文以及标题、副标题和标题均以相同的 LaTeX 标准字体呈现。
渲染四开时.qmd
文档为 PDF 时,文本正文的字体保持不变,但标题、副标题和标题以不同的字体呈现,没有衬线。
为了实现较旧的 R Markdown 文档和较新的 Quarto 文档的输出之间的一致性,我想将标题、副标题和标题的字体更改回正常字体。我怎样才能实现这个目标?
我尝试使用fontfamily:
在 YAML 标头中,但这没有找到我想要的字体。我通过使用取得了一些成功\setkomafont{section}{\normalfont}
in include-in-header:
,因为这确实改变了字体,但仅限于 h1 标题,而不是 h2 或标题或副标题。它还删除了 h1 的所有其他格式(例如字体大小、粗体等),这不是我想要的。
Using 这个答案通过 Tex StackExchange,我们可以轻松地在四开本中完成此操作。
---
title: "Fonts"
subtitle: "Changing fonts of title, subtitle back to normal font"
author: "None"
format:
pdf:
include-in-header:
text: |
\addtokomafont{disposition}{\rmfamily}
---
## Quarto
Quarto enables you to weave together content and executable code into a
finished document. To learn more about Quarto see <https://quarto.org>.
## Running Code
When you click the **Render** button a document will be generated that includes
both content and the output of embedded code.
当然,检查第 3.6 节 - 文本标记KOMA-Script 手册,其中提供了非常详细的元素列表(例如author
, chapter
, title
, subtitle
, date
等)可以对其进行此类更改。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)