5

I have the following problem illustrated by a simple example: If I cite the paper of an author T. Coven in my document, the outcome is 'Coven (2004b)'. If I cite the appendix to this paper, the outcome is 'Coven (2004a)'. Now the appendix pops up much less frequently than the original paper, therefore I would like to reverse the order (exchange 'a' and 'b' in the citations). Is this possible?

I am using Biblatex. Here is the bib-file of the above example (named: lib.bib):

@article{co:2004,
author = {T. Coven},
title = {Title A},
journaltitle = {The X Journal},
date = {2004}
}
@article{coapp:2004,
author = {T. Coven},
title = {Appendix to Title A},
journaltitle = {The X Journal},
date = {2004}
}

MWE:

\documentclass[a4paper, 12pt, headsepline, headings=small,]{scrreprt}
\usepackage[backend=bibtex8,
    style=authoryear-icomp,
    dashed=false,
    autocite=footnote,
    maxcitenames=3,
    mincitenames=1,
    maxbibnames=100,
    firstinits=true,
    sorting=nty
    ]{biblatex}
\bibliography{lib}

\begin{document}
\cite{co:2004} and \cite{coapp:2004}
\end{document}
lockstep
  • 250,273
TomM
  • 1,694
  • 1
  • 19
  • 31

2 Answers2

4

Use the sorttitle field. See section 2.2.3 of the biblatex manual for details.

\documentclass{article}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{co:2004,
author = {T. Coven},
title = {Title A},
journaltitle = {The X Journal},
date = {2004}
}
@article{coapp:2004,
author = {T. Coven},
title = {Appendix to Title A},
sorttitle = {Title A/Appendix},
journaltitle = {The X Journal},
date = {2004}
}
\end{filecontents}

\usepackage[backend=bibtex8,
    style=authoryear-icomp,
    dashed=false,
    sorting=nty
    ]{biblatex}

\addbibresource{\jobname.bib}

\begin{document}

\cite{co:2004} and \cite{coapp:2004}

\printbibliography

\end{document}

enter image description here

lockstep
  • 250,273
4

Well, you will have to adjust the sorting manually by providing some sort of sort... field for biblatex, so it knows how to sort the entries.

You use a authoryear style, but a nty sorting ("name-title-year" sorting), that seems odd. If you want to stick with it, go with the sorttitle field and do something like

@article{coapp:2004,
  author = {T. Coven},
  title = {Appendix to Title A},
  journaltitle = {The X Journal},
  date = {2004},
  sorttitle = {Title A/Appendix},
}

MWE

\documentclass[a4paper, 12pt, headsepline, headings=small,]{scrreprt}
\usepackage{filecontents}
\usepackage[backend=biber,
    style=authoryear-icomp,
    dashed=false,
    autocite=footnote,
    maxcitenames=3,
    mincitenames=1,
    maxbibnames=100,
    firstinits=true,
    sorting=nty,
    ]{biblatex}

