Debian Codegraph @

texmf-dist/doc/latex/biblatex/examples/16-numeric-prefixed-1.tex

raw
1 %
2 % This file demonstrates how to configure biblatex to prefix
3 % numerical citations with a letter or a string. This will work with
4 % all numerical styles which ship with biblatex. Note that you must
5 % set defernumbers=true globally when using prefixes.
6 %
7 % Since the prefixes are assigned as the bibliography is generated,
8 % you may use any filter supported by biblatex to subdivide the
9 % references (by type, by category, by keyword, etc.).
10 %
11 \documentclass[a4paper,oneside]{article}
12 \usepackage[T1]{fontenc}
13 \usepackage[utf8]{inputenc}
14 \usepackage[american]{babel}
15 \usepackage{csquotes}
16 % When using prefixed numerical labels, the labels must be assigned
17 % as the bibliography is generated. That's why we set
18 % defernumbers=true here:
19 \usepackage[style=numeric,defernumbers,backend=biber]{biblatex}
20 \usepackage{hyperref}
21 \usepackage{nameref}
22 \addbibresource{biblatex-examples.bib}
23 % A catch-all filter for all items which are not assigned to a
24 % dedicated sub-bibliography:
25 \defbibfilter{other}{
26 not type=article
27 and
28 not type=book
29 and
30 not type=collection
31 }
32
33 \begin{document}
34
35 \section*{Prefixed numerical citations}
36
37 % Some citations:
38 \cite{angenendt, kastenholz, augustine, companion, jaffe, ctan}
39
40 \nocite{*}
41
42 % Let's print the overall heading of the bibliography first:
43 \printbibheading
44
45 % And now the sub-bibliographies: we use three of them (based on the
46 % entry type). Each sub-bibliography assigns a different prefix:
47 \newrefcontext[labelprefix={A}]
48 \printbibliography[heading=subbibliography,title={Articles},type=article]
49 \newrefcontext[labelprefix={B}]
50 \printbibliography[heading=subbibliography,title={Books},type=book]
51 \newrefcontext[labelprefix={C}]
52 \printbibliography[heading=subbibliography,title={Collections},type=collection]
53
54 % The catch-all sub-bibliography for all remaining types:
55 \newrefcontext[labelprefix={O}]
56 \printbibliography[heading=subbibliography,title={Other Sources},filter=other]
57
58 \end{document}