5

I need two indices: one of names, one of concepts.

I'm using biblatex with indexing (and TeXshop on a mac, I am a newbie of LaTeX, so sorry for any stupid question). This works fine for the index of names, but I need to index also concepts.

Until now, I did with \index{concept1}. I get one index with both names and concepts. This was fine until my supervisor wanted two different indices.

Now, with the code below, I get only one index of things I manually indexed, but no more names from biblatex

\documentclass[12pt,a4paper,twoside,openright,titlepage,fleqn,%
headinclude,,footinclude,BCOR5mm,%
           numbers=noenddot,cleardoublepage=empty,%
           tablecaptionabove]{scrreprt}

\usepackage[style=philosophy-modern,indexing,hyperref,square,natbib,backref]{biblatex}

\usepackage{imakeidx}
\makeindex[name=title,title={List of Titles}]



\renewbibmacro*{citeindex}{%
\ifciteindex
{\indexnames{labelname}}%
{}}
\renewbibmacro*{bibindex}{%
\ifbibindex
{\indexnames{author}%
\indexnames{editor}%
\indexnames{editora}%
\indexnames{editorb}%
\indexnames{editorc}}%
{}}%
%\DeclareIndexFieldFormat{indextitle}{%
%\usebibmacro{index:title}{\index}{#1}}
%\DeclareIndexNameFormat{default}{%
%\usebibmacro{index:name}{\index[nomi]}{#1}{#3}{#5}{#7}}
\usepackage{index}
%\newindex{default}{idx}{ind}{Index}
%\newindex{nomi}{ndx}{nnd}{Index of Names}


\usepackage{makeidx} %\usepackage{imakeidx}
%\DeclareIndexFieldFormat{indextitle}{}{}{}


\usepackage[eulerchapternumbers,subfig,beramono,eulermath,pdfspacing,listings]{classicthesis} %minionpro parts
\usepackage{arsclassica}


\input{arsclassica-settings}

\makeindex%[program=xindy]

\begin{document}


\input{Chapters/hw}
 \index{normativity}

\printbibliography

\printindex
%\printindex[title]

\end{document}

I hope to have provided a MWS – I suspect I must run twice something I don't know.

6
  • 1
    Welcome to TeX.SX! I took the liberty of doing minor edits on your post; we like to mark our inline code here. You can use backticks ` to obtain the same result as in my edit.
    – Corentin
    Commented Jun 27, 2013 at 20:37
  • You surely cannot use both imakeidx and index.
    – egreg
    Commented Jun 27, 2013 at 22:49
  • 1
    Can you show the version with only one index that worked?
    – egreg
    Commented Jun 27, 2013 at 23:02
  • Example 21 from the biblatex documentation covers multiple indices (concept/subject, name, title) with the index package. The answer really depends on the indexing package you're using, so I'd meet egreg's request.
    – Audrey
    Commented Jun 28, 2013 at 3:24
  • Now there is the version with only one index working, both of names and of concepts.
    – Fedrîg
    Commented Jun 28, 2013 at 7:11

2 Answers 2

2

Example 21 from the biblatex documentation (21-indexing-multiple.tex) demonstrates how you can create separate subject, name and title indices using the index package. Here is another example using the imakeidx package. It compiles with the usual calls to latex and biber (or bibtex, if you load biblatex with backend=bibtex).

\documentclass[12pt,a4paper,twoside,openright,titlepage,fleqn,
  headinclude,footinclude,BCOR5mm,numbers=noenddot,cleardoublepage=empty,
  captions=tableheading]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage{imakeidx}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=philosophy-modern,indexing,hyperref,square,natbib,backref]{biblatex}
\usepackage{subfig}
\usepackage[eulerchapternumbers,subfig,beramono,eulermath,pdfspacing,
  listings]{classicthesis}
\usepackage{arsclassica}

\makeindex[title={Concept Index}]
\makeindex[name=name,title={Name Index}]
\makeindex[name=title,title={Title Index}]

\DeclareIndexNameFormat{default}{%
  \usebibmacro{index:name}{\index[name]}{#1}{#3}{#5}{#7}}

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

\renewbibmacro*{citeindex}{%
  \ifciteindex
    {\indexnames{labelname}%
     \indexfield{indextitle}}
    {}}

\renewbibmacro*{bibindex}{%
  \ifbibindex
    {\indexnames{author}%
     \indexnames{editor}%
     \indexnames{editora}%
     \indexnames{editorb}%
     \indexnames{editorc}%
     \indexfield{indextitle}}
    {}}

\addbibresource{biblatex-examples.bib}
\begin{document}
\nocite{*}
\cite{piccato,gaonkar,jaffe,malinowski,coleridge,gerhardt,cicero}
\index{Example concept index entry}
\printbibliography
\printindex
\printindex[name]
\printindex[title]
\end{document}
2
  • Thank you! It works now, but the last page of each index won't print, and the margins of odd/even pages are inverted. I get these kinds of errors: \begin{document} ended by \end{theindex} and \begin{document} ended by \end{multicols}
    – Fedrîg
    Commented Jun 28, 2013 at 22:14
  • @Fedrîg That is related to your document layout, not biblatex. I don't get any issues on my end when I use your document class, load subfig and your additional packages. So the problems must lie in the files you include with \input.
    – Audrey
    Commented Jun 29, 2013 at 0:56
1

The answer worked for me, though it needs to be updated as explained in Biblatex 3.3 name formatting:

In biblatex 3.3. the format of \DeclareNameFormat has changed. In its code part it no longer accepts 8 arguments, but only one. For the various parts of a name there are now macros which you get by splitting the main name data with \namepart.

I updated the MWE accordingly:

documentclass[12pt,a4paper,twoside,openright,titlepage,fleqn,
  headinclude,footinclude,BCOR5mm,numbers=noenddot,cleardoublepage=empty,
  captions=tableheading]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage{imakeidx}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=philosophy-modern,indexing,hyperref,square,natbib,backref]{biblatex}
\usepackage{subfig}
\usepackage[eulerchapternumbers,subfig,beramono,eulermath,pdfspacing,
  listings]{classicthesis}
\usepackage{arsclassica}

\makeindex[title={Concept Index}]
\makeindex[name=name,title={Name Index}]
\makeindex[name=title,title={Title Index}]

\DeclareIndexNameFormat{default}{%
  \usebibmacro{index:name}{\index[name]}%
  {\namepartfamily}% #1->\namepartfamily, #2->\namepartfamilyi
  {\namepartgiven}%  #3->\namepartgiven,  #4->\namepartgiveni
  {\namepartprefix}%  #5->\namepartprefix, #6->\namepartprefixi
  {\namepartsuffix}%   #7->\namepartsuffix, #8->\namepartsuffixi
  }   

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

\renewbibmacro*{citeindex}{%
  \ifciteindex
    {\indexnames{labelname}%
     \indexfield{indextitle}}
    {}}

\renewbibmacro*{bibindex}{%
  \ifbibindex
    {\indexnames{author}%
     \indexnames{editor}%
     \indexnames{editora}%
     \indexnames{editorb}%
     \indexnames{editorc}%
     \indexfield{indextitle}}
    {}}

\addbibresource{biblatex-examples.bib}
\begin{document}
\nocite{*}
\cite{piccato,gaonkar,jaffe,malinowski,coleridge,gerhardt,cicero}
\index{Example concept index entry}
\printbibliography
\printindex
\printindex[name]
\printindex[title]
\end{document}

As asked by Mensch, I add screenshots of the results:

The body of the text

The bibliography

Concept Index

Name Index

Title Index

2
  • 1
    Welcome to TeX.SE! Can you please add an screenshot of your resulting pdf?
    – Mensch
    Commented Sep 9, 2019 at 17:37
  • 1
    Many thanks! I added screenshots of the different sections, but it may be too much. Since the interest was in several things, how would you suggest presenting them?
    – manueltts
    Commented Sep 13, 2019 at 11:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .