summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-ms/doc/examples/14-references-by-category-ms.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/biblatex-ms/doc/examples/14-references-by-category-ms.tex')
-rw-r--r--macros/latex/contrib/biblatex-ms/doc/examples/14-references-by-category-ms.tex46
1 files changed, 46 insertions, 0 deletions
diff --git a/macros/latex/contrib/biblatex-ms/doc/examples/14-references-by-category-ms.tex b/macros/latex/contrib/biblatex-ms/doc/examples/14-references-by-category-ms.tex
new file mode 100644
index 0000000000..5f76b0dd1c
--- /dev/null
+++ b/macros/latex/contrib/biblatex-ms/doc/examples/14-references-by-category-ms.tex
@@ -0,0 +1,46 @@
+%
+% This example will yield the same output as the 'keywords' example
+% but the approach is different. Instead of adding the filter
+% criteria to the bib file, we assign keys to categories in the
+% document preamble and use 'category' filters to create a
+% subdivided bibliography.
+%
+\documentclass[a4paper,oneside]{book}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage[american]{babel}
+\usepackage{csquotes}
+\usepackage[style=authortitle,backend=biber]{biblatex-ms}
+\usepackage{hyperref}
+\addbibresource{biblatex-examples.bib}
+\DeclareBibliographyCategory{primary}
+\DeclareBibliographyCategory{secondary}
+\addtocategory{primary}{aristotle:anima,aristotle:physics,averroes/bland}
+\addtocategory{secondary}{hyman,moraux,nussbaum,pines}
+\defbibheading{primary}{\section*{Primary Sources}}
+\defbibheading{secondary}{\section*{Secondary Sources}}
+\begin{document}
+
+\chapter{References by category}
+
+This is just filler text.\footcite{aristotle:anima}
+This is just filler text.\footcite{nussbaum}
+This is just filler text.\footcite{averroes/bland}
+This is just filler text.\footcite{hyman}
+This is just filler text.\footcite{aristotle:physics}
+This is just filler text.\footcite{moraux}
+This is just filler text.\footcite{pines}
+
+\printbibheading
+\bibbycategory
+%
+% \bibbycategory processes the categories in the order in which they
+% were declared. Note that the category name also serves as a heading
+% identifier, i.e. you need to define a matching heading for every
+% category. In this document, \bibbycategory is a shorthand for:
+%
+% \printbibliography[heading=primary,category=primary]
+% \printbibliography[heading=secondary,category=secondary]
+% ...
+
+\end{document}