Thank you.
It was bit more complicated, but you directed me to the right package.
pagestyle{fancy} works but:
- not on the first page of report (probably because maketitle sets pagestyle to plain) - I work in regulated documentation system, and all pages of custom reports have to be numbered that way.
- it ruins elegant Tufte-like quarto report default by adding header rule and chapter title over it.
But fancyhdr package documentation is quite clear and I managed to make this:
format:
pdf:
include-in-header:
- file: pagenumbers.tex
In the pagenumbers.tex file:
\usepackage{lastpage}
\usepackage{fancyhdr}
\fancypagestyle{fancy}{
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\thepage\ of \pageref*{LastPage}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[C]{\thepage\ of \pageref*{LastPage}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\pagestyle{fancy}
It gives me desired page numbering on all pages and make no other modification to the report headers and footers (wchich are clear in my report format).
Thank you very much for your help.