0

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

See my MWE please:

\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}
}
\addbibresource{\jobname.bib}
\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?

lockstep
  • 250,273
sceiler
  • 331
  • 1
    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
  • 1
    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
  • I can only advise against changing an otherwise completely logical and well-thought-out sorting scheme for something that might provide ease when writing, but is non-obvious to anyone reading the document, bar you. – moewe Jun 15 '15 at 20:48
  • The whole point, really, of using this kind of software is so that it worries about stuff like the labels and sorting so that you don't have to. In particular, if in another paper you only use OReilly.2005b, you don't really want it to use that label as there will be no a in that case. Similarly, if you find another paper which should go in between the two, you don't want to have to change the b to c in the database. Not to mention if you are asked to switch to numerical labels or a different sort order. Don't hard-code stuff the computer can figure out better... ;) – cfr Jun 15 '15 at 22:05
  • Now that having all been said, there are of course ways to manually influence the sorting of bibliography items, for example could you add a sortyear = {2005-1} to OReilly.2005 and sortyear = {2005-2} to OReilly.2005b. Or you could use the sorttitle field. – moewe Jun 16 '15 at 05:26
  • alright thank you guys. your arguments make perfectly sense. changing the way the bibkeys look like could be messy because I am using a tool for managing all my sources (citavi). I guess I will leave everything as it is. @moewe maybe you should make your comment an answer as it would solve my initial problem – sceiler Jun 16 '15 at 10:36
  • 1
    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
  • @moewe How about the solution below? Seems to be just what was asked for. – Johannes_B Jun 17 '15 at 15:49
  • @Johannes_B I hadn't thought about that. – moewe Jun 18 '15 at 06:00

1 Answers1

1

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.

enter image description here

\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}
\addbibresource{\jobname.bib}
\begin{document}    
this is a busy bee \cite{OReilly.2005},\par
others are laxy leguans \cite{OReilly.2005b}
\printbibliography
\end{document}
Johannes_B
  • 24,235
  • 10
  • 93
  • 248