| 1 |
% !TEX TS-program = LuaLaTeX-shell-escape |
| 2 |
\documentclass[ |
| 3 |
a4paper, |
| 4 |
]{article} |
| 5 |
|
| 6 |
\usepackage{genealogy-profiles.preamble} |
| 7 |
|
| 8 |
\title{Genealogical Profiles for \LaTeX} |
| 9 |
\author{Mikkel Eide Eriksen\\% |
| 10 |
\href{mailto:[email protected]}{\texttt{[email protected]}}} |
| 11 |
|
| 12 |
\begin{document} |
| 13 |
|
| 14 |
\maketitle |
| 15 |
|
| 16 |
\section*{Preface} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 17 |
|
| 18 |
This package enables the presenstation of individual \emph{profiles}, which may be useful for genealogical or local history treatises. |
| 19 |
|
| 20 |
Each profile is typeset using key/value-configurable environments, and a number of macros are provided to enable formatting, references, and floruit (lifespan) calculations. |
| 21 |
|
| 22 |
In order to provide an ergonomic interface for document authors, extra care has been taken to enable automatic and configurable parsing of names. |
| 23 |
|
| 24 |
Issues can be reported at\\\null\hfill\url{https://github.com/mikkelee/latex-genprofile/issues} |
| 25 |
|
| 26 |
%\begin{multicols}{2} |
| 27 |
%\begingroup |
| 28 |
%\hypersetup{pdfborder=0 0 0} |
| 29 |
%\makeatletter |
| 30 |
%\renewcommand{\tableofcontents}{\@starttoc{toc}} % no "Contents" heading |
| 31 |
%\makeatother |
| 32 |
%\tableofcontents |
| 33 |
%\endgroup |
| 34 |
%\end{multicols} |
| 35 |
|
| 36 |
\begin{figure} |
| 37 |
\begingroup |
| 38 |
\gprKeys{ |
| 39 |
name type = given and surname, |
| 40 |
surname style = \scshape, |
| 41 |
layout preset = tcolorbox, |
| 42 |
begin life events = \small, |
| 43 |
} |
| 44 |
\begin{gprProfile}{Wolfgang_Amadeus Mozart}[ |
| 45 |
birth = {1756-01-27}{Getreidegasse 9, Salzburg}, |
| 46 |
death = {1791-12-05}{Vienna} |
| 47 |
] |
| 48 |
Had a complex relationship with his rival \gprRef{Antonio Salieri}. |
| 49 |
\end{gprProfile} |
| 50 |
\begin{gprProfile}{Antonio Salieri}[ |
| 51 |
birth = {1750-08-18}{Legnago, Republic of Venice}, |
| 52 |
death = {1825-05-07}{Vienna} |
| 53 |
] |
| 54 |
Was falsely accused of poisoning \gprRef[WM1]{_ Mozart}. |
| 55 |
\end{gprProfile} |
| 56 |
\endgroup |
| 57 |
\end{figure} |
| 58 |
|
| 59 |
\clearpage |
| 60 |
\section{Configuration} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 61 |
|
| 62 |
The package is configured in the following manner: |
| 63 |
|
| 64 |
\begin{docCommand} |
| 65 |
{usepackage} |
| 66 |
{\brackets{genealogy-profiles}} |
| 67 |
|
| 68 |
Loads the package and sets some sensible defaults as further described in \cref{sec:genconf,sec:profopts}. |
| 69 |
|
| 70 |
\end{docCommand} |
| 71 |
|
| 72 |
\begin{docCommand} |
| 73 |
{gprKeys} |
| 74 |
{\marg{general options}} |
| 75 |
|
| 76 |
Can be used to set options globally (in the preamble) or locally (in a group). See \cref{sec:genconf} for possible keys/values. |
| 77 |
|
| 78 |
\end{docCommand} |
| 79 |
|
| 80 |
\section{Usage} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 81 |
|
| 82 |
\subsection{Environments} %--------------------------------------------------------------- |
| 83 |
|
| 84 |
|
| 85 |
\begin{docEnvironment} |
| 86 |
{gprProfile} |
| 87 |
{\oarg{profile options}\marg{full name}\oarg{life events}} |
| 88 |
|
| 89 |
Typesets its contents according to the configured layout (see \cref{sec:structure}). For possible profile options, see \cref{sec:profopts}. |
| 90 |
|
| 91 |
The \meta{full name} will be parsed according to the current \refKey{name part order} (see \cref{sec:nameparsing} for discussion) and styled according to \refKey{nameparts:style} etc. |
| 92 |
|
| 93 |
Each profile must have an \meta{id}, either supplied by the author via the \refKey{id} profile option key or automatically generated via the general \refKey{auto id} key (the latter being the default). |
| 94 |
|
| 95 |
The \refKey{life events} will be parsed as a database by the \refPkg{genealogytree} package. |
| 96 |
|
| 97 |
\end{docEnvironment} |
| 98 |
|
| 99 |
\begin{docEnvironment} |
| 100 |
{gprProfile*} |
| 101 |
{\marg{profile options}\oarg{life events}} |
| 102 |
|
| 103 |
The \refEnv*{gprProfile*} environment provides more control at the expense of convenience, by requiring the name part(s) be set explicitly as profile options. See \refKey{given name} etc. |
| 104 |
|
| 105 |
\end{docEnvironment} |
| 106 |
|
| 107 |
\clearpage |
| 108 |
\subsection{Commands} %------------------------------------------------------------------- |
| 109 |
|
| 110 |
\begin{docCommands}[ |
| 111 |
doc name = {gprName} |
| 112 |
] |
| 113 |
{ |
| 114 |
{ doc parameter = {\marg{name}}}, |
| 115 |
{ doc parameter = {\sarg\marg{name}}}, |
| 116 |
} |
| 117 |
|
| 118 |
Typesets a name, styled according to configured name styles (see \refKey{nameparts:style}), without attempting to link to a profile. |
| 119 |
|
| 120 |
The regular version adds the name to any configured indices, the starred version does not. |
| 121 |
|
| 122 |
\end{docCommands} |
| 123 |
|
| 124 |
|
| 125 |
\begin{docCommands}[ |
| 126 |
doc name = {gprRef} |
| 127 |
] |
| 128 |
{ |
| 129 |
{ doc parameter = {\oarg{id}\marg{name}}}, |
| 130 |
{ doc parameter = {\sarg\oarg{id}\marg{name}}}, |
| 131 |
} |
| 132 |
|
| 133 |
Typesets a reference to a profile according to \refKey{reference style}. |
| 134 |
|
| 135 |
The \meta{id} is optional, in case it is not known or available at the time of writing. However, if the name is unique to the document, the reference should automatically be recognized. |
| 136 |
|
| 137 |
If it is not possible for the package to identify the intended reference, either via \meta{id} or unique name, warnings will be emitted in the log as well as in the document (the latter can be configured via \refKey{unknown reference style}). |
| 138 |
|
| 139 |
When using an \meta{id}, the name parameter can be left empty, or alternatively be used to override the by-default displayed full name, eg. to change case to genitive, etc. |
| 140 |
|
| 141 |
The regular version adds the reference to configured indices, the starred version does not. |
| 142 |
|
| 143 |
When used inside a profile, the package will emit a warning if the referenced profile does not refer back to the originating profile, in order to allow the author to check referential integrity (if they so wish). |
| 144 |
|
| 145 |
These commands require two runs to account for forward references. |
| 146 |
\end{docCommands} |
| 147 |
|
| 148 |
|
| 149 |
\begin{docCommands}[ |
| 150 |
doc name = {gprLifeEvents} |
| 151 |
] |
| 152 |
{ |
| 153 |
{ doc parameter = {\marg{id}}}, |
| 154 |
{ doc parameter = {\sarg\marg{od}}}, |
| 155 |
} |
| 156 |
|
| 157 |
Typesets the stored \refKey{life events} for a given \meta{id}. |
| 158 |
|
| 159 |
Requires \refKey{life events storage} to be either \docValue{memory} or \docValue{file}. |
| 160 |
\end{docCommands} |
| 161 |
|
| 162 |
\begin{docCommand} |
| 163 |
{gprTreeContentInterpreter} |
| 164 |
{} |
| 165 |
|
| 166 |
This command is used with the \docAuxKey{content interpreter} key of \refPkg{genealogytree}. |
| 167 |
|
| 168 |
When used, it handles tree node content in the follow way: |
| 169 |
|
| 170 |
\begin{itemize} |
| 171 |
\item If the node content is wrapped in \marg{brackets}, it is interpreted as a profile \meta{id}, and the name and life events are passed to \refPkg{genealogytree} to typeset. |
| 172 |
|
| 173 |
\item If the node content is not wrapped, it is interpreted as a regular \refPkg{genealogytree} database, and will be typeset per its settings. |
| 174 |
\end{itemize} |
| 175 |
|
| 176 |
See example in \cref{sec:example:inter}. |
| 177 |
\end{docCommand} |
| 178 |
|
| 179 |
\subsection{Layout} %--------------------------------------------------------------------- |
| 180 |
|
| 181 |
\label{sec:structure} |
| 182 |
The typeset profiles are laid out according to the following structure. See also \refKey{layout preset}. |
| 183 |
|
| 184 |
\begin{enumerate} |
| 185 |
|
| 186 |
\item The contents of \refKey{begin profile} |
| 187 |
|
| 188 |
\item If \refKey{auto header} is \docValue*{true}: |
| 189 |
\begin{enumerate}[noitemsep] |
| 190 |
\item The contents of \refKey{begin header} |
| 191 |
\item The contents of \refKey{header format} |
| 192 |
\item The contents of \refKey{end header} |
| 193 |
\end{enumerate} |
| 194 |
|
| 195 |
\item If \refKey{include life events} is \docValue{before content}, and \refKey{life events} and/or \refCom{gprYear}(s) were used: |
| 196 |
\begin{enumerate}[noitemsep] |
| 197 |
\item The contents of \refKey{begin life events}. |
| 198 |
\item The events formatted according to the database format configured via the \refPkg{genealogytree} package. |
| 199 |
\item The contents of \refKey{end life events} |
| 200 |
\end{enumerate} |
| 201 |
|
| 202 |
\item The contents of \refKey{begin content} |
| 203 |
\item The content provided to the environment by the author. |
| 204 |
\item The contents of \refKey{end content} |
| 205 |
|
| 206 |
\item If \refKey{include life events} is \docValue{after content}, and \refKey{life events} and/or \refCom{gprYear}(s) were used: |
| 207 |
\begin{enumerate}[noitemsep] |
| 208 |
\item The contents of \refKey{begin life events}. |
| 209 |
\item The events formatted according to the database format configured via the \refPkg{genealogytree} package. |
| 210 |
\item The contents of \refKey{end life events} |
| 211 |
\end{enumerate} |
| 212 |
|
| 213 |
\item The contents of \refKey{end profile} |
| 214 |
|
| 215 |
\end{enumerate} |
| 216 |
|
| 217 |
|
| 218 |
\section{Names} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 219 |
|
| 220 |
\label{sec:nameparsing} |
| 221 |
Names are parsed according to the configured \refKey{name part order} (some presets are provided via \refKey{name type}), in a left-to-right evaluation. |
| 222 |
|
| 223 |
In order for single name parts to include multiple separate tokens (eg. multiple given names), underscores can be used to combine them. For example, \docValue*{Wolfgang\_Amadeus Mozart} will, with the default \docValue{given and surname} name type, be parsed as the given name(s) \docValue*{Wolfgang Amadeus} and the surname \docValue*{Mozart}. |
| 224 |
|
| 225 |
If the \refKey{name part order} has more parts than the supplied value, the right-most parts will be empty. If this is not desired, one may mark empty name parts with a single underscore; for example, using the \docValue{nordic historical} name type, \docValue*{Jens _ Smed} will parse as the given name \docValue*{Jens}, no patronymic, and the byname \docValue*{Smed} (ie. blacksmith). |
| 226 |
|
| 227 |
Inside a profile environment, a number of shortcuts are provided to access the available name parts, as well as the \meta{id} and a full name styled according to the individual name part style keys (see \cref{sec:promac}). |
| 228 |
|
| 229 |
\clearpage |
| 230 |
\subsection{Creating and Using Name Parts} %---------------------------------------------- |
| 231 |
|
| 232 |
\begin{docCommand} |
| 233 |
{gprCreateNamePart} |
| 234 |
{\marg{name part}\oarg{macro name}} |
| 235 |
|
| 236 |
If the supplied default name part types are not sufficient, new types can be created. They must be included in the \refKey{name part order} to be properly recognized during name parsing and indexing. |
| 237 |
|
| 238 |
Creating a \meta{name part} results in: |
| 239 |
\begin{itemize} |
| 240 |
\item \refKey{nameparts:key} key in profile options for manually setting the name part in profiles. |
| 241 |
\item \refKey{nameparts:style} key in general options for styling the name part. |
| 242 |
\item \refKey{nameparts:index} key in general options for which index to use for the name part. |
| 243 |
\item \refCom{nameparts:macro} macro for typesetting the styled name part within a profile. |
| 244 |
\item \refCom{nameparts:macrostar} macro for typesetting the unstyled name part within a profile. |
| 245 |
\item \refCom{nameparts:macrostyle} macro for typesetting arbitrary text in the configured name part style. |
| 246 |
\end{itemize} |
| 247 |
|
| 248 |
By default, the generated commands will be CamelCased (eg. \docAuxKey*{given name} results in \docAuxCommand*{gprGivenName...}), but this can be overridden by supplying your own base name as the optional argument. |
| 249 |
|
| 250 |
The name parts \docAuxKey*{given name}, \docAuxKey*{patronymic}, \docAuxKey*{surname}, and \docAuxKey*{byname} have been pregenerated, along with their associated style/index keys and commands (see \cref{sec:promac,key:given name}). |
| 251 |
|
| 252 |
\end{docCommand} |
| 253 |
|
| 254 |
|
| 255 |
\section{Profile Macros} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 256 |
\label{sec:promac} |
| 257 |
|
| 258 |
A number of extra macros are available inside profiles to allow accessing some key values, as well as gather years for floruit calculations. |
| 259 |
|
| 260 |
\begin{docCommand} |
| 261 |
{gprHeader} |
| 262 |
{\brackets{}} |
| 263 |
|
| 264 |
A header styled according to \refKey{header format}. |
| 265 |
|
| 266 |
If \refKey{auto header} is \docValue*{false}, one may wish to use \refCom{gprHeader} to manually insert the header at the desired location (see \cref{sec:structure} for layout structure and \cref{sec:examples} for an example). |
| 267 |
|
| 268 |
\end{docCommand} |
| 269 |
|
| 270 |
|
| 271 |
\begin{docCommands}[ |
| 272 |
doc parameter = {\brackets{}} |
| 273 |
] |
| 274 |
{ |
| 275 |
{ doc name = gprID }, |
| 276 |
{ doc name = gprID* }, |
| 277 |
{ doc name = gprFullName }, |
| 278 |
{ doc name = gprFullName* } |
| 279 |
} |
| 280 |
|
| 281 |
Typesets the \meta{id} and full name according to configured styles (see \refKey{id style} and \refKey{nameparts:style}). The starred versions of the commands are unstyled. |
| 282 |
|
| 283 |
\end{docCommands} |
| 284 |
|
| 285 |
|
| 286 |
\begin{docCommands}[ |
| 287 |
doc parameter = {\brackets{}} |
| 288 |
] |
| 289 |
{ |
| 290 |
{ doc name = gprGivenName }, |
| 291 |
{ doc name = gprGivenName* }, |
| 292 |
{ doc name = gprPatronymic }, |
| 293 |
{ doc name = gprPatronymic* }, |
| 294 |
{ doc name = gprSurname }, |
| 295 |
{ doc name = gprSurname* }, |
| 296 |
{ doc name = gprByname }, |
| 297 |
{ doc name = gprByname* }, |
| 298 |
{ |
| 299 |
doc name = gpr\meta{NamePart}, |
| 300 |
doc label = nameparts:macro, |
| 301 |
} , |
| 302 |
{ |
| 303 |
doc name = gpr\meta{NamePart}*, |
| 304 |
doc label = nameparts:macrostar, |
| 305 |
} |
| 306 |
} |
| 307 |
|
| 308 |
Typesets individual name parts according to configured styles (see \refKey{nameparts:style}). The starred versions of the commands are unstyled. |
| 309 |
|
| 310 |
More can be created using \refCom{gprCreateNamePart}. |
| 311 |
\end{docCommands} |
| 312 |
|
| 313 |
|
| 314 |
\begin{docCommands}[ |
| 315 |
doc parameter = {\marg{text}} |
| 316 |
] |
| 317 |
{ |
| 318 |
{ doc name = gprIDStyle }, |
| 319 |
{ doc name = gprGivenNameStyle }, |
| 320 |
{ doc name = gprPatronymicStyle }, |
| 321 |
{ doc name = gprSurnameStyle }, |
| 322 |
{ doc name = gprBynameStyle }, |
| 323 |
{ |
| 324 |
doc name = gpr\meta{NamePart}Style, |
| 325 |
doc label = nameparts:macrostyle, |
| 326 |
}, |
| 327 |
} |
| 328 |
|
| 329 |
Styles given text according to the configured name style (see \refKey{nameparts:style}). |
| 330 |
|
| 331 |
More can be created using \refCom{gprCreateNamePart}. |
| 332 |
\end{docCommands} |
| 333 |
|
| 334 |
|
| 335 |
\begin{docCommands}[ |
| 336 |
doc name = {gprYear} |
| 337 |
] |
| 338 |
{ |
| 339 |
{ doc parameter = {\marg{year}}}, |
| 340 |
{ doc parameter = {\sarg\marg{year}}}, |
| 341 |
} |
| 342 |
|
| 343 |
All tagged years in a profile will be gathered and inserted as a \docValue*{floruit} range under \refKey{life events}, which will by default only be displayed if there is no defined lifespan (ie. birth or baptism \emph{and} death or burial). |
| 344 |
|
| 345 |
The starred version does not typeset anything, and can thus be used to add \enquote{hidden} years to the floruit event. |
| 346 |
|
| 347 |
These commands require two runs. |
| 348 |
\end{docCommands} |
| 349 |
|
| 350 |
|
| 351 |
\begin{docCommands}[ |
| 352 |
doc name = {gprYears} |
| 353 |
] |
| 354 |
{ |
| 355 |
{ doc parameter = {\marg{year range}}}, |
| 356 |
{ doc parameter = {\sarg\marg{year range}}}, |
| 357 |
} |
| 358 |
|
| 359 |
Adds two years to the \docValue*{floruit} event, by splitting at one or more hyphens. |
| 360 |
|
| 361 |
Values such as \docValue*{1750--1755} or \docValue*{1750--55} will both be parsed as the two years \docValue*{1750} and \docValue*{1755} and typeset as the expected 1750--1755 or 1750--55, respectively. |
| 362 |
|
| 363 |
Like \refCom{gprYear}, the starred version produces no output, and two runs are required. |
| 364 |
\end{docCommands} |
| 365 |
|
| 366 |
\section{Option Keys} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 367 |
|
| 368 |
\subsection{General Options} %------------------------------------------------------------ |
| 369 |
|
| 370 |
\label{sec:genconf} |
| 371 |
These are used with the \refCom{gprKeys} command, either globally in the preamble or locally in a group. |
| 372 |
|
| 373 |
\begin{docKey} |
| 374 |
{auto header} |
| 375 |
{=\meta{true/false}} |
| 376 |
{initially \docValue*{false}} |
| 377 |
|
| 378 |
Automatically inserts a header using \refKey{header format} at the beginning of profiles. See \cref{sec:structure}. |
| 379 |
\end{docKey} |
| 380 |
|
| 381 |
\begin{docKey} |
| 382 |
{auto id} |
| 383 |
{=\meta{true/false}} |
| 384 |
{initially \docValue*{true}} |
| 385 |
|
| 386 |
Automatically generates an \meta{id} for each profile if no \refKey{id} is supplied. They are built from the initials of each the name part (empty parts replaced by a dash) combined with a number to ensure uniqueness. |
| 387 |
|
| 388 |
If a profile has no \meta{id} set, whether automatically or manually, an error is emitted. |
| 389 |
\end{docKey} |
| 390 |
|
| 391 |
\begin{docKey} |
| 392 |
{auto id prefix} |
| 393 |
{=\meta{...}} |
| 394 |
{initially not set} |
| 395 |
|
| 396 |
Prefixes auto-generated \meta{id}s with a string, which may be useful for works containing multiple logically or temporally separate chapters or sections. |
| 397 |
\end{docKey} |
| 398 |
|
| 399 |
\begin{docKeys} |
| 400 |
[ |
| 401 |
doc parameter = {=\meta{...}}, |
| 402 |
doc description = {initially not set}, |
| 403 |
] |
| 404 |
{ |
| 405 |
{ |
| 406 |
doc name = begin profile, |
| 407 |
}, |
| 408 |
{ |
| 409 |
doc name = begin header, |
| 410 |
}, |
| 411 |
{ |
| 412 |
doc name = end header, |
| 413 |
}, |
| 414 |
{ |
| 415 |
doc name = begin life events, |
| 416 |
}, |
| 417 |
{ |
| 418 |
doc name = end life events, |
| 419 |
}, |
| 420 |
{ |
| 421 |
doc name = begin content, |
| 422 |
}, |
| 423 |
{ |
| 424 |
doc name = end content, |
| 425 |
}, |
| 426 |
{ |
| 427 |
doc name = end profile, |
| 428 |
}, |
| 429 |
} |
| 430 |
|
| 431 |
These keys allow configuring arbitrary \LaTeX{} code to be inserted before/during/after the typeset \refEnv{gprProfile} and \refEnv{gprProfile*} environments (see \cref{sec:structure} for layout structure). |
| 432 |
|
| 433 |
\end{docKeys} |
| 434 |
|
| 435 |
\begin{docKey} |
| 436 |
{clear name styles} |
| 437 |
{=\meta{true/false}} |
| 438 |
{initially not set} |
| 439 |
|
| 440 |
Clears all \refKey{nameparts:style} keys in the current \refKey{name part order}. |
| 441 |
\end{docKey} |
| 442 |
|
| 443 |
\begin{docKey} |
| 444 |
{header format} |
| 445 |
{=\meta{...}} |
| 446 |
{initially \brackets{\docValue*{\cs{gprFullName}\brackets{}\cs{hfill}\cs{gprID}\brackets{}}}} |
| 447 |
|
| 448 |
Formats a profile header, which will be available as \refCom{gprHeader}, and is automatically inserted if \refKey{auto header} is \docValue*{true}. See \cref{sec:promac} for available macros. |
| 449 |
\end{docKey} |
| 450 |
|
| 451 |
\begin{docKeys} |
| 452 |
[ |
| 453 |
doc parameter = {=\meta{...}}, |
| 454 |
doc description = {initially not set}, |
| 455 |
] |
| 456 |
{ |
| 457 |
{ |
| 458 |
doc name = id index, |
| 459 |
}, |
| 460 |
{ |
| 461 |
doc name = full name index, |
| 462 |
}, |
| 463 |
{ |
| 464 |
doc name = given name index, |
| 465 |
}, |
| 466 |
{ |
| 467 |
doc name = patronymic index, |
| 468 |
}, |
| 469 |
{ |
| 470 |
doc name = surname index, |
| 471 |
}, |
| 472 |
{ |
| 473 |
doc name = byname index, |
| 474 |
}, |
| 475 |
{ |
| 476 |
doc name = \meta{name part} index, |
| 477 |
doc label = nameparts:index, |
| 478 |
}, |
| 479 |
} |
| 480 |
|
| 481 |
Setting these keys will cause usage of \refEnv{gprProfile}, \refCom{gprName}, and \refCom{gprRef} to emit index data to the named index unless disabled using \refKey{no index}. The index must be created with eg. \texttt{imakeidx} before usage. |
| 482 |
|
| 483 |
Multiple keys can point to the same index. For example, you can use the same index for patronymics, surnames, and/or bynames --- which has in fact been configured for this document (see final page). |
| 484 |
|
| 485 |
At the end of the document, \docAuxCommand*{printindex} can then be used for each configured index as normal. |
| 486 |
|
| 487 |
More can be created using \refCom{gprCreateNamePart}. |
| 488 |
\end{docKeys} |
| 489 |
|
| 490 |
\begin{docKeys} |
| 491 |
[ |
| 492 |
doc parameter = {=\meta{...}}, |
| 493 |
doc description = {initially not set}, |
| 494 |
] |
| 495 |
{ |
| 496 |
{ |
| 497 |
doc name = id style, |
| 498 |
}, |
| 499 |
{ |
| 500 |
doc name = given name style, |
| 501 |
}, |
| 502 |
{ |
| 503 |
doc name = patronymic style, |
| 504 |
}, |
| 505 |
{ |
| 506 |
doc name = surname style, |
| 507 |
}, |
| 508 |
{ |
| 509 |
doc name = byname style, |
| 510 |
}, |
| 511 |
{ |
| 512 |
doc name = \meta{name part} style, |
| 513 |
doc label = nameparts:style, |
| 514 |
}, |
| 515 |
} |
| 516 |
|
| 517 |
These keys set the styling for the \meta{id} and name parts, which will be used when typesetting the name parts with the \refCom{nameparts:macro} commands, and can also be applied to arbitrary strings using the \refCom{nameparts:macrostyle} commands. |
| 518 |
|
| 519 |
The styled name parts will together be available as the \refCom{gprFullName}. |
| 520 |
|
| 521 |
More can be created using \refCom{gprCreateNamePart}. |
| 522 |
\end{docKeys} |
| 523 |
|
| 524 |
\begin{docKey} |
| 525 |
{id in index entries} |
| 526 |
{=\meta{true/false}} |
| 527 |
{initially not set} |
| 528 |
|
| 529 |
Causes index entries to include the \meta{id} in parentheses, which is especially useful in documents with profiles for several identically named persons. |
| 530 |
\end{docKey} |
| 531 |
|
| 532 |
\begin{docKeys} |
| 533 |
[ |
| 534 |
doc parameter = {=\meta{true/false}}, |
| 535 |
doc description = {initially not set}, |
| 536 |
] |
| 537 |
{ |
| 538 |
{ |
| 539 |
doc name = include unknown in index, |
| 540 |
}, |
| 541 |
{ |
| 542 |
doc name = include ambiguous in index, |
| 543 |
}, |
| 544 |
} |
| 545 |
|
| 546 |
Causes the indexes to include mentions (\refCom{gprRef} and \refCom{gprName}) of persons with unknown \meta{id}s or ambiguous names, which can be used for correcting drafts. |
| 547 |
|
| 548 |
\end{docKeys}\begin{docKey} |
| 549 |
{include life events} |
| 550 |
{=\meta{...}} |
| 551 |
{initially \docValue{before content}} |
| 552 |
|
| 553 |
\begin{itemize} |
| 554 |
\item \docValue{false}: Life events will not be automatically included in the typeset profiles. |
| 555 |
\item \docValue{before content}: Life events will be typeset before the main content of the profile (the default). |
| 556 |
\item \docValue{after content}: Life events will be typeset after the main content of the profile. |
| 557 |
\end{itemize} |
| 558 |
|
| 559 |
See \cref{sec:structure}. |
| 560 |
\end{docKey} |
| 561 |
|
| 562 |
\begin{docKey} |
| 563 |
{layout preset} |
| 564 |
{=\meta{...}} |
| 565 |
{initially not set} |
| 566 |
|
| 567 |
Sets a preconfigured layout style. Currently, two options are available: |
| 568 |
|
| 569 |
\begin{itemize} |
| 570 |
\item \docValue{clear} will blank out all the layout keys (see \refKey{begin profile} etc). |
| 571 |
|
| 572 |
\item \docValue{tcolorbox} sets the following keys: |
| 573 |
|
| 574 |
\begin{tcblisting}{listing only} |
| 575 |
\gprKeys{ |
| 576 |
auto header = false, |
| 577 |
begin profile = {\begin{tcolorbox}[title=\gprHeader]}, |
| 578 |
end life events = {\tcblower}, |
| 579 |
end profile = {\end{tcolorbox}} |
| 580 |
} |
| 581 |
\end{tcblisting} |
| 582 |
|
| 583 |
The box can be further configured via \docAuxCommand*{tcbset} as per the \refPkg{tcolorbox} documentation. |
| 584 |
|
| 585 |
\end{itemize} |
| 586 |
|
| 587 |
Suggestions for more presets are welcome. |
| 588 |
|
| 589 |
\end{docKey} |
| 590 |
|
| 591 |
\begin{docKey} |
| 592 |
{life events storage} |
| 593 |
{=\meta{...}} |
| 594 |
{initially \docValue{none}} |
| 595 |
|
| 596 |
Configures stored life events, enabling the use of \refCom{gprLifeEvents} and \refCom{gprTreeContentInterpreter}. |
| 597 |
|
| 598 |
\begin{itemize} |
| 599 |
\item \docValue{none}: Life events will not be stored (the default). |
| 600 |
|
| 601 |
\item \docValue{memory}: Life events will be stored in memory, meaning they can only be accessed after the profile has been typeset. |
| 602 |
|
| 603 |
\item \docValue{file}: Life events will be cached in the .aux file, enabling use anywhere in a document (requires two runs to ensure full sync). |
| 604 |
\end{itemize} |
| 605 |
\end{docKey} |
| 606 |
|
| 607 |
\begin{docKey} |
| 608 |
{main index entry style} |
| 609 |
{=\meta{...}} |
| 610 |
{initially not set} |
| 611 |
|
| 612 |
Adds formatting to the \enquote{main} index entry page numbers (ie. the ones pointing to the actual profile), leaving the ones that are merely referenced with \refCom{gprRef} untouched; for example \docValue*{textbf} will bold the main entry. |
| 613 |
\end{docKey} |
| 614 |
|
| 615 |
\begin{docKeys} |
| 616 |
[ |
| 617 |
doc parameter = {=\meta{...}}, |
| 618 |
] |
| 619 |
{ |
| 620 |
{ |
| 621 |
doc name = name part order, |
| 622 |
doc description = {initially \brackets{\docValue*{given name, surname}}} |
| 623 |
}, |
| 624 |
{ |
| 625 |
doc name = name type, |
| 626 |
doc description = {initially \docValue{given and surname}} |
| 627 |
}, |
| 628 |
} |
| 629 |
|
| 630 |
The \refKey*{name part order} is used for splitting a \refKey{full name} to its constituent parts for the configured styling, indexing, and autogenerated \meta{id}s (see \cref{sec:nameparsing}). |
| 631 |
|
| 632 |
New name parts must be created with \refCom{gprCreateNamePart} before inclusion in the name part order. |
| 633 |
|
| 634 |
Using the \refKey*{name type} key provides access to a number of preconfigured \refKey*{name part order}s: |
| 635 |
|
| 636 |
\begin{itemize} |
| 637 |
\item \docValue{given and surname} will set the \refKey*{name part order} key to \brackets{\docValue*{given name, surname}} (the default). |
| 638 |
\item \docValue{nordic historical} will set the \refKey*{name part order} key to \brackets{\docValue*{given name, patronymic, byname}}, which was traditionally used in Scandinavia and the rest of the nordic countries. |
| 639 |
\end{itemize} |
| 640 |
|
| 641 |
If no preset \refKey*{name type} exists for the intended use case, the \refKey*{name part order} can be set directly (suggestions for other \refKey*{name type}s are welcome). |
| 642 |
\end{docKeys} |
| 643 |
|
| 644 |
\begin{docKey} |
| 645 |
{nest index entries} |
| 646 |
{=\meta{true/false}} |
| 647 |
{initially not set} |
| 648 |
|
| 649 |
Causes index entries to be nested under the various patronymics/surnames/bynames. |
| 650 |
\end{docKey} |
| 651 |
|
| 652 |
\begin{docKey} |
| 653 |
{page reference style} |
| 654 |
{=\meta{...}} |
| 655 |
{initially \docValue*{p.\cs{nobreakspace}\#1}} |
| 656 |
|
| 657 |
Formats page references. The value is expanded with the argument \docValue*{\#1} being the page number. |
| 658 |
\end{docKey} |
| 659 |
|
| 660 |
\begin{docKey} |
| 661 |
{reference style} |
| 662 |
{=\meta{...}} |
| 663 |
{see below} |
| 664 |
|
| 665 |
Formats references to known profiles. The value is expanded with the arguments \docValue*{\#1} being the name, \docValue*{\#2} being the \meta{id}, and \docValue*{\#3} being the formatted page reference as per \refKey{page reference style}. |
| 666 |
|
| 667 |
The default is to present these as the name followed by combined super- and subscripts (see page 1 for the default, also \cref{sec:examples} for another style). |
| 668 |
|
| 669 |
The result is wrapped in a \refPkg{hyperref} link to the referenced profile. |
| 670 |
\end{docKey} |
| 671 |
|
| 672 |
\begin{docKey} |
| 673 |
{unknown reference style} |
| 674 |
{=\meta{...}} |
| 675 |
{see below} |
| 676 |
|
| 677 |
Formats references to unknown profiles. The value is expanded with the arguments \docValue*{\#1} being the supplied name, and \docValue*{\#2} being a short description of the reason. |
| 678 |
|
| 679 |
The default is to present the name as red text with the reason (unknown/ambiguous) following in parentheses. |
| 680 |
|
| 681 |
Note that forward references will appear unknown on the first run. |
| 682 |
\end{docKey} |
| 683 |
|
| 684 |
\begin{docKey} |
| 685 |
{use styles in index} |
| 686 |
{=\meta{true/false}} |
| 687 |
{initially not set} |
| 688 |
|
| 689 |
Causes index entries to be styled according to the various \refKey{nameparts:style} keys. |
| 690 |
|
| 691 |
The index at the end of this file shows it in use. |
| 692 |
\end{docKey} |
| 693 |
|
| 694 |
|
| 695 |
\subsection{Profile Options} %------------------------------------------------------------ |
| 696 |
|
| 697 |
\label{sec:profopts} |
| 698 |
These are used in the first argument of the \refEnv{gprProfile} and \refEnv{gprProfile*} environments. |
| 699 |
|
| 700 |
\begin{docKey} |
| 701 |
{id} |
| 702 |
{=\meta{...}} |
| 703 |
{initially not set} |
| 704 |
|
| 705 |
Sets an \meta{id} for the profile. If none is specified and \refKey{auto id} is \docValue*{true}, one will be generated from name initials combined with a number to ensure uniqueness. |
| 706 |
|
| 707 |
Not specifying an \meta{id} while \refKey{auto id} is \docValue*{false} will cause an error. |
| 708 |
|
| 709 |
Likewise, if an already used \meta{id} is specified, an error will be emitted. |
| 710 |
\end{docKey} |
| 711 |
|
| 712 |
\begin{docKey} |
| 713 |
{full name} |
| 714 |
{=\marg{...}} |
| 715 |
{initially not set} |
| 716 |
|
| 717 |
Sets the full name of the person. If it is specified, the configured \refKey{name part order} will be used to determine the individual name parts. |
| 718 |
|
| 719 |
If it is not specified, one will be generated by combining the given name parts according to the configured \refKey{name part order}, using the below keys. See \cref{sec:nameparsing} for further details. |
| 720 |
|
| 721 |
This key is set by the mandatory argument of \refEnv{gprProfile}. In the starred version of the environment, either the \refKey{full name} or individual \refKey{nameparts:key} keys must be set. |
| 722 |
\end{docKey} |
| 723 |
|
| 724 |
\clearpage |
| 725 |
\begin{docKeys} |
| 726 |
[ |
| 727 |
doc parameter = {=\meta{...}}, |
| 728 |
doc description = {initially not set}, |
| 729 |
] |
| 730 |
{ |
| 731 |
{ |
| 732 |
doc name = given name, |
| 733 |
}, |
| 734 |
{ |
| 735 |
doc name = patronymic, |
| 736 |
}, |
| 737 |
{ |
| 738 |
doc name = surname, |
| 739 |
}, |
| 740 |
{ |
| 741 |
doc name = byname, |
| 742 |
}, |
| 743 |
{ |
| 744 |
doc name = \meta{name part}, |
| 745 |
doc label = nameparts:key, |
| 746 |
}, |
| 747 |
} |
| 748 |
|
| 749 |
Sets individual name parts, to be used with \refEnv{gprProfile*}, if one prefers not to use the auto-parsing of \refEnv{gprProfile}. |
| 750 |
|
| 751 |
More name parts can be created using \refCom{gprCreateNamePart}. |
| 752 |
\end{docKeys} |
| 753 |
|
| 754 |
\begin{docKey} |
| 755 |
{life events} |
| 756 |
{=\meta{...}} |
| 757 |
{initially not set} |
| 758 |
|
| 759 |
Populates a \refPkg{genealogytree} database, which will be typeset using \docAuxCommand{gtrPrintDatabase}, according to the settings of that package; refer to its documentation for configuration. |
| 760 |
|
| 761 |
The default provided by \texttt{genealogy-profiles} simply lists life events separated by commas, skipping \docValue*{floruit} if there is a defined lifespan (ie. birth or baptism \emph{and} death or burial). Note that marriage is not included in the default, but can be enabled by changing the \refPkg{genealogytree} \docAuxKey{database format} key. |
| 762 |
|
| 763 |
For convenience, this key can be set with the final optional argument of the \refEnv{gprProfile} and \refEnv{gprProfile*} environments. |
| 764 |
|
| 765 |
See also \refKey{life events storage}, \refCom{gprLifeEvents}, and \refCom{gprTreeContentInterpreter}. |
| 766 |
\end{docKey} |
| 767 |
|
| 768 |
\begin{docKey} |
| 769 |
{no index} |
| 770 |
{=\meta{true/false}} |
| 771 |
{initially not set} |
| 772 |
|
| 773 |
If set, no index entries will be emitted for this profile. |
| 774 |
\end{docKey} |
| 775 |
|
| 776 |
\clearpage |
| 777 |
\section{Examples} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 778 |
|
| 779 |
\label{sec:examples} |
| 780 |
|
| 781 |
\subsection{Using \docValue*{tcolorbox} \& \docValue*{nordic historical}} |
| 782 |
|
| 783 |
A simple example to show name parsing and use of \refCom{gprRef} and \refCom{gprYear}. |
| 784 |
\begin{dispExample} |
| 785 |
\gprKeys{ |
| 786 |
name type = nordic historical, |
| 787 |
patronymic style = \itshape, |
| 788 |
byname style = \scshape, |
| 789 |
layout preset = tcolorbox, |
| 790 |
} |
| 791 |
|
| 792 |
\begin{gprProfile}{Jens Hansen}[ birth = {1790}{Denmark} ] |
| 793 |
Wife: \gprRef{Anne_Marie Olsdatter}. |
| 794 |
|
| 795 |
Let's also tag some years: |
| 796 |
\gprName{Jens} is mentioned in the censuses of |
| 797 |
\gprYear{1801}, \gprYear{1834}, and \gprYear{1840}. |
| 798 |
\end{gprProfile} |
| 799 |
|
| 800 |
\begin{gprProfile}{Anne_Marie Olsdatter}[ birth = {1795}{Denmark} ] |
| 801 |
Husband: \gprRef{Jens Hansen}. |
| 802 |
\end{gprProfile} |
| 803 |
|
| 804 |
\begin{gprProfile}{Jens Hansen Smed} |
| 805 |
An unrelated person with a byname. |
| 806 |
|
| 807 |
Not to be confused with \gprName{Jens _ Smed} of Neighbouring Town. |
| 808 |
\end{gprProfile} |
| 809 |
|
| 810 |
\end{dispExample} |
| 811 |
|
| 812 |
\clearpage |
| 813 |
\subsection{Using Custom Layout \& \docValue*{given and surname}} |
| 814 |
|
| 815 |
A simple example to show different layout and reference styles. |
| 816 |
|
| 817 |
\begin{dispExample} |
| 818 |
\newcommand\spacedrule{\vspace*{5pt}\hrule\vspace*{5pt}} |
| 819 |
\gprKeys{ |
| 820 |
name type = given and surname, |
| 821 |
surname style = \scshape, |
| 822 |
auto header, |
| 823 |
begin profile = \spacedrule, |
| 824 |
end life events = \spacedrule, |
| 825 |
end profile = {\spacedrule\vspace*{\baselineskip}}, |
| 826 |
reference style = {#1\footnote{#2,~#3}} |
| 827 |
} |
| 828 |
|
| 829 |
\begin{gprProfile}{George Washington}[ |
| 830 |
birth = {1732-02-22}{Popes Creek, Virginia Colony}, |
| 831 |
death = {1799-12-14}{Mount Vernon, Virginia, U.S.} |
| 832 |
] |
| 833 |
Attended the first \gprRef[WM1]{_ Mozart} performance |
| 834 |
in America in \gprYear{1784}. |
| 835 |
\end{gprProfile} |
| 836 |
|
| 837 |
This sentence demonstrates that references work even outside |
| 838 |
profiles: \gprRef[GW1]{_ Washington} was the first president |
| 839 |
of the United States. |
| 840 |
\end{dispExample} |
| 841 |
|
| 842 |
\clearpage |
| 843 |
\subsection{Using \refCom{gprTreeContentInterpreter}} |
| 844 |
|
| 845 |
A simple example to show the use of stored life events in a \refPkg{genealogytree}. This requires setting the \refKey{life events storage} key. |
| 846 |
\label{sec:example:inter} |
| 847 |
|
| 848 |
\begin{dispExample} |
| 849 |
\gprKeys{ |
| 850 |
name type = nordic historical, |
| 851 |
} |
| 852 |
\begin{tikzpicture} |
| 853 |
\genealogytree[ |
| 854 |
content interpreter=\gprTreeContentInterpreter, |
| 855 |
database format=full, |
| 856 |
node size=4cm, |
| 857 |
level size=1.25cm |
| 858 |
]{ |
| 859 |
child{ |
| 860 |
g{{JH-1}} |
| 861 |
p{{AO-1}} |
| 862 |
child{ |
| 863 |
g{ name = {Child 1}, birth- = {1820} } |
| 864 |
c{ name = {Grandchild}, birth- = {1845} } |
| 865 |
} |
| 866 |
c{ name = {Child 2}, birth- = {1825} } |
| 867 |
} |
| 868 |
} |
| 869 |
\end{tikzpicture} |
| 870 |
\end{dispExample} |
| 871 |
|
| 872 |
\clearpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 873 |
|
| 874 |
\small % because index format=off |
| 875 |
\printindex |
| 876 |
|
| 877 |
\clearpage |
| 878 |
\gprKeys{name type=nordic historical} |
| 879 |
\indexprologue{This index was created by setting the keys \docAuxKey*{patronymic index}, \docAuxKey*{surname index}, and \docAuxKey*{byname index} to identical values. Notice that \gprName{Jens Hansen Smed} is listed both under his patronymic \gprPatronymicStyle{Hansen} and his byname \gprBynameStyle{Smed}.} |
| 880 |
\printindex[gpr-surnames] |
| 881 |
|
| 882 |
\end{document} |