当前位置: 首页 > 编程学习 > 其它语言 > R语言 > 正文

Rmarkdown:输出pdf设置

2018-04-22 来源:博客园/嘻呵呵

输出pdf需要安装Ctex

---
title: "first markdown"
author: "name"
date: "`r format(Sys.time(), '%Y年%m月%d日')`"
geometry: left = 3.18cm, right = 3.18cm, top = 2.0cm, bottom = 2.0cm
fontsize: 12pt
output: 
        pdf_document: 
                latex_engine: xelatex
header-includes:
- \usepackage{xeCJK}
- \usepackage{graphicx}
- \usepackage{fancyhdr}
- \usepackage{setspace}
- \usepackage{indentfirst}
- \setmainfont{Times New Roman}
- \setCJKmainfont{Microsoft YaHei}
- \parindent 2 em
---