I'm having a little problem with the appendices environment that probably is very easy to solve, but for the life of me I haven't been able to figure it out. Here is the deal, I need to add appendices to a document and in order for this part to be in the same style as the entire document, I need for the appendices first page to have a header. Right now it just produces the title "Apéndice" (in spanish on purpose) and the page number, but not the header that the rest of the document has, i.e., the page number and the chapter title. Basically I want the appendix page to have a header with the word "Apéndice" in it like the rest of the document and I only get the number. Any ideas???

PD: Just to clarify, the rest of the appendix is working fine. It's just the first page.

Here is a short version of the LaTeX code I have.

\documentclass[english, a4paper, 12pt, openany, twoside]{book}
\usepackage{textcomp}
\usepackage[T1]{fontenc, url}
\usepackage[utf8]{inputenc}
\usepackage{titlesec}
\setcounter{secnumdepth}{4}
\usepackage{multirow}
\usepackage{minted}
\usepackage{graphicx}
\usepackage{amsmath, amssymb, amsthm}
\usepackage{parskip}
\urlstyle{sf}
\usepackage{color}
\usepackage{subcaption}
\usepackage[toc,page]{appendix}
\usepackage{chngcntr}
\counterwithin{table}{section}
\counterwithin{figure}{section}
\numberwithin{equation}{section}
\hyphenpenalty=100000
\sloppy
\raggedbottom
\usepackage{xparse,nameref}
\usepackage[bottom]{footmisc}
\usepackage{lipsum}

% ----- Header and footer -----

\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot{}
}

\pagestyle{fancy}
\fancyfoot{}

%--- Document Begins---

\begin{document}

%-------------- index.
\newpage
{\setstretch{1.0} % interlineado de la lista.
\tableofcontents
}

\newpage

\newpage

some text and chapters

%------- Appendix page ----
\newpage
\renewcommand{\appendixpagename}{Apéndice} % Title in spanish
\renewcommand{\appendixtocname}{Apéndice} % title in spanish in TOC

\begin{appendices}
\subfile{Capitulos/Apendice} %calls appendix file
\end{appendices}

\end{document}


You could patch \@chap@pppage (command provided by package appendix for the appendix page):

\usepackage{xpatch}
\makeatletter
\xpatchcmd{\@chap@pppage}
{\markboth{}{}}
{\markboth{\appendixpagename}{\appendixpagename}}
{}{\PatchFailed}
\makeatother


Example (without the unrelated stuff):

\documentclass[a4paper,12pt,openany]{book}
\usepackage{blindtext}% only for dummy text in the example
\usepackage[T1]{fontenc}

\usepackage[toc,page]{appendix}
\renewcommand{\appendixpagename}{Apéndice}
\renewcommand{\appendixtocname}{Apéndice}

\usepackage{xpatch}
\makeatletter
\xpatchcmd{\@chap@pppage}
{\markboth{}{}}
{\markboth{\appendixpagename}{\appendixpagename}}
{}{\PatchFailed}
\makeatother

% ----- Header and footer -----
\usepackage{fancyhdr}
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot{}
}

\pagestyle{fancy}
\fancyfoot{}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\raggedbottom

\begin{document}
\tableofcontents
\blinddocument

\begin{appendices}
\blinddocument
\end{appendices}
\end{document}


Result: