Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using biber as a backend for biblatex with the alphabetic style. I want to work the textcite and citeauthor commands to work as follows:

If I use one of the above commands the first time for a certain reference, I want it to print all the author names. Then on further citations, I want it to only display the first authors name + "et al.". The way I did it until now is as follows:

    \DeclareCiteCommand*{\textcite*}{%
    \defcounter{maxnames}{99}%
    \defcounter{minnames}{99}%
    \defcounter{uniquename}{0}%
    \booltrue{citetracker}%
    \boolfalse{pagetracker}%
    \usebibmacro{prenote}
    }{\ifciteindex{\indexnames{labelname}}{}%
      \ifciteseen{\printnames[][1-1]{labelname}}{\printnames[][1-99]{labelname}}
    }{\multicitedelim}{\usebibmacro{postnote}}

The problem with this is that for one thing I need to call \textcite* instead of \textcite and the other is that \textcite and \citeauthor are handled seperately here, i.e. if I call \textcite it works, but when I call \citeauthor for the first time it starts again with citing all names. I would be very glad if somebody knew how to fix this. Thank you.


Well, I noticed that the citation after the author's name(s) were ommitted if I called \textcite. Hence, I modified the command a bit like this:

    \DeclareCiteCommand{\textcite}{%
    \defcounter{maxnames}{99}%
    \defcounter{minnames}{99}%
    \defcounter{uniquename}{0}%
    \booltrue{citetracker}%
    \boolfalse{pagetracker}%
    \usebibmacro{prenote}
    }{\ifciteindex{\indexnames{labelname}}{}%
      \ifciteseen{
    {\printnames[][1-1]{labelname}\space\bibopenbracket}%
   \ifnumequal{\value{citecount}}{1}{\usebibmacro{prenote}}{}%
   \usebibmacro{cite}\bibclosebracket
    }{
      {\printnames[][1-99]{labelname}\space\bibopenbracket}%
   \ifnumequal{\value{citecount}}{1}{\usebibmacro{prenote}}{}%
   \usebibmacro{cite}\bibclosebracket
     }
    }{\multicitedelim}{\usebibmacro{postnote}}

But using this code, I would get a citation that includes name and citation, but it also adds a space after the citation which does not look very nice. Does anybody know how to correct that? Thank you?

@Seamus: I could not find any such feature in biblatex. If you know about something like this this would be gladly appreciated.

share|improve this question

closed as too localized by topskip, egreg, Seamus, percusse, lockstep Jun 18 '12 at 16:12

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Nevermind, it works the way I stated above, \DeclareCiteCommand*{\textcite*} needs just to be modified to \DeclareCiteCommand{\textcite} –  Stephan Jun 18 '12 at 6:04
    
Doesn't biblatex already have this feature? I would have thought there would options to do this in biblatex already... –  Seamus Jun 18 '12 at 9:15
    
Using the \unspace command, one can delete the additional spaces before and/or after the citation. –  Stephan Jun 18 '12 at 12:07
    
add comment

1 Answer 1

The spacing issues are easy to avoid if you apply edits to the textcite bibliography macro instead of redefining \textcite.

There is another issue associated with the \ifciteseen test. It is appropriate when labelname is always part of the citation label. This is the case for author-year styles (e.g. biblatex – et. al beginning from second citation?), but not alphabetic. A way around this is to track entries already cited via \textcite or \citeauthor using a category.

\documentclass{article}
\usepackage[backend=biber,style=alphabetic,maxcitenames=1]{biblatex}

\DeclareBibliographyCategory{nameseen}

\newbibmacro*{labelname}{%
  \ifcategory{nameseen}
    {\printnames{labelname}}
    {\addtocategory{nameseen}{\thefield{entrykey}}%
     \printnames[][1-99]{labelname}}}

% Based on generic definition from biblatex.def
\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \usebibmacro{labelname}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\makeatletter
% Based on definition from alphabetic.cbx
\renewbibmacro*{textcite}{%
  \ifcategory{nameseen}
    {}
    {\clearfield{namehash}}%
  \iffieldequals{namehash}{\cbx@lasthash}
    {\multicitedelim}
    {\cbx@tempa
     \ifnameundef{labelname}
       {}
       {\usebibmacro{labelname}\space}%
     \bibopenbracket}%
  \ifnumequal{\value{citecount}}{1}
    {\usebibmacro{prenote}}
    {}%
  \usebibmacro{cite}%
  \savefield{namehash}{\cbx@lasthash}%
  \gdef\cbx@tempa{\bibclosebracket\multicitedelim}}
\makeatother

\begin{filecontents}{\jobname.bib}
@article{bertram2,
  title = {Gromov Invariants for Holomorphic Maps from Riemann Surfaces to Grassmannians},
  author = {Bertram, Aaron and Daskalopoulos, Georgios and Wentworth, Richard},
  journal = {Journal of the American Mathematical Society},
  volume = {9},
  number = {2},
  pages = {529--571},
  year = {1996}}
\end{filecontents}

\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
Some filler text \parencite{companion,bertram}.
\Citeauthor{companion} showed that...
\Textcite{companion} showed that...
The results from \textcite{bertram,bertram2,companion}...
The results from \textcite{bertram,bertram2,companion}...
The results by \citeauthor{bertram,companion,yoon}...
\end{document}

enter image description here

This solution also works with BibTeX as the backend.

The alphabetic-verb style is similar to alphabetic, but it doesn't generate compact citation lists. To get the solution working with alphabetic-verb use the following redefinition of textcite.

% Based on definition from alphabetic-verb.cbx
\renewbibmacro*{textcite}{%
  \ifnameundef{labelname}
    {}
    {\usebibmacro{labelname}\space}%
  \bibopenbracket
  \ifnumequal{\value{citecount}}{1}
    {\usebibmacro{prenote}}
    {}%
  \usebibmacro{cite}}
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.