I need to produce a chapter index with latex code in document as follows:
\setcounter{tocdepth}{0}
\tableofcontents
I modified the example from other answer to set a table of contents by chapters in Spanish.
\documentclass{report}
%
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{titletoc}% http://ctan.org/pkg/titletoc
\usepackage[ linkbordercolor={1 1 1} ,
urlbordercolor={1 1 1} ]{hyperref}
\usepackage{bookmark}
\bookmarksetup{
open,
numbered,
addtohook={%
\ifnum\bookmarkget{level}>2 %
\renewcommand*{\numberline}[1]{}%
\fi
},
}
% \usepackage[spanish]{babel} % Ortografía
\usepackage[utf8]{inputenc} % Permite acentos
\begin{document}
\setcounter{tocdepth}{0}
\tableofcontents
\chapter{Introduction}
\lipsum[1]
\section{First section} \lipsum[2-3]
\section{Second section} \lipsum[4-5]
\section{Last section} \lipsum[6-7]
\chapter{Second chapter} \lipsum[1]
\section{First section} \lipsum[2-3]
\section{Second section} \lipsum[4-5]
\section{Last section} \lipsum[6-7]
\chapter{Last chapter} \lipsum[1]
\section{First section} \lipsum[2-3]
\section{Second section} \lipsum[4-5]
\section{Last section} \lipsum[6-7]
\end{document}
I comented the Spanish babel call
% \usepackage[spanish]{babel} % Ortografía
and is working well. But when I turn spanish on, no index is made.
First error says
Missing \endcsname inserted \lipsum1
But I have many errors by line in the same code!
Of course, I am writing Spanish text, but errors are everywehere...
What should I modify?
Regards
lipsumhad a bug, but it seems to be fixed. – Javier Bezos Jul 10 '16 at 07:10