You may be interested in the nameauth
package for consistent formatting of names.
Here is something to get you started. You can ignore the first bit, it's just a copy of my answer to First citation with first name that improves slightly on Citing author's full name in biblatex the first time it appears and makes it compatible with biblatex
>= 3.3.
The second bit of code starting at \DeclareCiteCommand{\specialciteauthor}
creates a macro \<Lastname>
for each name encountered and associates it with an internal version of \citeauthor{<some entry key authored by name>}
.
\documentclass{article}
\usepackage[style=verbose-ibid]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{kpv,
author={Immanuel Kant},
title={Kritik der praktischen Vernunft}
}
@book{krv,
author={Immanuel Kant},
title={Kritik der reinen Vernunft}
}
@book{sz,
author={Martin Heidegger},
title={Sein und Zeit}
}
@book{sg,
author={Martin Heidegger},
title={Der Satz vom Grund}
}
@book{apphack,
author={Humprey Appleby and James Hacker},
title={On the Importance of the Civil Service}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\makeatletter
\newrobustcmd*{\cbx@nametracker@global}[1]{%
\xifinlistcs{#1}{cbx@bseen@names@\the\c@refsection}
{}
{\listcsxadd{cbx@bseen@names@\the\c@refsection}{#1}}}
\newrobustcmd*{\cbx@nametracker@context}[1]{%
\iftoggle{blx@footnote}
{\xifinlistcs{#1}{cbx@fseen@names@\the\c@refsection}
{}
{\listcsxadd{cbx@fseen@names@\the\c@refsection}{#1}}}
{\xifinlistcs{#1}{cbx@bseen@names@\the\c@refsection}
{}
{\listcsxadd{cbx@bseen@names@\the\c@refsection}{#1}}}}
\newrobustcmd*{\cbx@ifnameseen@global}[1]{%
\xifinlistcs{#1}{cbx@bseen@names@\the\c@refsection}}
\newrobustcmd*{\cbx@ifnameseen@context}[1]{%
\iftoggle{blx@footnote}%
{\xifinlistcs{#1}{cbx@fseen@names@\the\c@refsection}}%
{\xifinlistcs{#1}{cbx@bseen@names@\the\c@refsection}}}
\DeclareBibliographyOption[string]{nametracker}[true]{%
\ifcsdef{blx@opt@nametracker@#1}
{\csuse{blx@opt@nametracker@#1}}
{\blx@err@invopt{nametracker=#1}{}}}
\def\blx@opt@nametracker@global{%
\let\cbx@ifnameseen\cbx@ifnameseen@global
\let\cbx@nametracker\cbx@nametracker@global}
\let\blx@opt@nametracker@true\blx@opt@nametracker@global
\def\blx@opt@nametracker@false{%
\protected\long\def\cbx@ifnameseen##1##2##3{##3}%
\let\cbx@nametracker\relax}
\def\blx@opt@nametracker@context{%
\let\cbx@ifnameseen\cbx@ifnameseen@context
\let\cbx@nametracker\cbx@nametracker@context}
\appto\blx@secinit{%
\ifcsundef{cbx@bseen@names@\the\c@refsection}
{\global\cslet{cbx@bseen@names@\the\c@refsection}\@empty}
{}%
\ifcsundef{cbx@fseen@names@\the\c@refsection}
{\global\cslet{cbx@fseen@names@\the\c@refsection}\@empty}
{}}
\InitializeCitationStyle{%
\global\cslet{cbx@bseen@names@\the\c@refsection}\@empty
\global\cslet{cbx@fseen@names@\the\c@refsection}\@empty}
\ExecuteBibliographyOptions{nametracker=context}
\DeclareNameFormat{labelname}{%
\cbx@ifnameseen{\thefield{hash}}
{\ifcase\value{uniquename}%
\usebibmacro{name:family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\or
\ifuseprefix
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffixi}}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefixi}
{\namepartsuffixi}}%
\or
\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\fi}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\cbx@nametracker{\thefield{hash}}}%
\usebibmacro{name:andothers}}
\DeclareCiteCommand{\specialciteauthor}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}}
{\renewbibmacro*{name:andothers}{}%
\printnames[labelname][\thefield{postnote}-\thefield{postnote}]{author}}
{}
{}
\DeclareIndexNameFormat{createauthorcommands}{%
\ifcsundef{nbx@\thefield{hash}}
{\global\cslet{nbx@\thefield{hash}}\@empty
\csxdef{\namepartfamily}{%
\noexpand\specialciteauthor[\the\value{listcount}]
{\thefield{entrykey}}}%
\typeout{created author command '\namepartfamily' for
\namepartfamily\space to point to author
\the\value{listcount} of \thefield{entrykey}.}
}
{}}%
\AtDataInput{\indexnames[createauthorcommands][1-999]{author}}
\makeatother
\begin{document}
\Kant{} and \Appleby{} and \Hacker{}
\citeauthor{sz} has shown that\ldots, but \citeauthor{kpv} presumes that\ldots.
However, \citeauthor{krv} lived in the 18. century, \citeauthor{sg} in the 20.
\nocite{*}
\printbibliography
\end{document}
The approach is not ideal and has a few drawbacks
- If there are two people with the same last name, the commands are overwritten. Maybe one can use the
uniquename
feature to avoid this.
- Names with non-ASCII chars can cause problems because the name is used as a
\csname
. This could be solved by sanitising the name (ideally with Biber's sourcemapping -> strip non-ASCII chars and maybe even lowercase).
- The macros
\<Lastname>
are only available after a Biber run. So in the example \Kant
will produce an undefined control sequence error. The compilation must not be aborted (because then Biber can not be run), tell TeX to plough on regardless, then run Biber and things should work in the next run. This could be solved by using a different interface like \mmname{Kant}
where \mmname
can always be defined.
The following approach solves 3. and uses uniquename
to prevent name clashes as explained in 1.
\documentclass{article}
\usepackage[style=verbose-ibid, uniquename, maxnames=999]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{kpv,
author={Immanuel Kant},
title={Kritik der praktischen Vernunft}
}
@book{krv,
author={Immanuel Kant},
title={Kritik der reinen Vernunft}
}
@book{sz,
author={Martin Heidegger},
title={Sein und Zeit}
}
@book{sg,
author={Martin Heidegger},
title={Der Satz vom Grund}
}
@book{apphack,
author={Humprey Appleby and James Hacker},
title={On the Importance of the Civil Service}
}
@book{elk,
author={Emma Elk and Anne Belk},
title={Brontos!}
}
@book{elk2,
author={Anne Elk and Anna Belk},
title={Brontos!}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\makeatletter
\newrobustcmd*{\cbx@nametracker@global}[1]{%
\xifinlistcs{#1}{cbx@bseen@names@\the\c@refsection}
{}
{\listcsxadd{cbx@bseen@names@\the\c@refsection}{#1}}}
\newrobustcmd*{\cbx@nametracker@context}[1]{%
\iftoggle{blx@footnote}
{\xifinlistcs{#1}{cbx@fseen@names@\the\c@refsection}
{}
{\listcsxadd{cbx@fseen@names@\the\c@refsection}{#1}}}
{\xifinlistcs{#1}{cbx@bseen@names@\the\c@refsection}
{}
{\listcsxadd{cbx@bseen@names@\the\c@refsection}{#1}}}}
\newrobustcmd*{\cbx@ifnameseen@global}[1]{%
\xifinlistcs{#1}{cbx@bseen@names@\the\c@refsection}}
\newrobustcmd*{\cbx@ifnameseen@context}[1]{%
\iftoggle{blx@footnote}%
{\xifinlistcs{#1}{cbx@fseen@names@\the\c@refsection}}%
{\xifinlistcs{#1}{cbx@bseen@names@\the\c@refsection}}}
\DeclareBibliographyOption[string]{nametracker}[true]{%
\ifcsdef{blx@opt@nametracker@#1}
{\csuse{blx@opt@nametracker@#1}}
{\blx@err@invopt{nametracker=#1}{}}}
\def\blx@opt@nametracker@global{%
\let\cbx@ifnameseen\cbx@ifnameseen@global
\let\cbx@nametracker\cbx@nametracker@global}
\let\blx@opt@nametracker@true\blx@opt@nametracker@global
\def\blx@opt@nametracker@false{%
\protected\long\def\cbx@ifnameseen##1##2##3{##3}%
\let\cbx@nametracker\relax}
\def\blx@opt@nametracker@context{%
\let\cbx@ifnameseen\cbx@ifnameseen@context
\let\cbx@nametracker\cbx@nametracker@context}
\appto\blx@secinit{%
\ifcsundef{cbx@bseen@names@\the\c@refsection}
{\global\cslet{cbx@bseen@names@\the\c@refsection}\@empty}
{}%
\ifcsundef{cbx@fseen@names@\the\c@refsection}
{\global\cslet{cbx@fseen@names@\the\c@refsection}\@empty}
{}}
\InitializeCitationStyle{%
\global\cslet{cbx@bseen@names@\the\c@refsection}\@empty
\global\cslet{cbx@fseen@names@\the\c@refsection}\@empty}
\ExecuteBibliographyOptions{nametracker=context}
\DeclareNameFormat{labelname}{%
\cbx@ifnameseen{\thefield{hash}}
{\ifcase\value{uniquename}%
\usebibmacro{name:family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\or
\ifuseprefix
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffixi}}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefixi}
{\namepartsuffixi}}%
\or
\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\fi}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\cbx@nametracker{\thefield{hash}}}%
\usebibmacro{name:andothers}}
\DeclareCiteCommand{\specialciteauthor}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}}
{\renewbibmacro*{name:andothers}{}%
\printnames[labelname][\thefield{postnote}-\thefield{postnote}]{author}}
{}
{}
\DeclareIndexNameFormat{createauthorcommands}{%
\ifcsundef{nbx@\thefield{hash}}
{\global\cslet{nbx@\thefield{hash}}\@empty
\typeout{\the\value{uniquename}}%
\ifcase\value{uniquename}
\def\nbx@macroname{\namepartfamily}%
\or
\def\nbx@macroname{\namepartfamily\namepartgiveni}%
\or
\def\nbx@macroname{\namepartfamily\namepartgiven}%
\fi
\csxdef{nbx@\nbx@macroname}{%
\noexpand\specialciteauthor[\the\value{listcount}]
{\thefield{entrykey}}}%
\typeout{created author command '\nbx@macroname'
to point to author \the\value{listcount} of
\thefield{entrykey}.}}
{}}%
\AtDataInput{\indexnames[createauthorcommands][1-999]{author}}
\newcommand*{\mmname}[1]{%
\ifcsundef{nbx@#1}
{\textbf{#1}%
\@latex@warning{Name #1 not found.\MessageBreak
Either you need to re-run Biber and then LaTeX,\MessageBreak
or the name is misspelled.}}
{\csuse{nbx@#1}}}
\makeatother
\begin{document}
\mmname{Kant} and \mmname{Appleby} and \mmname{Hacker}
\citeauthor{sz} has shown that\ldots, but \citeauthor{kpv} presumes that\ldots.
However, \citeauthor{krv} lived in the 18. century, \citeauthor{sg} in the 20.
\nocite{*}
\printbibliography
\end{document}
cite
command if you do not actually cite the work?\citeauthor{work}
, you refer to the author ofwork
. Now if you don't want to refer to a particular person as the author of a work, you should type the name of that person out or use another command. You can have a list of people inbiblatex
, but you will have to create it manually - a automatic creation might have big problems to decide on what names to use for the commands (b/c of name ambiguities etc.).