0

I am using mik-tex latex.

I need to reference my sources with capital last names, this definition kinda works

\DeclareNameFormat{}{\uppercase{#1}}

but it does only work if there is only one author. When there are many authors, the last names follow each other, which is not what i want.

It should only print the last name of the first author.

Minimal example:

latex file

\documentclass[
a4paper,
12pt,
ngerman
]{scrreprt}

\usepackage[style=authoryear,backend=bibtex]{biblatex}

\addbibresource{minimal.bib}

% sources should be the last name and in capital letters
\DeclareNameFormat{}{\uppercase{#1}}


\begin{document}

this works \cite{lakos1996large}. This doesn't work \cite{rajkovicusing}.

\nocite{*}

\printbibliography

\end{document}

minimal.bib

@article{lakos1996large,
title={Large-scale C++ software design},
author={Lakos, John},
journal={Reading, MA},
year={1996}
}

@article{rajkovicusing,
title={Using CQRS Pattern for Improving Performances in Medical Information Systems},
author={Rajkovi{\'c}, Petar and Jankovi{\'c}, Dragan and Milenkovi{\'c}, Aleksandar},
year = {2013}
}
  • 2
    Which TeX dialect are you using? It seems that there should be \MakeUppercase... – Przemysław Scherwentke Dec 11 '13 at 16:12
3

Name formats as declared via \DeclareNameFormat are primarily to format the order of name parts (i.e. first last, last first, etc. pp.).

To change the way names are displayed, biblatex provides wrapper macros. So you want to you use

\renewcommand*{\mkbibnamelast}[1]{\MakeUppercase{#1}}

to format last names and

\renewcommand*{\mkbibnamefirst}[1]{\MakeUppercase{#1}}

to format first names. (I have used the LaTeX command \MakeUppercase instead of the TeX \uppercase command. For more on that see Case-changing oddities on the UK List of TeX Frequently Asked Questions on the Web)

You might also want to have a look at

\mkbibnamelast{}
\mkbibnamefirst{}
\mkbibnameprefix{}
\mkbibnameaffix{}

To format last names, first names, name prefixes (such as "von", "van", "de la" etc.) and affixes (such as "Jr.", "Sr.", "III" etc.) respectively.

See § 4.10.1 User-definable Commands and Hooks of the biblatex documentation.

Consider this usage example

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[style=authoryear]{biblatex}

\renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}
\renewcommand*{\mkbibnamefirst}[1]{\textbf{#1}}
\renewcommand*{\mkbibnameprefix}[1]{\MakeUppercase{#1}}
\renewcommand*{\mkbibnameaffix}[1]{\emph{#1}}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{Uthor,
  author = {von Uthor, Jr., Arnold},
  year = {2001},
  title = {The Work},
}
@misc{UthorA,
  author = {Uthor, Arnold},
  year = {2011},
  title = {The Work II},
  subtitle = {Return of the Work},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

enter image description here


Be advised though that all uppercase is typographically and stylistically questionable, your document might benefit from using small caps. Maybe try

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

instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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