# biblatex keys inside editor are not equal to printed bib keys

I have a discrepancy between the bib keys I write inside my LaTeX editor and the printed bib keys.

\documentclass[fontsize=12pt,a4paper,oneside,
listof=totoc,                   % Tabellen- und Abbildungsverzeichnis ins Inhaltsverzeichnis
bibliography=totoc,             % Literaturverzeichnis ins Inhaltsverzeichnis aufnehmen
titlepage,                      % Titlepage-Umgebung statt \maketitle
headsepline,                    % horizontale Linie unter Kolumnentitel
%abstracton,                    % Überschrift beim Abstract einschalten, Abstract muss dazu in {abstract}-Umgebung stehen
DIV12,                          % auskommentieren, um den Seitenspiegel zu vergrößern
BCOR=0mm,                       % Bindekorrektur, die den Seitenspiegel um 6mm nach rechts verschiebt. geometry package überschreibt diesen Wert
]{scrreprt}

\usepackage[ngerman]{babel}     % deutsche Trennungsregeln und Übersetzung der festcodierten Überschriften
\usepackage[style=authoryear, backend=biber, isbn=false, doi=false, maxcitenames=2, uniquename=false, maxbibnames=10]{biblatex} %sorting=none if not alphabetically, maxcitenames, maxbibnames

\begin{filecontents}{\jobname.bib}
@misc{OReilly.2005,
author = {O'Reilly, Tim},
year = {2005},
title = {What Is Web 2.0: Design Patterns and Business Models for the Next Generation of Software}
}
@misc{OReilly.2005b,
author = {O'Reilly, Tim},
year = {2005},
title = {Web 2.0: Compact Definition}
}
\end{filecontents}
\begin{document}
\cite{OReilly.2005}
\cite{OReilly.2005b}
\printbibliography
\end{document}


My first citation points to the second bib entry inside the compiled pdf and vice versa. Reading the compiled pdf is no problem in this case but it confusing the heck out of me when I write.

I guess biblatex is doing this because it is sorting the bib entriey alphabetically... I would expect this behavior:

\cite{OReilly.2005} => OReilly 2005a

\cite{OReilly.2005b} => OReilly 2005b

Is this changeable without a lot of effort or am I doing something wrong here?

• The internal names of your citations (the bibkeys, i.e. OReilly.2005b) normally have no bearing whatsoever on the actual output in the citation. And indeed, because the title of OReilly.2005b is lexicographically smaller than that of OReilly.2005 (while author and year are the same), the former is sorted before the latter and thus gets the "a". – moewe Jun 15 '15 at 20:34
• To your question: You can change the sorting behaviour, though I'm not quite sure what you would actually want to change in this instance. Do you just want OReilly.2005 to be "a" even at the cost of making your bibliography unintuitive and confusing? Is there a very compelling reason for doing this? Or is there a deeper sorting scheme you want implemented? – moewe Jun 15 '15 at 20:36
• It is confusing me because when I type\cite{OReilly.2005} inside my editor it is printed differently in my compiled pdf. Similarily typing \cite{OReilly.2005b} would result in O'Reilly 2005 which is the key for the first one :/ – sceiler Jun 15 '15 at 20:40
• If your only source of sorrow with this set-up is confusion while composing a document, you might consider making your entry keys meaningful, so drop the a/b disambiguation and go for something that describes the title or content. E.g. OReilly.2005.WhatIs or OReilly.2005.PatternModels vs. OReilly.2005.Compact, or something along those lines. – moewe Jun 15 '15 at 20:42
• OK, in that case I'm rather inclined to vote to close as a duplicate of Reverse citation order of two library entries which seems to deal with a quite similar problem. Where we discuss sorttitle and sortyear. – moewe Jun 16 '15 at 19:20

Many arguments came up agaisnt this, a pure modification to ease writing. But why not? biblatex provide a sorting scheme just for debugging. Take care to remove that option before submitting.

\documentclass{scrartcl}
\usepackage[style=authoryear,backend=biber,
isbn=false, doi=false,
maxcitenames=2, uniquename=false, maxbibnames=10,
sorting=debug
]{biblatex}

\begin{filecontents}{\jobname.bib}
@misc{OReilly.2005,
author = {O'Reilly, Tim},
year = {2005},
title = {What Is Web 2.0: Design Patterns and Business Models for the Next Generation of Software}
}
@misc{OReilly.2005b,
author = {O'Reilly, Tim},
year = {2005},
title = {Web 2.0: Compact Definition}
}
\end{filecontents}