【发布时间】:2022-01-17 10:01:53
【问题描述】:
鉴于下面的代码,它当前在页面顶部输出页码,我希望它输出 PDF 页数,如Page 1 of 3。我做了很多搜索,但没有找到包含总页码的任何方法。
问题这可以用 R Markdown 做吗?如果没有,有什么解决方法吗?
我用谷歌搜索了这个,没有发现任何明显的东西,例如 YAML 或 TeX 解决方案,但是,我可能遗漏了一些东西或没有搜索正确的东西。
RMarkdown 代码
---
title: "R Markdown Example With Numbered Sections"
output:
bookdown::pdf_document2:
toc: true
toc_depth: 6
number_sections: true
includes:
in_header: header.tex
header-includes:
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \fancyhead[RO,RE]{\thepage}
- \fancyhead[LO,LE]{Header Message}
- \fancyfoot[LE,LO]{Footer Messge on the Left}
- \fancyfoot[LE,RO]{Footer Messge on the Right}
---
\thispagestyle{fancy}
# Example R Rarkdown : Numbered Sections
## R Markdown
### Description
Some description text
\newpage
#### Details
Details go here.
\newpage
## Plots
Plots go here
\newpage
Last page
当前标题
所需的标题
【问题讨论】:
标签: r r-markdown knitr pandoc tex