| 1 |
\documentclass[a4paper]{article} |
| 2 |
\usepackage{fontspec} |
| 3 |
\usepackage{csquotes} |
| 4 |
\usepackage[style=numeric, sorting=none, defernumbers=true, backend=biber]{biblatex-ms} |
| 5 |
\addbibresource{biblatex-examples.bib} |
| 6 |
|
| 7 |
\DeclareBibliographyCategory{cat1} |
| 8 |
\addtocategory{cat1}{yoon} |
| 9 |
\DeclareBibliographyCategory{cat2} |
| 10 |
\addtocategory{cat2}{piccato} |
| 11 |
\assignrefcontextcats[sorting=none,labelprefix=Q]{cat2} |
| 12 |
\assignrefcontextentries[labelprefix=Q]{yoon} |
| 13 |
\assignrefcontextkeyws*[sorting=none,labelprefix=S]{secondary} |
| 14 |
\defbibfilter{cats}{category=cat1 or category=cat2} |
| 15 |
|
| 16 |
\DeclareRefcontext{rcone}{labelprefix=R} |
| 17 |
\DeclareRefcontext{rctwo}{labelprefix=T} |
| 18 |
\DeclareRefcontext{rcthree}{sorting=nty} |
| 19 |
|
| 20 |
\setlength{\parindent}{0pt} |
| 21 |
\newcommand{\cmd}[1]{\texttt{\textbackslash #1}} |
| 22 |
\begin{document} |
| 23 |
This example demonstrates the quite complex options for assigning |
| 24 |
labelprefices to bibliographies and how citations decide which bibliography |
| 25 |
to point to. The default rule is that a citation will point to its entry in |
| 26 |
the last bibliography in which it appears. This can be overridden by |
| 27 |
explicit assignment to particular refcontexts with the |
| 28 |
\cmd{assignrefcontext*} macros.\\ |
| 29 |
|
| 30 |
% refcontext=none/global//global/global |
| 31 |
|
| 32 |
This is a publication by Aristotle: |
| 33 |
\cite{aristotle:anima} % comes from refcontext=none/global/R/global/global |
| 34 |
|
| 35 |
These are not publications by Aristotle: |
| 36 |
\cite{yoon} % comes from default refcontext=none/global/Q/global/global due |
| 37 |
% to \assignrefcontextentries |
| 38 |
\cite{worman} % comes from default refcontext=nty/global//global/global and not from |
| 39 |
% nty/global/T/global/global in next refsection even though that is the |
| 40 |
% last printed bib/biblist with worman in it. This is because |
| 41 |
% refcontext defaults are local to refcontexts |
| 42 |
\cite{piccato} % comes from refcontext=none/global/Q/global/global due to \assignrefcontextcats |
| 43 |
\cite{nussbaum} % comes from refcontext=none/global/S/global/global due to \assignrefcontextkeyws* |
| 44 |
|
| 45 |
This is another publication by Aristotle: |
| 46 |
\cite{aristotle:physics} % comes from refcontext=none/global/R/global/global |
| 47 |
|
| 48 |
\begin{refcontext}{rcone} |
| 49 |
% refcontext=none/global/R/global/global |
| 50 |
\printbibliography[keyword=primary, title={Aristotle Publications}] |
| 51 |
% aristotle:anima and aristotle:physics default refcontext is this one |
| 52 |
\end{refcontext} |
| 53 |
|
| 54 |
% Alternative style of specifying refcontext |
| 55 |
% Note here that the optional argument to \newrefcontext overrides the |
| 56 |
% value set with the named refcontext |
| 57 |
\newrefcontext[labelprefix=S]{rctwo} |
| 58 |
% refcontext=none/global/S/global/global |
| 59 |
\printbibliography[notkeyword=primary, title={Other publications}] |
| 60 |
\endrefcontext |
| 61 |
|
| 62 |
\begin{refcontext}[labelprefix=Q] |
| 63 |
% refcontext=none/global/Q/global/global |
| 64 |
\printbibliography[filter=cats, title={Other publications}] |
| 65 |
\end{refcontext} |
| 66 |
|
| 67 |
\begin{refcontext}[sorting=nty] |
| 68 |
% refcontext=nty/global//global/global |
| 69 |
\printbibliography[resetnumbers, notkeyword=primary, title={More Other publications}] |
| 70 |
% Nussbaum default refcontext is this one |
| 71 |
% piccato default refcontext is this one |
| 72 |
% yoon default refcontext is this one |
| 73 |
% worman default refcontext is this one |
| 74 |
\cite{nussbaum} % comes from refcontext=nty/global//global/global due to weak \assignrefcontextkeyws* |
| 75 |
\end{refcontext} |
| 76 |
|
| 77 |
\section*{New Refsection} |
| 78 |
\newrefsection |
| 79 |
\cite{worman} % comes from default refcontext=nty/global/T/global/global |
| 80 |
\begin{refcontext}[labelprefix=T]{rcone} |
| 81 |
% refcontext=nty/global//global/global |
| 82 |
\printbibliography[resetnumbers, notkeyword=primary, title={More Other publications}] |
| 83 |
\end{refcontext} |
| 84 |
|
| 85 |
\end{document} |