我正在尝试给段落标题上色,但是效果不好。有人能指出为什么不能给我的部分上色吗?考虑下面的例子:
---
title: "number_sections"
output:
pdf_document:
number_sections: yes
toc_depth: 4
toc: true
header-includes:
-\usepackage{color}
- \usepackage{sectsty}
- \allsectionsfont{\color{red}}
---
# Main Section
The above section and the ones below should be red
## 2nd Level
### 3rd Level
# Second Section
## another section
### yet another
#### and the last one please
1条答案
按热度按时间mklgxw1f1#
您的代码非常正确,只是YAML头中的缩进有点不对:
header-includes
应位于左侧(不缩进),并且\usepackage
前缺少空格