I have
---
title: ""
header-includes:
- \usepackage{xcolor}
output: pdf_document
classoption: landscape, a4paper
geometry: left=1cm,right=1cm,top=1cm,bottom=0.2cm
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(flextable)
library(datasets)
set_flextable_defaults(fonts_ignore=TRUE)
world_phones<-data.frame(WorldPhones)
```
```{r echo=F}
flextable(world_phones)
```
\hfill \small Report generated: `r Sys.time() `
And I would like to add page numbers at the foot note center (bottom center of the page). If possible I would like to add the page number as Page X of Y.
However even \pagenumbering{arabic}
does not seem to work, I suspect because of the narrow margins. How can I achieve this?
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