summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/biblatex/examples/42-style-alphabetic-template.tex
blob: 1c8bf652dad4037b7bae9c47d40f7c841f16917c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
%
% This file presents the 'alphabetic' style with labels formatted with
% '\DeclareLabelalphaTemplate'.
%
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=alphabetic]{biblatex}
\usepackage{hyperref}
\addbibresource{biblatex-examples.bib}

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

\begin{document}
Filler text \parencite{wassenberg,cicero,companion,kant:kpv,kant:ku,cms,ctan}.
\printbibliography
\end{document}