2

I want to include all cited authors in the index, but with the biblabel and not with the pagenumber. I tried authorindex, but I want one index not two different. I also tried authorindex -i but makeindex doesn't like the option biblabels because the labels are not correct page numbers.

How do I get a single index (with \index{...} entries and the cited authors) including the cited authors with the corresponding bibtex labels?


Here is a MWE:

\begin{filecontents*}{\jobname.bib}
@BOOK{Cameron1994,
 AUTHOR = {Cameron, Peter Jephson},
 TITLE = {{Combinatorics}: {Topics}, {Techniques}, {Algorithms}},
 PUBLISHER = {Cambridge University Press},
 YEAR = {1994}
}
@ARTICLE{Cameron2008,
 AUTHOR = {Cameron, Peter Jephson and Gewurz, Daniele A. and Merola, Francesca},
 TITLE = {{Product} action},
 JOURNAL = {Discrete Math.},
 YEAR = {2008}
}
\end{filecontents*}

\documentclass{article}
\usepackage{makeidx}
\usepackage[biblabels]{authorindex}
\makeindex
\begin{document}
I \index{cite}cite something like \aicite{Cameron1994} and \aicite{Cameron2008}.
I want a \index{merged}merged index.

\bibliographystyle{alpha}
\bibliography{\jobname.bib}
\printindex
\printauthorindex
\end{document}

I compile with

pdflatex
bibtex
makeindex
authorindex
pdflatex
authorindex
pdflatex

I get two indices (one for \printindex and one for \printauthorindex): references

normal index

authorindex

but what I want is a merged index like merged index

To produce the last index I manipulated the *.ind file by hand.


I tried a solution by myself, but I failed: I used authorindex -i -p MWE >> MWE.idx to add the entries of the author index into the normal index. But I can not compile it with makeindex, because the "CGM08" (etc.) are not correct page numbers.

2
  • not sure to understand. You want something like \index{author1~\cite{author1}}?
    – pluton
    Commented Jul 3, 2013 at 18:18
  • Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Commented Jul 3, 2013 at 18:32

1 Answer 1

2

The following solution is more or less a hack. However it seems to work:

\begin{filecontents*}{\jobname.bib}
@BOOK{Cameron1994,
 AUTHOR = {Cameron, Peter Jephson},
 TITLE = {{Combinatorics}: {Topics}, {Techniques}, {Algorithms}},
 PUBLISHER = {Cambridge University Press},
 YEAR = {1994}
}
@ARTICLE{Cameron2008,
 AUTHOR = {Cameron, Peter Jephson and Gewurz, Daniele A. and Merola, Francesca},
 TITLE = {{Product} action},
 JOURNAL = {Discrete Math.},
 YEAR = {2008}
}
\end{filecontents*}

\documentclass{article}
\usepackage{makeidx}
\usepackage[biblabels]{authorindex}

\makeatletter
\def\gobble#1{}
\renewenvironment{theauthorindex}{%
\begingroup
  \let\indexspace\relax
  \def\item[##1]{\null\gdef\ItemIndex{##1}}
  \def\aipages##1{\index{\ItemIndex @{\ItemIndex~[##1]}\protect\gobble |gobble}}
}{\endgroup}
\makeatother

\makeindex
\begin{document}
I \index{cite}cite something like \aicite{Cameron1994} and \aicite{Cameron2008}.
I want a \index{merged}merged index.

\bibliographystyle{alpha}
\bibliography{\jobname.bib}
\printindex
\printauthorindex
\end{document}

After running the following compilation marathon twice:

% arara: pdflatex: { shell: true }
% arara: bibtex
% arara: authorindex
% arara: bibtex
% arara: pdflatex: { shell: true }
% arara: authorindex
% arara: makeindex
% arara: pdflatex: { shell: true }
% arara: pdflatex: { shell: true }

I get the following output:

enter image description here

6
  • I have a little problem with this solution. In the index I get, all biblabels are empty. For example there is only "Merola, Francesca []", the "CGM08" inside the "[]" is missing. The IDX before the makeindex looks like \indexentry{Merola, Francesca@{Merola, Francesca\nobreakspace {}[]}\gobble |gobble}{1}
    – Ivo
    Commented Jul 4, 2013 at 13:36
  • @Ivo: That's the reason I wrote marathon I had to do the shown compilation steps twice. Commented Jul 4, 2013 at 13:37
  • @Daniel: Thanks, I should read carefully. But why is there a separation between "Cameron ..." and "cite"?
    – Ivo
    Commented Jul 4, 2013 at 13:39
  • @Ivo: Good question. I don't know ;-) Commented Jul 4, 2013 at 13:46
  • 1
    @Daniel: I changed \protect\gobble to \protect\ignorespaces\protect\gobble. Know it works for me.
    – Ivo
    Commented Jul 4, 2013 at 14:51

You must log in to answer this question.

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