\begin{filecontents*}{\jobname.bib}
@article{co:2004,
  author = {T. Coven},
  title = {Title A},
  journaltitle = {The X Journal},
  date = {2004},
}
@article{coapp:2004,
  author = {T. Coven},
  title = {Appendix to Title A},
  journaltitle = {The X Journal},
  date = {2004},
  sorttitle = {Title A/Appendix},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
  \nocite{co:2004,coapp:2004}
  \printbibliography
\end{document}

A more natural sorting choice for a Author-Year style would be sorting=nyt or even sorting=nyvt (sorting by "name-year-title" and "name-year-volume-title" respectively). In that case you could go with

@article{co:2004,
  author = {T. Coven},
  title = {Title A},
  journaltitle = {The X Journal},
  date = {2004},
  sortyear = {2004-1},
}
@article{coapp:2004,
  author = {T. Coven},
  title = {Appendix to Title A},
  journaltitle = {The X Journal},
  date = {2004},
  sortyear = {2004-2},
}

or (thanks again to lockstep)

@article{co:2004,
  author = {T. Coven},
  title = {Title A},
  journaltitle = {The X Journal},
  date = {2004},
}
@article{coapp:2004,
  author = {T. Coven},
  title = {Appendix to Title A},
  journaltitle = {The X Journal},
  date = {2004},
  sortyear = {2004/1},
}

MWE

\documentclass[a4paper, 12pt, headsepline, headings=small,]{scrreprt}
\usepackage{filecontents}
\usepackage[backend=biber,
    style=authoryear-icomp,
    dashed=false,
    autocite=footnote,
    maxcitenames=3,
    mincitenames=1,
    maxbibnames=100,
    firstinits=true,
    sorting=nyt,
    ]{biblatex}

\begin{filecontents*}{\jobname.bib}
@article{co:2004,
  author = {T. Coven},
  title = {Title A},
  journaltitle = {The X Journal},
  date = {2004-1},
}
@article{coapp:2004,
  author = {T. Coven},
  title = {Appendix to Title A},
  journaltitle = {The X Journal},
  date = {2004},
  sortyear = {2004-2},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
  \nocite{co:2004,coapp:2004}
  \printbibliography
\end{document}

Both methods yield

enter image description here

moewe
  • 175,683
  • nice, thanks. Exactly what I needed. I will follow the second suggestion that you have made, using sorting=nyvt. – TomM Dec 31 '13 at 14:15
  • 2
    +1. However, the OP uses backend=bibtex8, which will result in an incorrectly sorted bibliography with sorttitle = {Title A, Appendix}. For the correct result, use sorttitle = {Title A/Appendix}. – lockstep Dec 31 '13 at 14:17
  • @lockstep Nice to know. Thanks for the heads-up. – moewe Dec 31 '13 at 14:18
  • I just noticed the solution for sorting=nyvt doesn't work, maybe also because of backend=bibtex8? – TomM Dec 31 '13 at 14:23
  • @TomM Does it work if you have sortyear for both the entries, such as sortyear={2004-1} for co:2004 and sortyear={2004-2} in coapp:2004? You can always switch to Biber, though; then all the solutions above work properly. – moewe Dec 31 '13 at 14:32
  • @moewe I tried to switch to Biber but it doesn't work. I am using Miktex and yesterday I upgraded all packages, but still I always get errors trying to use Biber with TexStudio, so I gave up on it. Also Bibtex seems to work fine, I cannot see any possible improvements? Edit: using sortyear={2004-2} works! – TomM Dec 31 '13 at 14:34
  • The error is always Undefined control sequence \endentry using biber – TomM Dec 31 '13 at 14:42
  • @TomM I don't know why Biber doesn't work for you right now, but section 2.4 of the biblatex manual provides some examples why you should rather use Biber than BibTeX. – lockstep Dec 31 '13 at 14:45
  • I see. Well the error in more detail is \endentry
    The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), type I and the correct spelling (e.g., I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. If I save as a new tex.file and compile it works, but pops up Could not start the command: biber.exe
    – TomM Dec 31 '13 at 14:47
  • @TomM With backend=bibtex8, use sortyear for both entries as suggested in moewe's last comment. Alternativly, use sortyear={2004/x} (the slash instead a hyphen is crucial). – lockstep Dec 31 '13 at 14:58
  • @TomM If you haven't cleaned the temporary files, you will get the error messages about \endentry and some more on the first run of LaTeX (that's due to old auxiliary files) it is safe to ignore these errors and press on, after a biber run and a further LaTeX run, you're fine. Could not start the command: biber.exe seems more problematic though, check the MikTeX package manager whether biber is actually installed. – moewe Dec 31 '13 at 14:58
  • @moewe thanks for the hint. And I found this: http://tex.stackexchange.com/questions/63039/install-biber-in-miktex-on-a-64-bit-version-of-windows

    Who would have thought that biber is not installed on a x64 Version of Windows? :/

    – TomM Dec 31 '13 at 15:01
  • 1
    @TomM That's all this 32/64 bit business for you. But as noted there, you can install the 32 bit version even if you do use the 64 bit MikTeX. – moewe Dec 31 '13 at 15:04