# biblatex bibliograhy to highlight the first letter of an author beginning a new letter of the alphabet

I want to change the style of the biblography with biblatex but I haven't yet found a way to achieve what I am looking for.

Usually most styles list the authors alaphabetically in the biblography. Authortitle and biblatex-dw do it the same way as biblatex-juradiss, which I am using. What I want the biblography to do is to highlight the first letter of an author and create a gap when a new letter in the alphabet is reached.

I created the following minimal example to show the result I want to achive and the result biblatex produces.

\begin{filecontents*}{lit.bib}
@BOOK{aname,
author = {Aname, Firstname},
title = {Title of the Book}
}

@BOOK{aname2,
author = {AnameSecond, Firstname},
title = {Title of the Book number two}
}

@BOOK{bname,
author = {Bname, Firstname},
title = {Title of the Book}
}

@BOOK{bname2,
author = {BnameSecond, Firstname},
title = {Title of the Book number two}
}

@BOOK{cname,
author = {Cname, Firstname},
title = {Title of the Book}
}

@BOOK{cname2,
author = {CnameSecond, Firstname},
title = {Title of the Book number two}
}
\end{filecontents*}

\documentclass{article}

\usepackage[
backend=biber,
]{biblatex}

\bibliography{lit}

\setlength{\parskip}{6pt}
\setlength{\parindent}{0pt}

\begin{document}

\cites{aname}{aname2}{bname}{bname2}{cname}{cname2}

\section*{Preferred Result}

\textbf{A}name, Fristname, Title of the Book

AnameSecond, Firstname, Title of the Book number two

\vskip 20pt

\textbf{B}name, Fristname, Title of the Book

BnameSecond, Firstname, Title of the Book number two

\vskip 20pt

\textbf{C}name, Fristname, Title of the Book

CnameSecond, Firstname, Title of the Book number two

\printbibliography

\end{document}


• for the gap, have a look at \bibinitsep. Using both the gap and a bold first letter seems a bit redundant by the way. Plus, a single bold letter amidst regular ones isn't going to stand out clearly enough to really facilitate orientation for the reader. – Nils L May 30 '13 at 10:45

The first letter under which each entry is sorted in the bibliography is given by the sortinit field, which can be examined via the \AtEveryBibitem hook. A sortinit field value different from the last item can be set with a different \mkbbibnamelast command that prints the first letter of its argument in boldface. Adding the following to your preamble should give the desired format.

\setlength{\bibinitsep}{5\bibitemsep}

\AtEveryBibitem{%
\iffieldequals{sortinit}{\lastsortinit}
{}
{\let\mkbibnamelast\mkbibinitnamelast%
\savefield{sortinit}{\lastsortinit}}}

\let\mkbibinitnamelast\mkbibnamelast
\patchcmd{\mkbibinitnamelast}{{#1}}{{\firstbold#1\relax}}{}{}
\patchcmd{\mkbibinitnamelast}{{#1}}{{\firstbold#1\relax}}{}{}
\apptocmd{\mkbibinitnamelast}{\global\let\mkbibnamelast\origmkbibnamelast}{}{}

\def\firstbold#1#2\relax{\textbf{#1}#2}
\let\origmkbibnamelast\mkbibnamelast
\def\lastsortinit{}


Note that the biblatex-juradiss bibliography style inherits the last name format from authortitle-dw, which uses a rather complicated definition for \mkbibnamelast. So the bold-first-letter variant, \mkbibinitnamelast, is obtained here via patches.