12

To Create a register of persons with biblatex seems to be much more complicate than I expected.

How can I create nice a register of persons semiautomatic with \ref?

I have 20 persons that should be mentioned in a document. The grouping and sorting is complicate to implement in LaTeX, but I could do that very easy by hand and LaTeX could manage links and backlinks for me.

At the moment I use a solution like How do I include all authors of cited works in an index of persons?. It works but it can not handle the manual grouping and sorting.

The final document with hyperlinks and backlinks should look like

The sample was prepared by \person[Mr.]{Miller}.
Register of Persons
===================
Prof. Dr. M. Miller, University of M (p. 4, 12)
Dr. A. Foobar, University of M (p. 5)

B. Foo, University of Z (p. 1)

Jonas Stein
  • 8,909
  • 1
    Have a look at the nameauth package. –  Nov 14 '12 at 07:26
  • nameauth is a good way to go (though I've only looked at the package, never used it). Another way to do it is with an index: as long as you put all your frequently names in macros and provide a 'general' name macro for one-off uses, it would not be hard to 'group' (i.e., sort) as you please. In the index approach, the xparse package will allow you to create pretty clever name+(conditional-)index macros pretty easily. See here for a related question. – jon Nov 14 '12 at 10:40
  • 1
    I could not find anything about hyperlinks nor an register in the manual of nameauth. – Jonas Stein Nov 14 '12 at 12:50

2 Answers2

9

You can achieve this using the glossaries package:

\documentclass{report}

\usepackage{datatool-base}% provides \DTLinitials
\usepackage[colorlinks]{hyperref}
\usepackage{glossaries}

% Syntax: \newperson{label}{title}{forenames}{surname}{affiliation}
\newcommand*{\newperson}[5]{%
  \newglossaryentry{#1}%
  {%
     name={#2\space\DTLinitials{#3}\space#4},
     sort={#5},% sort on affiliation
     description={#5},% affiliation
     text={#2\ #4},% title \space surname
     user1={#2},% title
     user2={#3},% forenames
     user3={#4}% surname
  }%
}

\let\Ptitle\glsuseri
\let\Pforenames\glsuserii
\let\Psurname\glsuseriii

\newglossarystyle{person}%
{%
   \glossarystyle{list}%
   \glsnogroupskiptrue
   \renewcommand*{\glossaryentryfield}[5]{%
    \item[]\glsentryitem{##1}\glstarget{##1}{##2},
       ##3 (p.~##5)}%
}%

\makeglossaries

\newperson{miller}{Prof.\ Dr.}{Marmaduke}{Miller}{University of M}
\newperson{foobar}{Dr.}{Aardvark}{Foobar}{University of M}
\newperson{foo}{Mr}{Bar}{Foo}{University of Z}

\begin{document}

The screwdriver was turned by \gls{miller}.
The hammer was whacked by \gls{foobar}.
\Gls{foo}['s] thumb throbbed.

\printglossary[title={Register of Persons},style=person]

\end{document}
Nicola Talbot
  • 41,153
3

Alas, nameauth will not do the forward referencing. It will respect the index entry links back to the pages in question.

Here is a MWE of what nameauth does generally accomplish. What you get is a focus on auto-formatting of names. The package is meant (mostly) for printed matter. Thanks, however, for this post. It gives me an idea for expansion of features at some point.

\documentclass[11pt]{article}
\usepackage{nameauth}
\usepackage{makeidx}
\usepackage[colorlinks]{hyperref}

\title{nameauth test}
\author{}
\date{}
\frenchspacing

\begin{nameauth}
  \<Miller & Prof. Dr. M. & Miller & >
  \<Foobar & Dr. A. & Foobar & >
  \<Foo & B. & Foo & >
\end{nameauth}

\TagName[Prof. Dr. M.]{Miller}{, University of M}
\TagName[Dr. A.]{Foobar}{, University of M}
\TagName[B.]{Foo}{, University of Z}

\makeindex

\begin{document}

\maketitle

\section{Section 1}

The screwdriver was turned by \LMiller.
Do you call him \SMiller[Martin] or just \Miller?
I liked \LMiller[Mr.]'s lectures.
Not so much those of \LFoobar.
I thought \LFoobar[Mr.] was a little disjointed in his presentation.
I hear the new up-and-comer is \LFoo.
Do you know \Foo{} like I know \Foo?

\clearpage

\section{Section 2}

The screwdriver was turned by \LMiller.
Do you call him \SMiller[Martin] or just \Miller?
I liked \LMiller[Mr.]'s lectures.
Not so much those of \LFoobar.
I thought \LFoobar[Mr.] was a little disjointed in his presentation.
I hear the new up-and-comer is \LFoo.
Do you know \Foo{} like I know \Foo?

\clearpage

\printindex

\end{document}
Werner
  • 603,163