2

To avoid/detect typos in author names I would like to use the bib file as a single source for names. Please see the following mwe:

\documentclass{article}

\begin{filecontents}{demo.bib} @book{articleA, author = {Author, A.}, year = {2001}, title = {Alpha}, } @book{articleB, author = {Author, A.}, year = {2002}, title = {Bravo}, } \end{filecontents}

\usepackage[style=alphabetic]{biblatex} \addbibresource{demo.bib}

\newcommand{\authorA}{\citeauthor{articleA}} \newcommand{\authorAL}{\citename{articleA}{author}}

\begin{document}

The lookup seems to work fine using biblatex's \textbackslash citeauthor and/or \textbackslash citename commands. The only problem I have is, that a lookup always adds an entry (here: [Aut01]) to the bibliography, eg.:

Hi, my name is \authorA.

Thus my question is: How to lookup the author's name from bib file, without causing the lookup to add a bibliography entry?

\printbibliography

\end{document}

lAtExFaN
  • 1,131

1 Answers1

2

A clean way to reach what you need is to create a bibliography category for the citations you don't want to print among the references and then print the bibliography without that category (see this answer).

\documentclass{article}

\begin{filecontents}[overwrite]{demo.bib} @book{articleA, author = {Author, A.}, year = {2001}, title = {Alpha}, } @book{articleB, author = {Buthor, B.}, year = {2002}, title = {Bravo}, } @book{articleC, author = {Cuthor, C.}, year = {2002}, title = {Charlie}, } \end{filecontents}

\usepackage[style=alphabetic]{biblatex} \addbibresource{demo.bib}

% see https://tex.stackexchange.com/a/111375/101651 \DeclareBibliographyCategory{nottocite}

\newcommand{\authorA}{\citeauthor{articleA}\addtocategory{nottocite}{articleA}}

\newcommand{\nameauthor}[1]{\citeauthor{#1}\addtocategory{nottocite}{#1}}

\begin{document}

Hi, my name is \authorA.

Or, more general \nameauthor{articleB}.

Pay attention: if you want them in bibliography, use \citeauthor{articleC}, not the previous commands.

\printbibliography[notcategory=nottocite]

\end{document}

enter image description here

CarLaTeX
  • 62,716