[Tex/LaTex] Create an Appendix with sections for extra tables, and a Appendix with sections for demonstrations

appendicespreambletable of contents

I would like to include an "Annex" chapter named "Anexos", which would have several sections, in which extra tables would be exposed.

In addition, demonstrations would be included in an "Appendix" chapter, named "Apéndices", that would have also have several sections.

Here I show it:

enter image description here

Tables from Annex A and should be named as A.1, A.2, A.3. Tables form Annex B should be named as B.1, B.2, B.3 and so on.

Equations form Appendix A and B should be named A.1, A.2 … and B.1, B.2 … respectively.

Would it be a possible way to achieve this?

EDIT:

I have tried the answer posted in Adding appendix "chapters," without sections, in table of contents by @egreg.

Several problems appear.

So, having the code:

\documentclass[12pt,a4paper,twoside,openany]{report}
\usepackage[left=2.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm]{geometry}

\usepackage[toc,page]{appendix}

\begin{document}

\begin{appendices}
\addtocontents{toc}{\protect\setcounter{tocdepth}{1}}
\makeatletter
\addtocontents{toc}{%
\begingroup
\let\protect\l@chapter\protect\l@section
\let\protect\l@section\protect\l@subsection
}

\chapter{Demostración momento cuadrupolar}
\section{Q}

(All the info)

\addtocontents{toc}{\endgroup}
\end{appendices}
\end{document}

But, the result in the index is this:

enter image description here

The problem is that I would like to be said: Apéndices, instead of Appendices

First question: Could it be possible to change Appendices for Apéndices in the index ?

Second problem: The result is that the left page represented has also the word Appendices. Could it also be changed?

enter image description here

Third problem: As I said in the first image before the EDIT, I would like to include a "Annex" for extra tables and a "Appendix" for demonstrations.
The "Appendix" part has been achieved except for the two above problems.

Third question: So, how could the upper code be modified in order to include a Anexos part ?

Here is my preamble:

\documentclass[12pt,a4paper,twoside,openany]{report}
\usepackage[left=2.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm]{geometry}
\parindent 1 true cm
\usepackage{graphicx}
\usepackage{eufrak}
\usepackage[spanish]{babel}
\usepackage[latin1]{inputenc}  
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{float}
\usepackage{color}
\usepackage[longnamesfirst,super]{natbib} 
\setcitestyle{square}
\usepackage{fancyhdr}   
\pagestyle{fancy}                                        
\renewcommand{\chaptermark}[1]{\markboth{\thechapter .\ #1}{}}             
\renewcommand{\sectionmark}[1]{\markright{\thesection .\ #1}{}}
\lhead{\nouppercase}
\rhead{\nouppercase}
\fancyhead[LE]{{\sf \leftmark}}                             
\fancyhead[RE]{}
\fancyhead[RO]{{\sf \rightmark}}
\fancyhead[LO]{}                                                
\fancyfoot[LE,RO]{\thepage}                                           
\fancyfoot[CE,CO]{}                                                         
\renewcommand{\headrulewidth}{0.0pt}                                
\renewcommand{\baselinestretch}{1.25}
\usepackage{adjustbox}
\usepackage{enumerate}
\usepackage{courier}
\usepackage{caption}
\usepackage[version=3]{mhchem}
\usepackage{rotating}
\usepackage[percent]{overpic}
\captionsetup{font={small}}
\begin{document}

Thanks.

Best Answer

Redefine the relevant commands before starting an appendices environment:

\documentclass[12pt,a4paper,twoside,openany]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}

\usepackage[left=2.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm]{geometry}

\usepackage[toc,page]{appendix}

\begin{document}

\renewcommand{\appendixpagename}{Anexos}
\renewcommand{\appendixtocname}{Anexos}
\renewcommand{\appendixname}{Anexo}

\begin{appendices}
\addtocontents{toc}{\protect\setcounter{tocdepth}{2}}
\makeatletter
\addtocontents{toc}{%
\begingroup
\let\protect\l@chapter\protect\l@section
\let\protect\l@section\protect\l@subsection
}

\chapter{Demostración momento cuadrupolar}
\section{Q}

(All the info)

\addtocontents{toc}{\endgroup}
\end{appendices}

\renewcommand{\appendixpagename}{Ap\'endices}
\renewcommand{\appendixtocname}{Ap\'endices}
\renewcommand{\appendixname}{Ap\'endice}

\begin{appendices}
\setcounter{chapter}{0}
\addtocontents{toc}{\protect\setcounter{tocdepth}{2}}
\makeatletter
\addtocontents{toc}{%
\begingroup
\let\protect\l@chapter\protect\l@section
\let\protect\l@section\protect\l@subsection
}

\chapter{Demostración momento cuadrupolar}
\section{Q}

(All the info)

\addtocontents{toc}{\endgroup}
\end{appendices}

\end{document}

A better strategy, that avoids all that code in the document, is to define a new environment based on appendices:

\documentclass[12pt,a4paper,twoside,openany]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}

\usepackage[left=2.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm]{geometry}

\usepackage[toc,page]{appendix}

\makeatletter
\newenvironment{varappendices}[2]% #1 is the global name, #2 the single name
 {\renewcommand{\appendixpagename}{#1}%
  \renewcommand{\appendixtocname}{#1}%
  \renewcommand{\appendixname}{#2}%
  \addtocontents{toc}{\protect\setcounter{tocdepth}{2}}%
  \addtocontents{toc}{%
    \begingroup
    \let\protect\l@chapter\protect\l@section
    \let\protect\l@section\protect\l@subsection
  }%
  \appendices
  \setcounter{chapter}{0}}
 {\addtocontents{toc}{\endgroup}%
  \endappendices}
\makeatother

\begin{document}

\begin{varappendices}{Anexos}{Anexo}

\chapter{Demostración momento cuadrupolar}
\section{Q}

(All the info)

\chapter{Demostración momento cuadrupolar}
\section{Q}

(All the info)

\end{varappendices}

\begin{varappendices}{Ap\'endices}{Ap\'endice}

\chapter{Demostración momento cuadrupolar}
\section{Q}

(All the info)

\end{varappendices}

\end{document}