dcpurton / biblatex-sbl

Society of Biblical Literature (SBL) style files for biblatex
24 stars 5 forks source link

Use \citefullauthor on first occurrence of an author and \citeauthor on subsequent occurrences #134

Open jjmccollum opened 7 months ago

jjmccollum commented 7 months ago

It looks like a \citefullauthor macro was implemented in response to #86. With the availability of both \citeauthor and \citefullauthor, I'm curious if it's possible to enable tracking of cited authors and to modify \citeauthor so that it behaves like \citefullauthor the first time an author is cited and behaves in the usual way for subsequent citations of the same author. I don't recall if the SBLHS offers guidance on this, but I know that it's a common rule of thumb to cite an author's full name the first time you mention them in the main body of an article or chapter. Automating this behavior would be helpful because it would ensure that this rule is followed without the user keeping track of first citations and manually changing when \citefullauthor is used instead of \citeauthor.

In a thread about the same issue at https://tex.stackexchange.com/questions/46461/citing-authors-full-name-in-biblatex-the-first-time-it-appears, the following patch was suggested:

\makeatletter
\newcommand*{\cbx@seennames}{}
\newrobustcmd*{\cbx@nameseen}[1]{%
  \listxadd{\cbx@seennames}{\detokenize{#1}}}
\newrobustcmd*{\cbx@ifnameseen}[1]{%
  \xifinlist{\detokenize{#1}}{\cbx@seennames}}

\DeclareNameFormat{citeauthor}{%
  \cbx@ifnameseen{#1#3#5#7}
    {\ifcase\value{uniquename}%
       \usebibmacro{name:last}{#1}{#3}{#5}{#7}%
     \or
       \ifuseprefix
         {\usebibmacro{name:first-last}{#1}{#4}{#5}{#8}}
         {\usebibmacro{name:first-last}{#1}{#4}{#6}{#8}}%
     \fi}%
    {\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}%
     \cbx@nameseen{#1#3#5#7}}%
  \usebibmacro{name:andothers}}
\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\indexnames{labelname}%
   \printnames[citeauthor]{labelname}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\makeatother

But this doesn't appear to work with biblatex-sbl, because I get the following error:

! Illegal parameter number in definition of \blx@defformat@d.

3 l.808 \usebibmacro{name:andothers}}

Is there a simple adjustment to this patch that should work with biblatex-sbl, or is a function like this already supported by biblatex-sbl?

dcpurton commented 7 months ago

Thanks! This looks like useful behaviour. I'll take a look.

dcpurton commented 5 months ago

@jjmccollum Here's a bit of a go at this.

The tracker in this code is global, so the tracker updates regardless of the context of the first \citeauthor. But context sensitive trackers could be defined easily enough.

The tracker is only triggered by \citeauthor, so a \cite will not add the name to the list of seen names. (Is this what you want?)

If this works for you, I could add it as a feature and provide an option to control:

nametracker=true, false, context, strict, constrict with a default of false (to be consistent with other trackers).

MWE

\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage{parskip}
\pagestyle{empty}
\usepackage[style=sbl]{biblatex}
\addbibresource{biblatex-sbl.bib}

\makeatletter
% set a flag for enabling/disabling the name tracker
\newbool{nametracker}
\booltrue{nametracker}

% define a global name tracker (uses the labelname)
\def\sbl@blx@nametracker@global{%
  \ifbool{nametracker}
    {\ifdef{\abx@field@namehash}
       {\xifinlistcs\abx@field@namehash{sbl@blx@name@bsee@\the\c@refsection}
          {}
          {\listcsxadd{sbl@blx@name@bsee@\the\c@refsection}\abx@field@namehash}}
       {}}
    {}}
\let\sbl@blx@nametracker\sbl@blx@nametracker@global
\let\nametracker\sbl@blx@nametracker

% define a test for if a name has previously been seen (uses the labelname)
\def\sbl@blx@ifnameseen@global{%
  \ifbool{nametracker}
    {\xifinlistcs{\abx@field@namehash}{sbl@blx@name@bsee@\the\c@refsection}}
    {\@secondoftwo}}
\let\sbl@blx@ifnameseen\sbl@blx@ifnameseen@global
\let\ifnameseen\sbl@blx@ifnameseen
\makeatother

% define new \citeauthor and \citeauthor* commands which track the name
\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \ifnameseen
     {\printnames{labelname}}
     {\printnames[given-family]{labelname}%
      \nametracker}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \ifnameseen
     {\printnames[][1-1]{labelname}}
     {\printnames[given-family][1-1]{labelname}%
      \nametracker}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\begin{document}
First \texttt{\char`\\citeauthor} gives \texttt{[given-family]} label name:
\textbf{\citeauthor{talbert:1992}}.

Subsequent \texttt{\char`\\citeauthor} gives \texttt{[labelname]} label name:
\textbf{\citeauthor{talbert:1992}}.

\texttt{\char`\\citefullauthor} always gives \texttt{[given-family]}
label name: \textbf{\citefullauthor{talbert:1992}}.

First \texttt{\char`\\citeauthor} gives \texttt{[given-family]} label name:
\textbf{\citeauthor{robinson+koester:1971}}.

Subsequent \texttt{\char`\\citeauthor} gives \texttt{[labelname]} label name:
\textbf{\citeauthor{robinson+koester:1971}}.

\texttt{\char`\\citefullauthor} always gives \texttt{[given-family]} label
name: \textbf{\citefullauthor{robinson+koester:1971}}.

First \texttt{\char`\\citeauthor*} gives \texttt{[given-family][1-1]} label
name: \textbf{\citeauthor*{kaltner+mckenzie:2002}}.

Subsequent \texttt{\char`\\citeauthor*} gives \texttt{[labelname][1-1]} label
name: \textbf{\citeauthor*{kaltner+mckenzie:2002}}.

\texttt{\char`\\citefullauthor*} always gives \texttt{[given-family][1-1]}
label name: \textbf{\citefullauthor*{kaltner+mckenzie:2002}}.

\printbibliography
\end{document}

Output

tex501

jjmccollum commented 5 months ago

@dcpurton This looks fantastic! A context-sensitive version (i.e., one that distinguishes between occurrences in the main text and one that distinguishes between occurrences in footnotes) would be ideal, but what you've done so far should work well for my current needs. Out of curiosity, with the code you've provided above, is there an easy way I could clear the tracker (say, at the start of a chapter)?

Thanks so much for this!

dcpurton commented 5 months ago

@jjmccollum Here's a more extended example that defines both a global and a context name tracker. It adds in \citeauthorreset (which is also called by \citereset). The tracker does obey refsections, so you can get it (along with the other trackers) to reset automatically using the citereset biblatex option. Should be a new citeauthorreset option so just the name tracker could be automatically reset without resetting the other trackers?

There would still be more work needed to put it into the main package, but this is already quite useful.

MWE

(BTW, the biblatex-sbl.bib file is in biblatex-sbl doc folder in TeXLive, so you need to grab it and put in same directory as the below tex file.)

\documentclass{article}
\usepackage[landscape,top=1in,bottom=1in]{geometry}
\usepackage{parskip}
\pagestyle{empty}
\usepackage[style=sbl, citereset=section]{biblatex}
\addbibresource{biblatex-sbl.bib}

\makeatletter
% set a flag for enabling/disabling the name tracker
\newbool{nametracker}
\booltrue{nametracker}

% define global and context name trackers for labelname
\def\sbl@blx@nametracker@global{%
  \ifbool{nametracker}
    {\ifdef{\abx@field@namehash}
       {\xifinlistcs\abx@field@namehash{sbl@blx@name@bsee@\the\c@refsection}
          {}
          {\listcsxadd{sbl@blx@name@bsee@\the\c@refsection}\abx@field@namehash}}
       {}}
    {}}
\def\sbl@blx@nametracker@context{%
  \ifbool{nametracker}
    {\ifdef{\abx@field@namehash}
       {\iftoggle{blx@footnote}
          {\xifinlistcs\abx@field@namehash{sbl@blx@name@fsee@\the\c@refsection}
             {}
             {\listcsxadd{sbl@blx@name@fsee@\the\c@refsection}\abx@field@namehash}}
          {\xifinlistcs\abx@field@namehash{sbl@blx@name@bsee@\the\c@refsection}
             {}
             {\listcsxadd{sbl@blx@name@bsee@\the\c@refsection}\abx@field@namehash}}}
       {}}
    {}}
\let\sbl@blx@nametracker\sbl@blx@nametracker@context
\let\nametracker\sbl@blx@nametracker

% define global and context tests for if a labelname has previously been seen
\def\sbl@blx@ifnameseen@global{%
  \ifbool{nametracker}
    {\xifinlistcs{\abx@field@namehash}{sbl@blx@name@bsee@\the\c@refsection}}
    {\@secondoftwo}}
\def\sbl@blx@ifnameseen@context{%
  \ifbool{nametracker}
    {\iftoggle{blx@footnote}
       {\xifinlistcs{\abx@field@namehash}{sbl@blx@name@fsee@\the\c@refsection}}
       {\xifinlistcs{\abx@field@namehash}{sbl@blx@name@bsee@\the\c@refsection}}}
    {\@secondoftwo}}
\let\sbl@blx@ifnameseen\sbl@blx@ifnameseen@context
\let\ifnameseen\sbl@blx@ifnameseen

% define command to reset the name tracker
\newrobustcmd*{\citeauthorreset}{%
  \global\cslet{sbl@blx@name@bsee@\the\c@refsection}\@empty
  \global\cslet{sbl@blx@name@fsee@\the\c@refsection}\@empty}

% patch \citereset so that it also calls \citeauthorreset
\patchcmd{\citereset}
  {\blx@ibidreset@force}
  {\citeauthorreset
   \blx@ibidreset@force}
  {}
  {}

% disable name tracker in floats unless the trackfloats option is set
\AtEndPreamble{%
  \iftoggle{blx@trackfloats}
    {}
    {\apptocmd\@floatboxreset
       {\boolfalse{nametracker}}
       {}
       {\blx@err@patch{floats}}}}
\makeatother

% define new \citeauthor and \citeauthor* commands which track the name
\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \ifnameseen
     {\printnames{labelname}}
     {\printnames[given-family]{labelname}%
      \nametracker}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \ifnameseen
     {\printnames[][1-1]{labelname}}
     {\printnames[given-family][1-1]{labelname}%
      \nametracker}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\begin{document}
\section{First section}

First \texttt{\char`\\citeauthor} gives \texttt{[given-family]} label name:
\textbf{\citeauthor{talbert:1992}}.

Subsequent \texttt{\char`\\citeauthor} gives \texttt{[labelname]} label name:
\textbf{\citeauthor{talbert:1992}}.

\texttt{\char`\\citefullauthor} always gives \texttt{[given-family]}
label name: \textbf{\citefullauthor{talbert:1992}}.

First \texttt{\char`\\citeauthor} gives \texttt{[given-family]} label name:
\textbf{\citeauthor{robinson+koester:1971}}.

Subsequent \texttt{\char`\\citeauthor} gives \texttt{[labelname]} label name:
\textbf{\citeauthor{robinson+koester:1971}}.

\texttt{\char`\\citefullauthor} always gives \texttt{[given-family]} label
name: \textbf{\citefullauthor{robinson+koester:1971}}.

First \texttt{\char`\\citeauthor*} gives \texttt{[given-family][1-1]} label
name: \textbf{\citeauthor*{kaltner+mckenzie:2002}}.

Subsequent \texttt{\char`\\citeauthor*} gives \texttt{[labelname][1-1]} label
name: \textbf{\citeauthor*{kaltner+mckenzie:2002}}.

\texttt{\char`\\citefullauthor*} always gives \texttt{[given-family][1-1]}
label name: \textbf{\citefullauthor*{kaltner+mckenzie:2002}}.

Filler text.\footnote{First \texttt{\char`\\citeauthor} in a footnote gives
\texttt{[given-family]} label name: \textbf{\citeauthor{talbert:1992}}.}

Filler text.\footnote{Subsequent \texttt{\char`\\citeauthor} in a footnote
gives \texttt{[labelname]} label name: \textbf{\citeauthor{talbert:1992}}.}

Filler text.\footnote{\texttt{\char`\\citefullauthor} in a footnote always
gives \texttt{[given-family]} label name:
\textbf{\citefullauthor{talbert:1992}}.}

\texttt{\char`\\citeauthorreset} and \texttt{\char`\\citereset} both reset the
name tracker.\citereset

First \texttt{\char`\\citeauthor} after resetting the name tracker gives
\texttt{[given-family]} label name: \textbf{\citeauthor{talbert:1992}}.

\section{Second section}

First \texttt{\char`\\citeauthor} after resetting the name tracker at a
section (using the \texttt{citereset=section} option) gives
\texttt{[given-family]} label name: \textbf{\citeauthor{talbert:1992}}.

\printbibliography
\end{document}

tex501

jjmccollum commented 5 months ago

@dcpurton Apologies for the delayed reply! I wanted to experiment with the new code a bit to see if there was anything I should mention to you. Regarding your question about a citeauthorreset macro, I think that might be useful.

On a related note, I noticed that the author tracker does something I didn't expect (but which makes sense given how it works). If I cite two works with the same authors, then in the citation of the second work, the label name is used. But I would expect the first citation of a work to use the authors' full names regardless of whether they've been cited already.

For a MWE using entries from the test .bib file, a citation of freedman:1977 followed by a citation of freedman:1980 should replicate this behavior.

dcpurton commented 5 months ago

@dcpurton Apologies for the delayed reply! I wanted to experiment with the new code a bit to see if there was anything I should mention to you. Regarding your question about a citeauthorreset macro, I think that might be useful.

I'll look at a citeauthorreset package option.

On a related note, I noticed that the author tracker does something I didn't expect (but which makes sense given how it works). If I cite two works with the same authors, then in the citation of the second work, the label name is used. But I would expect the first citation of a work to use the authors' full names regardless of whether they've been cited already.

Ah yes. I think the initial answer you pointed to would behave this way also.

To get the behaviour you want, you just need to replace \abx@field@namehash with \abx@field@entrykey. This way it will track the entry key. In effect this will set up a second tracker which is basically the same is the citetracker, but which only applies when you \citeauthor.

BTW, I see you know Rob Turnbull! (I stalked you.) I studied with him at Ridley College.

jjmccollum commented 5 months ago

I'll look at a citeauthorreset package option.

Thanks!

To get the behaviour you want, you just need to replace \abx@field@namehash with \abx@field\entrykey. This way it will track the entry key. In effect this will set up a second tracker which is basically the same is the citetracker, but which only applies when you \citeauthor.

If I replace all instances of \abx@field@namehash with \abx@field\entrykey, I get the following error:

! Undefined control sequence.
<argument> \abx@field 
                      \entrykey 

I tried replacing \abx@field@namehash with \abx@field@entrykey instead, but that didn't change the behavior. Just to verify, my code looks like this now:

\makeatletter
% set a flag for enabling/disabling the name tracker
\newbool{nametracker}
\booltrue{nametracker}

% define global and context name trackers for labelname
\def\sbl@blx@nametracker@global{%
  \ifbool{nametracker}
    {\ifdef{\abx@field@entrykey}
       {\xifinlistcs\abx@field@entrykey{sbl@blx@name@bsee@\the\c@refsection}
          {}
          {\listcsxadd{sbl@blx@name@bsee@\the\c@refsection}\abx@field@entrykey}}
       {}}
    {}}
\def\sbl@blx@nametracker@context{%
  \ifbool{nametracker}
    {\ifdef{\abx@field@entrykey}
       {\iftoggle{blx@footnote}
          {\xifinlistcs\abx@field@entrykey{sbl@blx@name@fsee@\the\c@refsection}
             {}
             {\listcsxadd{sbl@blx@name@fsee@\the\c@refsection}\abx@field@entrykey}}
          {\xifinlistcs\abx@field@entrykey{sbl@blx@name@bsee@\the\c@refsection}
             {}
             {\listcsxadd{sbl@blx@name@bsee@\the\c@refsection}\abx@field@entrykey}}}
       {}}
    {}}
\let\sbl@blx@nametracker\sbl@blx@nametracker@context
\let\nametracker\sbl@blx@nametracker

% define global and context tests for if a labelname has previously been seen
\def\sbl@blx@ifnameseen@global{%
  \ifbool{nametracker}
    {\xifinlistcs{\abx@field@entrykey}{sbl@blx@name@bsee@\the\c@refsection}}
    {\@secondoftwo}}
\def\sbl@blx@ifnameseen@context{%
  \ifbool{nametracker}
    {\iftoggle{blx@footnote}
       {\xifinlistcs{\abx@field@entrykey}{sbl@blx@name@fsee@\the\c@refsection}}
       {\xifinlistcs{\abx@field@entrykey}{sbl@blx@name@bsee@\the\c@refsection}}}
    {\@secondoftwo}}
\let\sbl@blx@ifnameseen\sbl@blx@ifnameseen@context
\let\ifnameseen\sbl@blx@ifnameseen

% define command to reset the name tracker
\newrobustcmd*{\citeauthorreset}{%
  \global\cslet{sbl@blx@name@bsee@\the\c@refsection}\@empty
  \global\cslet{sbl@blx@name@fsee@\the\c@refsection}\@empty}

% patch \citereset so that it also calls \citeauthorreset
\patchcmd{\citereset}
  {\blx@ibidreset@force}
  {\citeauthorreset
   \blx@ibidreset@force}
  {}
  {}

% disable name tracker in floats unless the trackfloats option is set
\AtEndPreamble{%
  \iftoggle{blx@trackfloats}
    {}
    {\apptocmd\@floatboxreset
       {\boolfalse{nametracker}}
       {}
       {\blx@err@patch{floats}}}}
\makeatother

% define new \citeauthor and \citeauthor* commands which track the name
\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \ifnameseen
     {\printnames{labelname}}
     {\printnames[given-family]{labelname}%
      \nametracker}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \ifnameseen
     {\printnames[][1-1]{labelname}}
     {\printnames[given-family][1-1]{labelname}%
      \nametracker}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

Is there something I'm missing?

BTW, I see you know Rob Turnbull! (I stalked you.) I studied with him at Ridley College.

Haha, small world! I'm doing my PhD at ACU, and Rob is my associate supervisor!

dcpurton commented 5 months ago

If I replace all instances of \abx@field@namehash with \abx@field\entrykey, I get the following error:

Typo! I mean \abx@field@entrykey

jjmccollum commented 5 months ago

Thanks for clarifying! I tried replacing all occurrences of \abx@field@namehash with \abx@field@entrykey. That didn't run into any errors, but it also didn't change the behavior: in subsequent citations of different works by the same author, the second citation still uses the short form of the author name rather than the full form.

dcpurton commented 5 months ago

It should work:

This MWE gives the expected output for me:

\documentclass{article}
\begin{filecontents}[overwrite]{\jobname.bib}
@incollection{vanseters:1995,
  author = {Van Seters, John},
  title = {The Theology of the Yahwist},
  subtitle = {A Preliminary Sketch},
  pages = {219-228},
  booktitle = {“Wer ist wie du, Herr, unter den Göttern?”},
  booksubtitle = {Studien zur Theologie und Religionsgeschichte Israels für Otto Kaiser zum 70\adddotspace Geburtstag},
  editor = {Kottsieper, Ingo and others},
  location = {Göttingen},
  publisher = {Vandenhoeck \& Ruprecht},
  date = {1995}
}
@book{vanseters:1997,
  author = {Van Seters, John},
  title = {In Search of History},
  subtitle = {Historiography in the Ancient World and the Origins of Biblical History},
  origlocation = {New Haven},
  origpublisher = {Yale University Press},
  origdate = {1983},
  location = {Winona Lake, IN},
  publisher = {Eisenbrauns},
  date = {1997}
}
\end{filecontents}

\usepackage{parskip}
\pagestyle{empty}
\usepackage[style=sbl, citereset=section]{biblatex}
\addbibresource{\jobname.bib}

\makeatletter
% set a flag for enabling/disabling the name tracker
\newbool{nametracker}
\booltrue{nametracker}

% define global and context name trackers for labelname
\def\sbl@blx@nametracker@global{%
  \ifbool{nametracker}
    {\ifdef{\abx@field@entrykey}
       {\xifinlistcs\abx@field@entrykey{sbl@blx@name@bsee@\the\c@refsection}
          {}
          {\listcsxadd{sbl@blx@name@bsee@\the\c@refsection}\abx@field@entrykey}}
       {}}
    {}}
\def\sbl@blx@nametracker@context{%
  \ifbool{nametracker}
    {\ifdef{\abx@field@entrykey}
       {\iftoggle{blx@footnote}
          {\xifinlistcs\abx@field@entrykey{sbl@blx@name@fsee@\the\c@refsection}
             {}
             {\listcsxadd{sbl@blx@name@fsee@\the\c@refsection}\abx@field@entrykey}}
          {\xifinlistcs\abx@field@entrykey{sbl@blx@name@bsee@\the\c@refsection}
             {}
             {\listcsxadd{sbl@blx@name@bsee@\the\c@refsection}\abx@field@entrykey}}}
       {}}
    {}}
\let\sbl@blx@nametracker\sbl@blx@nametracker@context
\let\nametracker\sbl@blx@nametracker

% define global and context tests for if a labelname has previously been seen
\def\sbl@blx@ifnameseen@global{%
  \ifbool{nametracker}
    {\xifinlistcs{\abx@field@entrykey}{sbl@blx@name@bsee@\the\c@refsection}}
    {\@secondoftwo}}
\def\sbl@blx@ifnameseen@context{%
  \ifbool{nametracker}
    {\iftoggle{blx@footnote}
       {\xifinlistcs{\abx@field@entrykey}{sbl@blx@name@fsee@\the\c@refsection}}
       {\xifinlistcs{\abx@field@entrykey}{sbl@blx@name@bsee@\the\c@refsection}}}
    {\@secondoftwo}}
\let\sbl@blx@ifnameseen\sbl@blx@ifnameseen@context
\let\ifnameseen\sbl@blx@ifnameseen

% define command to reset the name tracker
\newrobustcmd*{\citeauthorreset}{%
  \global\cslet{sbl@blx@name@bsee@\the\c@refsection}\@empty
  \global\cslet{sbl@blx@name@fsee@\the\c@refsection}\@empty}

% patch \citereset so that it also calls \citeauthorreset
\patchcmd{\citereset}
  {\blx@ibidreset@force}
  {\citeauthorreset
   \blx@ibidreset@force}
  {}
  {}

% disable name tracker in floats unless the trackfloats option is set
\AtEndPreamble{%
  \iftoggle{blx@trackfloats}
    {}
    {\apptocmd\@floatboxreset
       {\boolfalse{nametracker}}
       {}
       {\blx@err@patch{floats}}}}
\makeatother

% define new \citeauthor and \citeauthor* commands which track the name
\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \ifnameseen
     {\printnames{labelname}}
     {\printnames[given-family]{labelname}%
      \nametracker}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \ifnameseen
     {\printnames[][1-1]{labelname}}
     {\printnames[given-family][1-1]{labelname}%
      \nametracker}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\begin{document}
\citeauthor{vanseters:1995}

\citeauthor{vanseters:1995}

\citeauthor{vanseters:1997}

\citeauthor{vanseters:1997}

\printbibliography
\end{document}

tex511

jjmccollum commented 5 months ago

What is the behavior if you use \autocites{vanseters:1995}{vanseters:1997}?

dcpurton commented 5 months ago

Oh! That's interesting. That is unrelated to the \citeauthor changes. (If you comment out all the custom macros, this still happens.)

This is a bug. I will investigate.

dcpurton commented 5 months ago

Ha! It's not a bug. It's by design.

Have a look at this post from SBL: https://sblhs2.com/2016/10/11/placement-citations-traditional/

Here we read:

References to multiple works by the same author in a single footnote should repeat the last name of the author rather than use idem (see CMS §14.30; example here modified from Kline 2016).

Incorrect: 97. Cyrus H. Gordon argued that brh in Isa 27:1 should be translated “evil,” based on an Arabic cognate (“Near East Seals in Princeton and Philadelphia,” Or 22 [1953]: 243; see also Cyrus H. Gordon, Ugaritic Textbook, AnOr 38 [Rome: Pontifical Biblical Institute, 1965], 376).

Incorrect: 7. Cyrus H. Gordon argued that brh in Isa 27:1 should be translated “evil,” based on an Arabic cognate (“Near East Seals in Princeton and Philadelphia,” Or 22 [1953]: 243; see also idem, Ugaritic Textbook, AnOr 38 [Rome: Pontifical Biblical Institute, 1965], 376).

Correct: 97. Cyrus H. Gordon argued that brh in Isa 27:1 should be translated “evil,” based on an Arabic cognate (“Near East Seals in Princeton and Philadelphia,” Or 22 [1953]: 243; see also Gordon, Ugaritic Textbook, AnOr 38 [Rome: Pontifical Biblical Institute, 1965], 376).

If you'd like to disable this behaviour, you can pass idemtracker=false to biblatex. (The default is idemtracker=sbl.) This is documented in the manual, but easy to miss.

You will get the same behaviour with \footnote{\cite{vanseters:1995}; \cite{vanseters:1997}}. But if they appear in different footnotes for the first time, then you get full name both times (e.g., \autocite{vanseters:1995}\autocite{vanseters:1997)

jjmccollum commented 5 months ago

Oh, good! If that's the recommendation of the SBLHS, then I'll leave it as-is in my document. Sorry I didn't know that already!

dcpurton commented 5 months ago

Oh, good! If that's the recommendation of the SBLHS, then I'll leave it as-is in my document. Sorry I didn't know that already!

To be honest their book and blog is a complete mess. There were lots of errors in the book (some even carried over from the first edition). Then there are updates in the blog to the handbook. Then they have done further updates later in the blog that supersede previous updates!

BTW, there are changes and clarifications in that blog which my code doesn't support.

My efforts to rewrite things from scratch to comply with all their clarifications has stalled (eventually I'll get back to it, but a lot of things around ancient works are not well explained by SBL and I'm not familiar with the works).

Recently, I've been working on the scripture package, which I use all the time in my own documents at the moment.

jjmccollum commented 5 months ago

No worries! I saw that Chicago style was recently updated, so it's possible that SBL style will do the same soon. In that case, it's probably better not to make too many changes ahead of time.

It's good to know about the scripture package! I'll have to keep it in mind for the future.

I think that the code that you've provided implements the feature I requested, so feel free to close this issue as you see fit. Thanks again for taking the time to do all of this!