Rstudio Rmarkdown: Both Portrait and Landscape Layout in a Single PDF

Change paper size and orientation in an rmarkdown pdf

It doesn't seem to be documented, but you can include more than one classoption by separating the options with commas or by using a bulleted list with hyphens. Either of the following will work:

---
title: "Test"
output:
pdf_document:
toc: true
number_sections: true
documentclass: article
classoption:
- landscape
- a3paper
---


---
title: "Test"
output:
pdf_document:
toc: true
number_sections: true
documentclass: article
classoption: landscape, a3paper
---

Rmarkdown PDF: add page number in landscape flextable PDF report

You actually do have a page number on your page, but because you made the bottom margin so terrible tiny, you can't see as it gets pushed below the lower page boundary. If you increase your margin, you get the page number back:

---
title: ""
header-includes:
- \usepackage{xcolor}
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \usepackage{lastpage}
- \fancyfoot[C]{\thepage\ of \pageref{LastPage}}
- \renewcommand{\headrulewidth}{0pt}
output:
pdf_document:
keep_tex: true
classoption: landscape, a4paper
geometry: left=1cm,right=1cm,top=1cm,bottom=2.2cm
---


test

Sample Image



Related Topics



Leave a reply



Submit