Added toc w/o numbering and moved other indices to end

This commit is contained in:
Carlos Galindo 2019-03-20 11:20:59 +01:00
parent 076d679139
commit 5703b60ced
Signed by: kauron
GPG key ID: 83E68706DEE119A3
3 changed files with 32 additions and 25 deletions

View file

@ -18,6 +18,8 @@
\RequirePackage[final]{pdfpages}
% Para la nota musical
\RequirePackage{textcomp}
% Para el indice general (secuencial)
\RequirePackage{tocloft}
% Para que las páginas no tengan cabecera ni pie de página (numeración y capítulo actual)
\pagestyle{empty}
@ -40,8 +42,24 @@
% Añade un nuevo campo a las canciones para mostrar en qué melodía están basadas
\newsongkey{m}{\def\melody{}}{\def\melody{\textmusicalnote #1\par}}
% Modifica el preludio (cabecera) de cada canción para incluir melody
% Añade un nuevo campo para definir el índice (toc={...})
\newcommand\toctitle{}
\newcommand\toclink{}
{\makeatletter\gdef\toclink{\@ifundefined{href}{}{{song\theSB@songsnum-\thesongnum
.\ifnum\value{section}=0 1\else2\fi}}}}
\newcommand\addtotoc[1]{\addtocontents{toc}{\protect\contentsline
{\ifnum\value{section}>0sub\fi section}{\numberline\thesongnum#1}{\thepage}\toclink}}
\newsongkey{toc}
{\def\toctitle{\resettitles\addtotoc\songtitle}}
{\def\toctitle{\addtotoc{#1}}}
% Modifica el preludio (cabecera) de cada canción para incluir melody y toctitle
\renewcommand{\extendprelude}{
\showrefs\showauthors
\melody
}
\melody\toctitle
}
% En la tabla de contenidos, evita que aparezca el número de página (innecesario)
\cftpagenumbersoff{chapter}
\cftpagenumbersoff{section}
\cftpagenumbersoff{subsection}