I am writing my dissertation in yathesis
class and want to produce multiple indexes with imakeindex
package. I have been able to produce two indexes: an index of names with title subentries, and an index of titles organized by year. From there, I cannot produce is an index of author's names (removing titles).
Would someone know how I can get an index of names only?
If possible, with the surname of the author followed by the first letter of his first name in parenthesis. Like that: Skocpol (T.),
Many thanks !
Here is the MWE:
\documentclass[12pt]{yathesis}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{lipsum}
\usepackage{imakeidx}
\usepackage[main=french]{babel}
\usepackage{csquotes}
\usepackage[indexing=cite,style=authortitle,autolang=hyphen,backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}
\makeindex
\makeindex[name=name-title,title={Name and Title Index}]
\makeindex[name=year-title,title={Year and Title Index}]
\makeatletter
\@ifpackageloaded{biblatex_legacy}
{\DeclareIndexNameFormat{name:title}{%
\iffieldundef{title}
{\usebibmacro{index:name}{\index[name-title]}{#1}{#3}{#5}{#7}}
{\usebibmacro{index:name:title}{\index[name-title]}{#1}{#3}{#5}{#7}}}}
{\DeclareIndexNameFormat{name:title}{%
\iffieldundef{title}
{\usebibmacro{index:name}{\index[name-title]}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{index:name:title}{\index[name-title]}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}}}
\makeatother
\DeclareIndexFieldFormat{with:year}{%
\iffieldundef{year}
{\usebibmacro{index:entry}{\index[year-title]}{%
\mkbibindexentry{0}{Not dated}%
\subentryoperator%
\mkbibindexfield{\thefield{indexsorttitle}}{\emph{#1}}}}
{\usebibmacro{index:entry}{\index[year-title]}{%
\thefield{year}\subentryoperator%
\mkbibindexfield{\thefield{indexsorttitle}}{\emph{#1}}}}}
\renewbibmacro*{citeindex}{%
\ifciteindex
{\indexnames[name:title]{labelname}%
\indexfield[with:year]{indextitle}}
{}}
\begin{document}
\mainmatter
Here is some text avec un ballon\index{ballon}
\autocite{knuth:ct,knuth:ct:a,knuth:ct:c,knuth:ct:d}
\autocite{aristotle:anima,aristotle:poetics,aristotle:physics}
\backmatter
\clearpage
\printbibliography
\raggedright
\printindex
\printindex[name-title] % the name-title index
\printindex[year-title] % the year-title index
\end{document}