# How to add an academic title before the author name with \citeauthor?

In French legal citation, one is supposed to refer to "professor X" or "Dean Y" when referring to an author in a sentence. Using biblatex and Biber, this would mean that \citeauthor{key} should prepend the right academic title (if any) before each author.

The idea would be to have a separate database (in whatever form) specifying an author name and the title to prepend, and to have biblatex look in the database whenever \citeauthor is called. Ideally, one could add names to the database by using a latex command such as \addauthor{X}{Professor}. I am not interested in having a macro for "professor" and another one for "dean".

Thus, I would like to know if such a system could be implemented (i.e. whether it would be reasonably simple and efficient, given that \citeauthor is not the most widely used command), and how to implement it.

Edit

Following Daniel E. Shub's idea of using the nameaddon field, I figured out a Biber solution that seems to work properly, although it requires having two \citeauthor commands for capitalisation purposes.

In the biber.conf file, I wrote the following (with actual last names instead of X, Y, Z):

<map>
<map_step map_field_source="AUTHOR" map_match="X|Y" map_final="1"/>
</map>
<map>
<map_step map_field_source="AUTHOR" map_match="Z" map_final="1"/>
</map>


And I modified the \citeauthor macro as described by Daniel, with a \CiteAuthor variant that applies the \MakeCapital formatting (for start of sentence citations).

Not sure this is the most aesthetic way of doing it, though… and, as mentioned, it only works for single author references.

-

Multiple-author works can be handled by adding academic distinctions as name prefixes via the biber sourcemap option. This biber.conf file maps data in the author field to namea. Distinctions are added to namea in a series of map steps.

<?xml version="1.0" encoding="UTF-8"?>
<config>
<sourcemap>
<maps datatype="bibtex">
<map map_overwrite="1">
<map_step map_field_source="AUTHOR" map_final="1"/>
<map_step map_field_set="NAMEA" map_origfieldval="1"/>
<map_step map_field_source="NAMEA"
map_match="Knuth"
map_replace="le professeur honoraire Knuth"/>
<map_step map_field_source="NAMEA"
map_match="Sigfridsson"
map_replace="le docteur Sigfridsson"/>
<map_step map_field_source="NAMEA"
map_match="(Ryde|von Brandt|Bertram|Wentworth)"
map_replace="le professeur \$1"/>
<map_step map_field_source="NAMEA"
map_match="Erich Hoffmann"
map_replace="le professeur Hoffmann, Erich"/>
</map>
</maps>
</sourcemap>
</config>


Note that any author names following the <firstname lastname> format in the bib file need to be normalized to <prefix lastname, firstname> so that the prefix is parsed correctly. The last map step above gives an example.

A variant of \citeauthor that prints the distinctions can be defined a few different ways. In the document below this command is just \citeauthor, but we locally append the \AtEveryCitekey hook with code that resets labelname to namea and toggles useprefix to true.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,maxcitenames=2]{biblatex}

\makeatletter
\newrobustcmd*{\citedistinctauthor}{%
\AtNextCite{%
\appto\blx@hook@citekey{%
\savename{namea}{\cbx@namea}%
\restorename{labelname}{\cbx@namea}%
\toggletrue{blx@useprefix}}}%
\citeauthor}
\makeatother

\newrobustcmd*{\Citedistinctauthor}{\bibsentence\citedistinctauthor}

\begin{document}
\subsection*{\ttfamily\textbackslash citedistinctauthor}
\Citedistinctauthor{sigfridsson,bertram} show that...
Moreover \citedistinctauthor{knuth:ct,brandt,aristotle:poetics} show that...
\subsection*{\ttfamily\textbackslash citeauthor}
\Citeauthor{sigfridsson,bertram} show that...
Moreover \citeauthor{knuth:ct,brandt,aristotle:poetics} show that...
\printbibliography
\end{document}


-
Thank you very much for your answer. This very much looks like a solution to my problem. –  ienissei Feb 20 '12 at 22:17
@ienissei You're welcome. map_match and map_replace support regular expressions. I didn't use any here, but they'd be handy if you have to normalize any author names. The biber manual gives some examples. –  Audrey Feb 20 '12 at 22:26
Yes, I saw the examples in the manual. Thank you for pointing them out. –  ienissei Feb 20 '12 at 22:35
@ienissei On second thought, regular expressions would be better when you have many authors with the same distinction. I edited the sample biber.conf to give an example. –  Audrey Feb 20 '12 at 22:58
Great! Makes much more sense than writing several lines. Thank you. –  ienissei Feb 21 '12 at 9:28

If you are only dealing with single author works then a logical place for this extra information might be the nameaddon field. While the description for this field is information to be printed after the author name, it is not used in any standard bibliography styles. You would then need to modify \citeauthor to use this information.

Something like this:

\documentclass{article}
\usepackage[backend = biber]{biblatex}
\begin{filecontents}{\jobname.bib}
@Book{knuth,
author = "Donald E. Knuth",
title = "The {\TeX}book",
year = "1986",
}
\end{filecontents}

\DeclareCiteCommand{\citeauthor}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex
{\indexnames{labelname}}
{}%
{\multicitedelim}
{\usebibmacro{postnote}}

\begin{document}
The \TeX book is written by \citeauthor{knuth}.

\printbibliography
\end{document}

-
Good thinking, thanks. I will look into this, but the nameaddon would not be added automatically. There might be a biber solution, though, but my knowledge of it is not good enough at the moment… –  ienissei Feb 20 '12 at 12:04
@ienissei do you mean that the nameaddon would not be added to the bib file automatically? –  StrongBad Feb 20 '12 at 12:30
No, I mean that nameaddon would need to be added to each bibliographic entry separately, unless one writes a biber config file that automates it (I think it is possible, from the documentation, but I am not sure how to do it). –  ienissei Feb 20 '12 at 14:42
@ienissei creating the bib file with the nameaddon field seems like a one off thing. I am not sure LaTeX is the way to go for that. I would approach it with some scripting, sed and grep. –  StrongBad Feb 20 '12 at 16:36
I have edited my question accordingly, maybe you will see what I mean. I am waiting to see if anyone has another answer, but otherwise I think I can manage from here – just need to improve my code a bit. –  ienissei Feb 20 '12 at 17:10