Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why remove sorting from \printbibliography? #345

Closed
Ezwen opened this issue Oct 24, 2015 · 8 comments
Closed

Why remove sorting from \printbibliography? #345

Ezwen opened this issue Oct 24, 2015 · 8 comments

Comments

@Ezwen
Copy link

Ezwen commented Oct 24, 2015

I was just wondering: why did the sorting option get removed from \printbibliography? I had found it quite useful to be able to split a bibliography and to have different sorting types.

\newrefcontext is a really cool feature, but it is not made to split a bibliography in different parts, hence it naturally creates problems when using it only to have different sorting orders (eg. inconsistent citation numbers).

Anyway, I was mostly being curious, since I can live without it, but I lost a feature that I liked :). Thanks for the work on biblatex.

@plk
Copy link
Owner

plk commented Oct 24, 2015

Can you give an example of what can't be done now? There should be no loss of functionality, just a syntax change ...

@Ezwen
Copy link
Author

Ezwen commented Oct 24, 2015

Here is an example (xelatex+biber):

\documentclass{article}

\usepackage{biblatex}

\begin{filecontents}{test.bib}
@MISC{ICCPR,
  title = {International Covenant on Civil and Political Rights},
  keywords = {treaty},
  howpublished = {adopted and opened for signature, ratification and accession 16 Dec. 1966, entered into force 23 Mar. 1976},
  note = {999 UNTS 171},
  addendum = {UN. Doc. A/RES/2200(XXI)},
  shortauthor = {ICCPR},
  year = {1976}
}

@MISC{BanjulCharter,
  title = {African (Banjul) Charter on Human and Peoples' Rights},
  keywords = {treaty},
  howpublished = {adopted and opened for signature, ratification and accession 27 June 1981, entered into force 21 Oct. 1986},
  note = {1520 UNTS 217},
  addendum = {OAU Doc. CAB/LEG/67/3 rev. 5},
  shortauthor = {Banjul Charter},
  year = {1986}
}

@MISC{RomeStatute,
  title = {Rome Statute of the International Criminal Court},
  keywords = {treaty},
  howpublished = {adopted and opened for signature, ratification and accession 17 July 1998, entered into force 1 July 2002},
  note = {2187 UNTS 3},
  addendum = {U.N. Doc. A/CONF.183/9},
  shortauthor = {Rome Statute},
  year = {2002}
}

@MISC{AmericanConvention,
  title = {American Convention on Human Rights},
  keywords = {treaty},
  howpublished = {adopted and opened for signature, ratification and accession 22 Nov. 1969, entered into force 18 July 1978},
  note = {1144 UNTS 123},
  shortauthor = {American Convention},
  year = {1978}
}
\end{filecontents} 

\DeclareBibliographyCategory{mycategory} 
\addtocategory{mycategory}{BanjulCharter}
\addtocategory{mycategory}{RomeStatute}

\addbibresource{test.bib}

\begin{document}

Citing ``International Covenant on Civil and Political Rights'' \cite{ICCPR}

Citing ``African (Banjul) Charter on Human and Peoples' Rights'' \cite{BanjulCharter}

Citing ``Rome Statute of the International Criminal Court'' \cite{RomeStatute}

Citing ``American Convention on Human Rights'' \cite{AmericanConvention}


\newrefcontext[sorting=ydnt]
\printbibliography[category=mycategory,title=My Category -- i want ydnt order]
\newrefcontext[sorting=nty]
\printbibliography[notcategory=mycategory,title=Not category -- i want nty order]

\end{document}

Result:
biblatex-example

I want to have two different sortings for the two parts of my bibliography, with all citations already made. What happens is that the reference counter gets confused because of the different ref contexts.

Hence I have twice the reference [2] in the list, and the citations made in the text are not correct either.

If I remember correctly, changing the sorting in \printbibliography did not change the whole ref context, and hence didn't cause these problems. I think?

@plk
Copy link
Owner

plk commented Oct 24, 2015

There are teo things here, firstly, you probably want to use the defernums option to biblatex and you also might want to put the relevant cite commands inside the refcontexts too.

@Ezwen
Copy link
Author

Ezwen commented Oct 31, 2015

I've looked into defernums, and while it is better, it isn't what I'm looking for. And likewise, the problem is that I don't want to split my cite commands.

In a nutshell, I would like to have a complete document with lots of citations (that are put in two different biblatex categories), and at the end of the report I want to display each category with a different sort mode.

Maybe I'm doing something wrong?

@plk
Copy link
Owner

plk commented Oct 31, 2015

It would be best to post this to tex.stackexchange.com as is looks like a normal use case which should work but.

@thorade
Copy link

thorade commented Apr 19, 2018

Sorry to comment on a closed issue:
What would be the syntax now, is there an example?
Could not find one on SE or here:
https://ctan.org/tex-archive/macros/latex/contrib/biblatex/doc/examples

@plk
Copy link
Owner

plk commented Apr 19, 2018

See \begin{refcontext}/\newrefcontext

@moewew
Copy link
Collaborator

moewew commented Apr 19, 2018

@thorade See for example the last code block above (#345 (comment)). There are also quite some questions on TeX.SX (https://tex.stackexchange.com/q/361031/35864 to show only one with a bit of explanation). Please note that it can be risky to mix different sorting schemes (as explained in the linked question).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants