gpt4 book ai didi

r - 如何更改knitr中的目录标题?

转载 作者:行者123 更新时间:2023-12-04 09:23:32 24 4
gpt4 key购买 nike

我正在使用以下选项使用 knitr 生成 pdf 文档:

---
title: "Test"
author: "Paulo Miramor"
date: "13-07-2015"
output: pdf_document
toc: yes
---

我想更改目录的标题(即“目录”),因为我正在制作葡萄牙语文档。有什么办法可以自定义吗?

最佳答案

感谢@Molx 和@Chris 在评论中我可以找到解决方案。

解决方案 1

添加 \renewcommand{\contentsname}{Índice}到文档,以便.Rmd标题是:

---
title: "Test"
author: "Paulo Miramor"
date: "13-07-2015"
output: pdf_document
header-includes:
- \renewcommand{\contentsname}{Whatever}
toc: yes
---

使用此解决方案,标题为 Whatever你放在里面 \contentsname争论。

解决方案 2

添加 lang: portuguese到文档,以便 .Rmd标题是:
---
title: "Test"
author: "Paulo Miramor"
date: "13-07-2015"
output: pdf_document
lang: portuguese
toc: yes
---

使用此解决方案,标题是“内容”到葡萄牙语的翻译。如果您的 TeX 安装支持该语言,这应该可以工作。

关于r - 如何更改knitr中的目录标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31396414/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com