2

I'd like to use \citeauthor as a way of mentioning the author when the work per se is not being referenced, while automatically indexing each time it's mentioned. I've experimented redefining it with \DeclareCiteCommand and didn't get the wanted result.

\documentclass{article}

\usepackage[style=verbose]{biblatex} \ExecuteBibliographyOptions{ hyperref = true, indexing = cite, autocite = footnote } \begin{filecontents}{test.bib} @book{aristotle:physics, author = {Aristotle}, title = {Physics}, publisher = {G. P. Putnam}, location = {New York}, date = 1929 } } \end{filecontents} \addbibresource{test.bib} \usepackage{imakeidx} \makeindex[title={Authors Index}, columns=2] \usepackage[hidelinks]{hyperref}

\begin{document} \noindent \citeauthor{aristotle:physics} [...] \printbibliography \printindex \end{document}

Neveda
  • 43

3 Answers3

3

One way is to put it in a special refsection that you never show a bibliography for:

\newcommand\mentionauthor[1]{\begin{refsection}\citeauthor{#1}\end{refsection}}

\begin{document} \noindent \mentionauthor{aristotle:physics} [...] \printbibliography \printindex \end{document}

pst
  • 4,674
  • Hey thanks a lot!

    While this works for this MWE, it has the caveat of printing a lot of info, which slows down the compilation significantly in larger projects (~9 s):

    INFO - Found 0 citekeys in bib section 0
    [...]
    INFO - Found 0 citekeys in bib section 66
    [...]
    INFO - Processing section 1
    [...]
    INFO - Processing section 65
    ```.
    
    Interestingly it's also not achieving the desired effect in a larger project, I'll try figure out if it's getting into conflict with something else.
    
    – Neveda Jun 17 '23 at 12:36
3

Generally, once you call a biblatex \...cite... macro on an entry the data of that entry is requested from the .bib file and added to the .bbl, which means it gets included in a bibliography if one is printed. With biblatex you cannot obtain the data of an entry without sending it to the .bbl and once an entry is in the .bbl it is added to a bibliography (if the bibliography is printed unrestricted).

There are some tricks around that that either involve several refsections or filtering by categories or other data.

refsections are one way to keep citations and the corresponding bibliography in one part of your document completely separate from citations and the corresponding bibliography in another part. One way to do that is shown in pst's answer and a similar strategy can be found in https://tex.stackexchange.com/a/403928/35864. The advantage of this approach is that it completely separates your "\citeauthor" call from the rest of the document citations: A work only cited here will not be added to the global bibliography and will not influence sorting or uniqueness calculations. The disadvantage is a processing overhead: Each "\citeauthor" call creates a new refsection, which causes helper macros to be written and read from aux files. Biber needs to process each refsection separately.

The alternative approach adds a category marker to an entry if it is only used in \citeauthor and then later skips those entries. Some thought is needed to get the logic right, but you can find an approach in gusbrs's answer to How to omit one specific citation in \printbibliography, with BibLaTeX?. (I'm simplifying the code to ignore refsegments for now. If you need them, the linked answer shows how to get them back in.)

\documentclass{article}

\usepackage[style=authoryear-comp]{biblatex}

\newtoggle{includeentry} \toggletrue{includeentry}

\DeclareBibliographyCategory{entriesinbib}

\AtEveryCitekey{% \iftoggle{includeentry} {\addtocategory{entriesinbib}{\thefield{entrykey}}}% {}}

\newcommand{\DontIncludeNextCite}{\AtNextCite{\togglefalse{includeentry}}}

\newcommand\mentionauthor{\DontIncludeNextCite\citeauthor}

\addbibresource{biblatex-examples.bib}

\begin{document} Lorem \autocite{sigfridsson} ipsum \autocite{worman}

Lorem \mentionauthor{worman} ipsum \mentionauthor{nussbaum}

\printbibliography[category=entriesinbib] \end{document}

The disadvantage of this approach is that for most intents and purposes the \citeauthor'd entries are still part of the bibliography: they influence sorting and uniqueness data. (Try \mentionauthor{knuth:ct:c} \autocite{knuth:ct:b} in the MWE above.)

moewe
  • 175,683
0

Both answers presented were extremely useful to gain an understanding of how to work with this. Both answers have their strengths and weaknesses. For the project I'm working with, the \AtNextCite approach will alter the years appending them a letter, (1980a) and the refsection will kill ibid. abbreviations and slow performance, MWE:

\documentclass{article}
  \usepackage[style=verbose-trad1]{biblatex}
    \let\oldciteauthor\citeauthor
    \renewcommand{\citeauthor}[1]{\begin{refsection}\oldciteauthor{#1}\end{refsection}}
    \addbibresource{biblatex-examples.bib}
    \ExecuteBibliographyOptions{
      autocite   = footnote,
      abbreviate = true,
      strict     = false,
    }

\begin{document} Lorem \autocite[1]{worman} then \citeauthor{worman} ipsum \autocite[1]{worman}

\printbibliography \end{document}

As a result, I settled with a solution where, authors of cited works can be added to the index automatically via \citeauthor, while authors that are in that same .bib file and are not explicitly cited will be manually controlled via a \index{AuthorName} command, providing good performance and producing the correct output:

\documentclass{article}
  \usepackage[style=verbose-trad1]{biblatex}
    \addbibresource{biblatex-examples.bib}
    \ExecuteBibliographyOptions{
      autocite   = footnote,
      abbreviate = true,
      strict     = false,
    }
  \usepackage{imakeidx}
    \makeindex[title={Authors Index}, columns=2]
  \usepackage[hidelinks]{hyperref}

\begin{document} Lorem \autocite[1]{worman} then \citeauthor{worman} ipsum \autocite[1]{worman}.

Other author \index{Aristotle} Aristotle. \printbibliography \printindex \end{document}

It requires a bit more discipline and housekeeping and keep the final output without unwanted changes.

Neveda
  • 43