# Create an Appendix with sections for extra tables, and a Appendix with sections for demonstrations

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:

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:

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}
\makeatletter
\begingroup
\let\protect\l@chapter\protect\l@section
\let\protect\l@section\protect\l@subsection
}

\section{Q}

(All the info)

\end{appendices}
\end{document}


But, the result in the index is this:

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?

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}{}}
\fancyfoot[LE,RO]{\thepage}
\fancyfoot[CE,CO]{}
\renewcommand{\baselinestretch}{1.25}
\usepackage{enumerate}
\usepackage{courier}
\usepackage{caption}
\usepackage[version=3]{mhchem}
\usepackage{rotating}
\usepackage[percent]{overpic}
\captionsetup{font={small}}
\begin{document}


Thanks.

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}
\makeatletter
\begingroup
\let\protect\l@chapter\protect\l@section
\let\protect\l@section\protect\l@subsection
}

\section{Q}

(All the info)

\end{appendices}

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

\begin{appendices}
\setcounter{chapter}{0}
\makeatletter
\begingroup
\let\protect\l@chapter\protect\l@section
\let\protect\l@section\protect\l@subsection
}

\section{Q}

(All the info)

\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}%
\begingroup
\let\protect\l@chapter\protect\l@section
\let\protect\l@section\protect\l@subsection
}%
\appendices
\setcounter{chapter}{0}}
\endappendices}
\makeatother

\begin{document}

\begin{varappendices}{Anexos}{Anexo}

\section{Q}

(All the info)

\section{Q}

(All the info)

\end{varappendices}

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


• @DavidC. I have fixed it, adding also the redefinition of \appendixtocname – egreg Jun 29 '14 at 23:02
• Change \setcounter{tocdepth}{1} to \setcounter{tocdepth}{2} (I changed it in the code) – egreg Jun 30 '14 at 14:28