I'm writing my thesis and Appendices have to say “Anexo” before chapter letter. I tried using \usepackage[titletoc]{appendix}
, but it didn't work. Also tried to comment command from titlesec and titletoc, but even with this I couldn't make it work.
Here is my MWE:
\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel} % pone el idioma en español
\usepackage[titletoc]{appendix}
\renewcommand{\appendixname}{Anexos}
\addto\captionsspanish{\renewcommand{\appendixname}{Anexo}}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\large\bfseries\centering}{\MakeUppercase\chaptertitlename\ \thechapter}{1em}{\MakeUppercase}{} % Cambios en Capitulo
\titleformat{\section}{\large\bfseries}{\thesection.}{1em}{}
\usepackage{titletoc}
\titlecontents{chapter}[0em]
{\vspace{0em}}
{\normalfont\normalsize\contentslabel[\thecontentslabel.]{2em}\uppercase}
{\hspace*{-2em}\uppercase}
{\titlerule*[.75em]{.}\contentspage}
\titlecontents{section}[2em]
{\vspace{0em}}
{\normalfont\normalsize\contentslabel[\thecontentslabel.]{2em}}
{\hspace*{-2em}}
{\titlerule*[.75em]{.}\contentspage}
\usepackage[]{hyperref} % Opción para que aparesca el indice en el pdf
\begin{document}
\tableofcontents
\chapter{text}
\section{text}
\appendix
\chapter{text}
\end{document}
The output is shown in the picture, and I need to print "Anexo A":
Edit 1: I tried adding some code to manually add "Anexo #:" to the titletoc code, without good results:
\appendix
\titlecontents{chapter}[0em]
{\vspace{0em}}
{\normalfont\normalsize\contentslabel[Anexo \thecontentslabel:]{2em}\uppercase}
{\hspace*{-2em}\uppercase}
{\titlerule*[.75em]{.}\contentspage}
\chapter{text}
\chapter{text}
The result:
Is there a way to move the chapter title to the right, to make this solution viable?
\chapapp
instead of\chaptername
and/or\appendixname
.titlesec
. (Haven't really experimented withtitletoc
.)