使用R降价为每个页面创建页脚 [英] Creating a footer for every page using R markdown

查看:65
本文介绍了使用R降价为每个页面创建页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用R Markdown编写文档,我希望在编织PDF文档时在每页上都包含一个页脚.有人对如何执行此操作有任何想法吗?

I'm writing a document in R Markdown and I'd like it to include a footer on every page when I knit a PDF document. Does anyone have any idea on how to do this?

推荐答案

是的,已经在这里提出并回答了这个问题:

Yes, this question has been asked and answered here: Adding headers and footers using Pandoc. You just need to sneak a little LaTeX into the YAML header of your markdown document.

此markdown标头可实现此目的:

This markdown header does the trick:

---
title: "Test"
author: "Author Name"
header-includes:
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \fancyhead[CO,CE]{This is fancy header}
- \fancyfoot[CO,CE]{And this is a fancy footer}
- \fancyfoot[LE,RO]{\thepage}
output: pdf_document
---

可以在适用于Windows的RStudio版本0.98.1030的Rmd文件中为我工作.

这篇关于使用R降价为每个页面创建页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