I'm trying to get a fancyhdr onto all pages of my appendix. The header and footer don't continue to the end of the section. There are different sections of the appendix (Appendix A, Appendix B, C, ...).
In the MWE, the fancyhdr stop after page 5. A MWE with my preamble is below. Should compile with pdflatex (maybe lualatex).
\documentclass[11pt,a4paper,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[main=english,german]{babel}
\usepackage{libertine}
\usepackage{lettrine}
\makeatletter %% Define a HUGE font size
\newcommand\HUGE{@setfontsize\Huge{35}{35}}
\makeatother
\usepackage[doublespacing]{setspace}
\usepackage{fancyhdr}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{float}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\usepackage{longtable}
\usepackage{pgfplotstable}
\newcommand{\sbx}[2][c]{%
\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}
\usepackage{pdflscape}
\usepackage{rotating}
\usepackage{ragged2e}
\usepackage{pdfpages}
\usepackage[titletoc,title]{appendix}
\usepackage{titlesec}
\titleclass{\part}{top} % formatting part pages (https://tex.stackexchange.com/questions/431868/part-page-styling?rq=1)
\titleformat{\part}
[display]
{\thispagestyle{empty}\raggedleft\fontfamily{LinuxBiolinumT-OsF}\selectfont\HUGE\bfseries}
{\vspace{9cm}\MakeUppercase{\partname} \thepart}
{0pt}
{\vspace{10.5cm}\titlerule[.7pt]\vspace{.5cm}\Huge}
\titleclass{\chapter}{top} % formatting chapter pages (https://tex.stackexchange.com/questions/431868/part-page-styling?rq=1)
\titleformat{\chapter}
[display]
{\raggedleft\fontfamily{LinuxBiolinumT-OsF}\selectfont\HUGE\bfseries}
%{\vspace{-2cm}{}}
{\vspace{1cm}{\chaptername} \thechapter}
{0pt}
{\vspace{1pc}\Huge}
%
\titlespacing*{\chapter}{0pt}{1.8cm}{1cm}
%
\usepackage{afterpage} % command for blank pages
\newcommand\blankpage{
\null
\thispagestyle{empty}
\addtocounter{page}{-1}
\newpage
}
\usepackage{emptypage} % additional package for blank pages
\usepackage{lipsum}
\usepackage{filecontents}
%%%%%%%%%%%%%%%%%
\begin{document}
\begin{filecontents*}{data.csv}
Number of points, Values
10, 100
20, 400
30, 1200
40, 2345
\end{filecontents*}
\renewcommand\chaptername{Appendix} % change "chapter" header to "appendix
\newpage
\pagestyle{empty}
\part*{Appendix}
\clearpage
\begin{appendices}
\newpage
\renewcommand\thefigure{A.\arabic{figure}}
\renewcommand\thetable{A.\arabic{table}}
\setcounter{table}{0}
\setcounter{figure}{0}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[LE, RO]{\textbf{Appendix A}}
\fancyfoot[C]{\thepage}
\chapter*{Appendix A: My title} \label{app:A}
\addcontentsline{toc}{chapter}{A: My title}
\section*{My section 1}
\lipsum[1]
\subsection*{My subsection 1}
\lipsum[2-4]
\section*{My section 2}
\begin{table*}[!htbp]
\centering
\caption{My table}
\begin{footnotesize}
\pgfplotstabletypeset[
assign column name/.style={/pgfplots/table/column name={\textbf{#1}}},
col sep=comma,
column type=,
begin table={\begin{tabularx}{.95\linewidth}{X c }},
end table={\end{tabularx}},
string type,
columns/0/.style={string type,column name={}},
columns/1/.style={string type,column name={}},
every head row/.style={
before row={\toprule\addlinespace},
after row=\bottomrule\addlinespace},
every last row/.style={after row=\bottomrule}
]{data.csv}
\end{footnotesize}
\label{table}
\end{table*}
\subsection*{My subsection 1}
\lipsum[2-4]
\begin{table*}[!htbp]
\centering
\caption{My table}
\begin{footnotesize}
\pgfplotstabletypeset[
assign column name/.style={/pgfplots/table/column name={\textbf{#1}}},
col sep=comma,
column type=,
begin table={\begin{tabularx}{.95\linewidth}{X c }},
end table={\end{tabularx}},
string type,
columns/0/.style={string type,column name={}},
columns/1/.style={string type,column name={}},
every head row/.style={
before row={\toprule\addlinespace},
after row=\bottomrule\addlinespace},
every last row/.style={after row=\bottomrule}
]{data.csv}
\end{footnotesize}
\label{table}
\end{table*}
\begin{table*}[!htbp]
\centering
\caption{My table}
\begin{footnotesize}
\pgfplotstabletypeset[
assign column name/.style={/pgfplots/table/column name={\textbf{#1}}},
col sep=comma,
column type=,
begin table={\begin{tabularx}{.95\linewidth}{X c }},
end table={\end{tabularx}},
string type,
columns/0/.style={string type,column name={}},
columns/1/.style={string type,column name={}},
every head row/.style={
before row={\toprule\addlinespace},
after row=\bottomrule\addlinespace},
every last row/.style={after row=\bottomrule}
]{data.csv}
\end{footnotesize}
\label{table}
\end{table*}
\begin{table*}[!htbp]
\centering
\caption{My table}
\begin{footnotesize}
\pgfplotstabletypeset[
assign column name/.style={/pgfplots/table/column name={\textbf{#1}}},
col sep=comma,
column type=,
begin table={\begin{tabularx}{.95\linewidth}{X c }},
end table={\end{tabularx}},
string type,
columns/0/.style={string type,column name={}},
columns/1/.style={string type,column name={}},
every head row/.style={
before row={\toprule\addlinespace},
after row=\bottomrule\addlinespace},
every last row/.style={after row=\bottomrule}
]{data.csv}
\end{footnotesize}
\label{table}
\end{table*}
\begin{table*}[!htbp]
\centering
\caption{My table}
\begin{footnotesize}
\pgfplotstabletypeset[
assign column name/.style={/pgfplots/table/column name={\textbf{#1}}},
col sep=comma,
column type=,
begin table={\begin{tabularx}{.95\linewidth}{X c }},
end table={\end{tabularx}},
string type,
columns/0/.style={string type,column name={}},
columns/1/.style={string type,column name={}},
every head row/.style={
before row={\toprule\addlinespace},
after row=\bottomrule\addlinespace},
every last row/.style={after row=\bottomrule}
]{data.csv}
\end{footnotesize}
\label{table}
\end{table*}
\begin{table*}[!htbp]
\centering
\caption{My table}
\begin{footnotesize}
\pgfplotstabletypeset[
assign column name/.style={/pgfplots/table/column name={\textbf{#1}}},
col sep=comma,
column type=,
begin table={\begin{tabularx}{.95\linewidth}{X c }},
end table={\end{tabularx}},
string type,
columns/0/.style={string type,column name={}},
columns/1/.style={string type,column name={}},
every head row/.style={
before row={\toprule\addlinespace},
after row=\bottomrule\addlinespace},
every last row/.style={after row=\bottomrule}
]{data.csv}
\end{footnotesize}
\label{table}
\end{table*}
\end{appendices}
\afterpage{\blankpage}
\end{document}
\documentclassback – marv Jan 06 '22 at 21:46\leftmark. However, this does not work with the starred commands such as\chapter*. Why are you not using the normal sectioning commands? – marv Jan 06 '22 at 21:59\pagestye{fancy}up to\fancyfootbefore\begin{appendicesfixes your problem. – marv Jan 06 '22 at 22:03\begin{appendices}because I have different appendices (Appendix A, B, C, D, E), and that code changes the header for each appendix "chapter"...I'm getting the feeling that I should be doing this differently, but I don't know how. – SP1 Jan 06 '22 at 22:12\pagestye{fancy}before\begin{appendices}, and now there's a header on the remaining pages, but it's the wrong one (it's from the "References" section above (not in the MWE)). – SP1 Jan 06 '22 at 22:22