I would like to create a template for a publication list that can then be used by several people. The idea is that there is one bib-file which contains all of the publications. Peer-reviewed entries are marked with the keyword = pr. Then there is the master-file of the type scriptreport in which everyone can integrate their chapter-file in order to merge the publication lists of everybody into one file. The chapter file is the core of everything and should be reusable. It should filter out the entries for the respective author from the bib file and print them out in two lists (peer-reviewed and non-peer-reviewed). My problem is that I don't really know how to filter by author in this case. Here are the rough codes of the two files:




\title{Publication list}




    \printbibliography[keyword={pr}, title={Peer-reviewed}]
    \printbibliography[notkeyword={pr}, title={Non-peer-reviewed}]

Filtering by name isn't that easy. One way would be to use a sourcemap and regex to match names and add keyowrds (e.g. biblatex: separating publications of a specific author in the bibliography).

Another way using string/macro comparison is shown in biblatex: filter out publications from a specific author in the references dynamically. Similar to Make specific author bold using biblatex I'd prefer using hashes instead of string/macro comparison.

The following is an adaptation of my answer https://tex.stackexchange.com/a/416416/35864 for bold names to name filtering. Most of the code from there can simply be copied over, the new thing is to define two bibchecks to filter the bibliography entries by arbitrary conditions.



\def\fnblx@bibfile@name{\jobname -fnblx.bib}

  @comment{Auto-generated file}\blx@nl}


    @misc{fnblx@name@\the\value{fnblx@name}, author = {\unexpanded{#1}}, %
          options = {dataonly=true},}%









\addbfilternames{Emma Sigfridsson}
\printbibliography[check=filternames, title={Works by Emma Sigfridsson}]
\printbibliography[check=notfilternames, title={Works not by Emma Sigfridsson}]

\addbfilternames{{Knuth, Donald E.}}
\printbibliography[check=filternames, title={Works by Donald Knuth}]
\printbibliography[check=notfilternames, title={Works not by Donald Knuth}]

Two filtered bibliographies.

The user interface should be self-explanatory with the usage examples above. If you have any questions about the implementation that aren't covered by https://tex.stackexchange.com/a/416416/35864, please ask ahead in the comments.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.