I believe there are many questions on this topic already answered. However, I tried all of them, but none of them worked with me. Perhaps someone can help me find the issue.
Currently, my TOC looks like this:
But, instead of "A" in the appendix, I want it to say "Appendix", like this
I tried this solution using Appendix package: https://stackoverflow.com/questions/5690679/add-appendix-before-a-in-thesis-toc But it does not work, it hangs when I compile it. Below you can see my code and all the packages that I'm using. Maybe some of them are conflicting.
%% document class
\documentclass[a4paper]{book}
\usepackage[table]{xcolor}
\usepackage[spanish,es-tabla]{babel}
\usepackage{ragged2e}
\usepackage[numbers]{natbib}
\usepackage{hyperref}
\usepackage{amssymb}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{longtable}
\usepackage{enumerate} % needed for some options in enumerate
\usepackage{makeidx} % needed for creating an index
\usepackage{blindtext}
\usepackage{amsmath}
\usepackage{bigstrut}
\usepackage{upgreek}
\usepackage{listings}
\usepackage{color}
\usepackage{graphicx}
\usepackage{array}
\usepackage{tikz}
\usepackage[nottoc]{tocbibind}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{pdfpages}
\usepackage{pdflscape}
\usepackage{titletoc}
\usepackage{appendix}
\titleformat*{\section}{\LARGE\bfseries}
\titleformat*{\subsection}{\Large\bfseries}
\titleformat*{\subsubsection}{\large\bfseries}
\titleformat*{\paragraph}{\large\bfseries}
\titleformat*{\subparagraph}{\large\bfseries}
\hypersetup{%
colorlinks=true,
citecolor=black,
linkcolor=black,
urlcolor=black}
\addto\captionsspanish{% Replace "english" with the language you use
\renewcommand{\contentsname}%
{Contenido}%
}
\newcommand\myhline{\noalign{\global\arrayrulewidth=1pt}\arrayrulecolor{white}\hline}
\arrayrulecolor{gray!80}
%% page settings
\input{settings/page}
%% own commands
\newcommand{\imp}[1]{\underline{\textit{#1}}}
\newcommand{\q}[1]{``#1''}
\input{settings/macros}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
My document, table of content, Chapters, Sections, etc
\bibliographystyle{ieeetran}
\bibliography{literature/library}
\begin{appendix}
\chapter{Just an example appendix}
\label{app_ex1}
\section{Section of appendix A}
\end{appendix}
\end{document}
hyperref
far later than it currently is being loaded. – Werner Dec 12 '18 at 8:01