11

I am currently defining a (french) citation style. One thing I haven't managed to do is to replace the name of a recurring author by the short form in the citations. What I would like to do is :

  • Jane Smith, first work, Paris, 1900. [first citation from this author].
  • J. Smith, other work, Paris, 1901 [if not directly following the previous one].

or :

  • Ead., other work, Paris, 1901 [if directly following].

Is there a way of doing this? I have tried to use \ifentryseen{author} but without any success so far.

[edit] Here is how I try to do it (but I get an ! extra \else error):

\newbibmacro*{author-fullnote}{%  
  \ifthenelse{\ifuseauthor\AND\NOT\ifnameundef{author}}%
    {\ifthenelse{\iffieldequals{namehash}{\bbx@lasthash}\AND\NOT\iffirstonpage}
       {\bibstring[\mkidem]{idem\thefield{gender}}}
       {\ifthenelse{\ifentryseen{author}}{\printnames{labelname}}{
       \printnames[upshape][1-10]{author}
        \savefield{namehash}{\bbx@lasthash}}}}
    {\global\undef\bbx@lasthash}}
9
  • 1
    @Jean-Baptiste: Did you enable the idemtracker? It would be good to have a minimal example for this.
    – domwass
    Apr 2, 2011 at 14:54
  • @domwass I have declared \ExecuteBibliographyOptions{idemtracker} in the beginning of the bbx file. As for my example, I'll include it in my post, since it is too long for a comment. Apr 2, 2011 at 15:33
  • @Jean-Baptiste: If you use 4-space indentation for a code block (which is good!), then you don't need backticks `. Apr 2, 2011 at 17:31
  • @Hendrik Vogt, Duly noted ! Apr 2, 2011 at 18:26
  • I've noticed that, if I don't use {\ifthenelse{\ifentryseen{author}} but only \ifentryseen{author}, I no longer get the ! extra \else error message, but, instead of "Ead.,", I get "Ead., J. Smith, Jane Smith"... Apr 2, 2011 at 18:28

1 Answer 1

6

Here how I finally managed to do it, using code from the Biblatex-dw styles. I added in the cbx :

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

\AtBeginDocument{%
\DeclareNameFormat{citeauthor}{%
    \cbx@ifnameseen{#1#3#5#7}
        {\usebibmacro{name:first-last-upshape}{#1}{#4}{#5}{#7}%
        }%
        {\usebibmacro{name:first-last-upshape}{#1}{#3}{#5}{#7}%
        \cbx@nameseen{#1#3#5#7}}%
   \usebibmacro{name:andothers}}
}

Where first-last-upshape is the format to be used in notes, with full first name the first time, and only initials the others. I then, in the bbx, defined two macros, inspired from the historische-zeitschrift style, to be applied in the full note (et al. only after ten names) and short notes (et al. after three names), each time specifying that idem/eadem/etc. should be used for the same author in two following references :

\newbibmacro*{author-fullnote}{%
    \ifthenelse{\ifuseauthor\AND\NOT\ifnameundef{author}}%
        {\ifthenelse
            {\iffieldequals{namehash}{\cbx@lasthash}}%
            {\bibstring{idem\thefield{gender}},}%
            {\printnames[citeauthor][1-10]{author}%        
        \savefield{namehash}{\cbx@lasthash}
    }}%
    {\global\undef\cbx@lasthash}}

\newbibmacro*{author-shortnote}{%
    \ifthenelse{\ifuseauthor\AND\NOT\ifnameundef{author}}%
        {\ifthenelse
            {\iffieldequals{namehash}{\cbx@lasthash}}%
            {\bibstring{idem\thefield{gender}},}%
            {\printnames[citeauthor][1-3]{author}%        
        \savefield{namehash}{\cbx@lasthash}
    }}%
    {\global\undef\cbx@lasthash}}

Here is what it looks like :

In following references :

In following references

In a further reference :

In a further reference

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .