BibTeX, biblatex and biberChange Citation Label Style

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
enakcm
Posts: 1
Joined: Sat Dec 29, 2012 11:43 pm

Change Citation Label Style

Post by enakcm »

Hi!

I am using BibTex.
I am looking for an easy way to make the citation labels in my text look like this:

[ABC12]

where ABC are the first 3 letters of the author's name and 12 is the year of publishing (like the alpha-style)

I need the "ABC" to be upper-case, even if there is only one author. Is there an easy way to achieve this?

Thanks for your help.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Change Citation Label Style

Post by cgnieder »

Hi enakcm,

Welcome to the LaTeX community!

I rarely use the classic BiBTeX so I can't help there. It is doable with biblatex by redefining the labelalpha template, though:

Code: Select all

\documentclass{article}

\usepackage[backend=biber,style=alphabetic]{biblatex}
\addbibresource{biblatex-examples.bib}

\DeclareLabelalphaTemplate{
  \labelelement{
    \field[uppercase,final]{shorthand}
    \field[uppercase]{label}
    \field[uppercase,strwidth=3,strside=left,ifnames=1]{labelname}
    \field[uppercase,strwidth=1,strside=left]{labelname}
  }
  \labelelement{
    \field[strwidth=2,strside=right]{year}
  }
}

\begin{document}

Text \cite{knuth:ct:a,knuth:ct:b,knuth:ct:c,companion}

\printbibliography

\end{document}
alphabetic.png
alphabetic.png (46.58 KiB) Viewed 4401 times
Regards
site moderator & package author
Post Reply