Students writing a thesis may wish to sort their final bibliography by document type, to separate primary and secondary literature for instance. There are two ways to achieve this with Zotero:
1. Manually (and a little clumsily): by creating collections by document types (for instance book, articles, official documents, case-law), then creating bibliographies for each collection and copying and pasting them at the end of the thesis. Using automated searches allows making it a bit less manual. This bibliography must be created at the very end of the writing process, and it is important not to forget to add any reference added to the text afterward to the bibliography.
2. Automatically (but requires to be a bit tech-savvy): a macro can be implemented into the style to sort the references automatically by document type. The subheadings have to be added manually.
This pdf file contains a detailed explanation of how to proceed: