0

Generating separate (author and subject) indexes with bibtex is very well documented. But how about generating those two indexes with BibLatex, I found no documentation.

victor
  • 705
  • One practical example is in http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/21-indexing-multiple.tex, but you can use other indexing tools than the one described there. – moewe Sep 08 '19 at 03:28
  • There is also http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/22-indexing-subentry.tex for imakeidx. Furthermore you may be interested in https://tex.stackexchange.com/q/111291/35864, https://tex.stackexchange.com/q/121451/35864, https://tex.stackexchange.com/q/397781/35864 – moewe Sep 08 '19 at 03:39
  • Did any of the linked resources help you? Could you find a way to do what you want and would be willing to post an answer yourself so people can benefit from it was well? If the links didn't help, what did you try and how/why did it not work for you? – moewe Sep 12 '19 at 06:21

2 Answers2

2

biblatex comes with several example files, three of them concerned with indexing.

Those files not only contain example code, but also extensive explanatory comments.

Here is a simplified version of 21-indexing-multiple.tex that uses imakeidx (as 22-indexing-subentry.tex).

The key is that one needs to define the standard biblatex indexing (bib)macros to call \index with an optional argument to specify into which index the entry should go.

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[american]{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=authoryear, indexing]{biblatex}
\addbibresource{biblatex-examples.bib}

\usepackage{imakeidx}
\makeindex
\makeindex[name=names,title={Names}]
\makeindex[name=titles,title={Titles}]

\DeclareIndexNameFormat{default}{%
  \usebibmacro{index:name}{\index[names]}
   {\namepartfamily}
   {\namepartgiven}
   {\namepartprefix}
   {\namepartsuffix}}


\DeclareIndexFieldFormat{indextitle}{%
  \usebibmacro{index:title}{\index[titles]}{#1}%
}

\begin{document}
\cite{sigfridsson,worman,nussbaum,geer,pines}

\index{Example entry}

\printbibliography
\printindex
\printindex[names]
\printindex[titles]
\end{document}

Index of Names

Index of Titles

moewe
  • 175,683
0

Thanks, here is an MMWE that creates the two distinct indexes (authors and subjects)

\documentclass{article}
    \begin{filecontents}{my.bib}
    @article{sanchez16,
      title={Use of Damage Rating Index to Quantify Alkali-Silica Reaction Damage in Concrete: Fine versus Coarse Aggregate.},
      author={Sanchez, L. and Fournier, B. and Jolin, M. and Bedoya, M. and Bastien, J. and Duchesne, J.},
      journal={ACI Materials Journal},
      volume={113},
      number={4},
      year={2016}
    }
    \end{filecontents}
    \usepackage{csquotes}
    \usepackage[style=numeric,natbib=true,backend=bibtex,sorting=nyt,refsegment=section,defernumbers=true,maxnames=4,indexing=cite
    ]{biblatex}
    \addbibresource{my.bib}
    \usepackage{imakeidx}
    \makeindex
    \makeindex[name=names,title={Names}]
    \DeclareIndexNameFormat{default}{%
      \usebibmacro{index:name}{\index[names]}
       {\namepartfamily}
       {\namepartgiven}
       {\namepartprefix}
       {\namepartsuffix}}
    \renewbibmacro*{citeindex}{%
      \ifciteindex
        {\indexnames{labelname}}
        {}}
    %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    \begin{document}
    \citet{sanchez16} have shown    \index{Damage Rating}
    \printbibliography
    \printindex
    \printindex[names]
    \end{document}
victor
  • 705