I'm writing a family history, and I want to do something like this: for every person I have a chapter, and every person is identified by a unique code.
For example something like this:
\personChapter{John Doe}{1}
John Doe is born in 1900, lorem ipsum dolor sit amet, consectetur adipisci
elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua.
that produce this:
John Doe
John Doe is born in 1900, lorem ipsum dolor sit amet, consectetur adipisci elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua.
In another page I can write this:
\personChapter{Jennifer Doe}{23}
Jennifer Doe, born in 1920, is the daughter of \person{1}.
that produce this:
Jennifer Doe
Jennifer Doe, born in 1920, is the daughter of John Doe¹.
¹ See John Doe on page 46.
in which John Doe is a link to the John Doe page (in this example page 46).
If I want I can add only the link or only the footnote:
Jennifer Doe, born in 1920, is the daughter of \personLink{1}.
Jennifer Doe, born in 1920, is the daughter of \personFoot{1}.
I can also specify another name, for example this:
John Doe's \person{23}[daughter] is dead in 1990.
produce this:
John Doe's daughter¹ is dead in 1990.
¹ See Jennifer Doe on page 125.
in which daughter is a link to the Jennifer Doe page.
Furthermore, people can have multiple code, for example:
\personChapter{Jennifer Doe}{23}[JenniferDoe1920][JD20]
Then I can produce an index with all the people. For every person in the index, is linked the main page of that person:
\printPeopleIndex
Or, with another command, are linked all the pages in which they are cited:
\printPeopleAllRef
Is something like this possible?
I wrote these commands which partly do what I wrote above.
\newcommand{\personChapter}[2]
{
\chapter{#1}
\label{ch:#2}
}
\newcommand{\person}[1]
{
\nameref{ch:#1}
\footnote{See \nameref{ch:#1} on page \pageref{ch:#1} .}
}
\chapter
with\label
s and something likenameref
?\personChapter{Jennifer Doe}{23}