Take the 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'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.

share|improve this question
add comment

1 Answer

up vote 12 down vote accepted

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}}
share|improve this answer
 
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 3:00
show 6 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
http://tex.stackexchange.com/questions/29861/set-authors-last-name-in-small-caps-but-avoid-them-for-editors-translators-et/29862
tex.stackexchange.com
crawl=CC-MAIN-2013-48
67134
application/http; msgtype=response
sha1:4G2JGGXYW2EUWMWEJMKACFB7BDCJRRND
<urn:uuid:4f63afc7-a643-4f83-9bc8-750654018f91>
2013-12-18T10:20:00Z
198.252.206.16
sha1:LTYAPYU5SFSBSTGBUHX3A6NJ7A5MJC7P
<urn:uuid:44325fae-24e2-4663-bcd0-575eefc361a0>
http://tex.stackexchange.com/questions/29861/set-authors-last-name-in-small-caps-but-avoid-them-for-editors-translators-et/29862
response
<urn:uuid:a1d28804-8361-44a4-9a06-8124a2a212a5>
robots: classic
hostname: ip-10-33-133-15.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2013-48
operator: CommonCrawl Admin
description: Wide crawl of the web with URLs provided by Blekko for Winter 2013
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf