10

I'm using biblatex and I need author's last name in small caps, so I do this:

\renewcommand\mkbibnamelast[1]{\textsc{#1}}

So I get "SMITH, John" and that's what I needed. But I also get for example:

ALCINOOS (1990). Enseignement des doctrines de Platon. Ed. por J. WHITTAKER y P. LOUIS. Paris: Belles Lettres.

And the problem is I don't want that editors, translators, etc in small caps, because in spanish is not correct.

Edit: As of March 2016 (biblatex 3.3), you need \mkbibnamefamily

Guido
  • 30,740
Gastón
  • 595

1 Answers1

19

Small capitals can be applied selectively using \ifcurrentname. The example below applies \textsc only to the last names of the fields labelname, author (or editor, in the absence of author). The results are demonstrated with verbose-trad1, but the solution should work for most styles.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[american]{babel}
\usepackage[style=verbose-trad1]{biblatex}

\renewcommand*{\mkbibnamelast}[1]{%
  \ifmknamesc{\textsc{#1}}{#1}}

\renewcommand*{\mkbibnameprefix}[1]{%
  \ifboolexpr{ test {\ifmknamesc} and test {\ifuseprefix} }
    {\textsc{#1}}
    {#1}}

\def\ifmknamesc{%
  \ifboolexpr{ test {\ifcurrentname{labelname}}
               or test {\ifcurrentname{author}}
               or ( test {\ifnameundef{author}} and test {\ifcurrentname{editor}} ) }}

\addbibresource{biblatex-examples.bib}

\begin{document}
\null\vfill\noindent
\citeauthor{aristotle:poetics,gaonkar}.
Filler text \autocites[10--15]{aristotle:poetics}{aristotle:rhetoric,companion,cicero}.
Filler text \autocites[11]{companion}[10--15]{aristotle:poetics}{aristotle:rhetoric,gaonkar,vangennep}.
\printbibliography
\end{document}

enter image description here

Note that applying the format to labelname makes \citeauthor set in small capitals. To avoid this under styles with citation tracking enabled, \ifmknamesc can be refined:

\def\ifmknamesc{%
  \ifboolexpr{ ( test {\ifbibliography} or test {\ifbool{citetracker}} )
               and ( test {\ifcurrentname{labelname}}
                     or test {\ifcurrentname{author}}
                     or ( test {\ifnameundef{author}}
                          and test {\ifcurrentname{editor}} ) ) }}

Under styles without tracking, \citeauthor can be modified directly:

\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \let\ifmknamesc=\ifbibliography%
   \printnames{labelname}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

To avoid use of small capitals in citations entirely, we can use the test \ifbibliography. The following definition also limits \textsc to the first author (or editor).

\def\ifmknamesc{%
  \ifboolexpr{ test {\ifnumequal{\value{listcount}}{1}}
               and test {\ifbibliography}
               and ( test {\ifcurrentname{author}}
                     or ( test {\ifnameundef{author}}
                          and test {\ifcurrentname{editor}} ) ) }}

One style-specific consideration is the idem abbreviation. In the example it is not set in small capitals. To change this you can redefine the cite:idem bibliography macro.

\renewbibmacro*{cite:idem}{%
  \textsc{\bibstring[\mkibid]{idem\thefield{gender}}}%
  \setunit{\nametitledelim}}
Audrey
  • 28,881
  • It doesn't work for me. I get this error ! Undefined control sequence. \iffirstname ->\ifboolexpr { test {\ifnumequal {\value {listcount}}{1}} and ... What am I doing wrong? I've tried it with my tex file and with the code you've posted in your answer. – Gastón Sep 29 '11 at 14:59
  • @Mario For your attempt with the example I posted - did you use an exact copy of the code? It's generally hard to troubleshoot without more information (MWE, biblatex version, etc). – Audrey Sep 29 '11 at 16:22
  • biblatex version is biblatex.sty,v 0.8i and latex is LaTeX2e I didn't forget to include \def\iffirstname cause I 've made a copy/paste of your code. – Gastón Sep 29 '11 at 16:23
  • @Mario You're definitely in need of an update - the current version is 1.6. If this doesn't fix the problem, feel free to comment/post back here. – Audrey Sep 29 '11 at 16:27
  • 1
    Thank you. I think I need to update texlive, not only biblatex.sty. ;) – Gastón Sep 30 '11 at 03:00
  • Now I have Texlive 2011 and it works! Thank you. One more question: how can I get GOOSSENS, Michel, Frank MITTELBACH instead of GOOSSENS, Michel, Frank Mittelbach? – Gastón Oct 03 '11 at 14:42
  • @Mario Good to hear. I've added some code to the post that should give you this format. – Audrey Oct 03 '11 at 15:44
  • I'm using the citetracker and the problem is that biblatex doesn't keep small caps when op. cit. For example: J. Derrida, op. cit., p. 190 instead of J. DERRIDA, op. cit., p. 190. How can I fix that? – Gastón Oct 22 '11 at 01:34
  • @Mario In the verbose styles names in recurrent citations are taken from the labelname field, not directly from author or editor. Based on your example I assumed you were using the authoryear style. I'll edit the answer shortly. – Audrey Oct 22 '11 at 19:00
  • I'm using verbose-trad1 style. Thank you. – Gastón Oct 22 '11 at 19:04
  • 3
    It would be helpful to edit the answer to use \mkbibnamefamily now that this is required. – jcr Apr 25 '16 at 09:34
  • @jcr, you are my live-safer. I tried to find out what I did wrong for days now, because I knew that the above answer worked in the past. Unfortunately the command \mkbibnamefamily can't be found in the manual (v3.4) so far ... I hope that this will be fixed in v3.5. – Stefan Pinnow Apr 26 '16 at 14:12
  • @StefanPinnow, it is in section 3.9.1 of the manual (p. 104 in my A4 PDF), under \mkbibname‘namepart’. The command is listed just below that, but misspelled \makebibnamefamily (as of v3.4)—this error seems to have already been corrected for the next release. – jcr May 01 '16 at 19:17