2

I'm trying to generate a table of abbreviations from a subset of bibliography entries with short titles. My idea is to use \printbiblist{shorttitle} with a filter so that only references with a certain keyword are included in the table of abbreviations. Unfortunately, the filter isn't being recognized. Here's a MWE:

    \documentclass{book}
    \usepackage[backend=biber]{biblatex}
    \DeclareBibliographyDriver{shorttitle}{%
    \printfield{title}}

    \DeclareBiblistFilter{f1}{
    \filter[type=keyword,filter=Testkey]
    }
    \begin{filecontents}{\jobname.bib}
    @ARTICLE{test1,
        AUTHOR = {John Doe},
        TITLE = {The Extraordinary Life of the Camel},
        SHORTHAND = {JIQ},
        SHORTTITLE = {ELC},
        JOURNALTITLE = {The Journal of Ideas Quarterly},
        VOLUME = {1},
        NUMBER = {1},
        YEAR = {1993},
        KEYWORD = {Testkey}
    }
    @ARTICLE{test2,
        AUTHOR = {James Clark},
        TITLE = {The Fantastic Life of the Giraffe},
        SHORTHAND = {JKQ},
        SHORTTITLE = {FLG},
        JOURNALTITLE = {The Journal of Knowledge Quarterly},
        VOLUME = {1},
        NUMBER = {1},
        YEAR = {1980},
        KEYWORD = {irrelevant}
    }
    \end{filecontents}

    \addbibresource{\jobname.bib}
    \begin{document}
    Title\autocite{test1} and then\autocite{test2}

    \printbiblist[title={Table of Abbreviations},filter=f1]{shorttitle}

    \end{document}

Here I'm trying to use the keyword "Testkey" to determine which items show up in the list of abbreviations, but I just get a "filter not found" error. What am I doing wrong?

1 Answer 1

3

There are several problems with your MWE.

First and foremost, in the .bib file, the field for keywords is called keywords, not keyword, note the s.


A BiblistFilter can only be used as the mandatory argument to \printbiblist and then needs a driver. This is all predefined for shorthand, for other uses you will have to provide your own (as you did for shorttitle).

It cannot be used in the filter argument.

If you want to filter any bibliography list, you will need to declare a a bibfilter via \defbibfilter instead (this is valid for all of those \print... statements), see §3.6.10 Bibliography Filters and Checks, p. 82 for more details. You would probably go with

\defbibfilter{f1}{keyword=Testkey}

and then

\printbiblist[title={Table of Abbreviations},filter=f1]{shortitle}

But if you only want to check for keywords you can go with the keyword option to \printbiblist and just issue

\printbiblist[title={Table of Abbreviations},keyword=Testkey]{shortitle}

no need to declare any filters manually.


If you only want a list of entries with shorttitle & keyword "Testkey", then this BiblistFilter might help (you will need a driver)

\DeclareBiblistFilter{bf1}{
  \filter[type=field,filter=shorttitle]
  \filter[type=keyword,filter=Testkey]
}

Now the question is a philosophical one, whether you want to filter a list of entries with shorttitles, and would go with

\printbiblist[title={Table of Abbreviations},filter=f1]{shortitle}

or even

\printbiblist[title={Table of Abbreviations},keyword=Testkey]{shortitle}

Or if you want to display a list of entries with shorttitle and keyword "Testkey", in which case you need

\printbiblist[title={Table of Abbreviations}]{bf1}

with bf1 as above and a suitable driver.

4
  • This was very helpful and solves my problem. I was wondering if you could briefly explain what the bibliography drivers do and how to properly declare one (the one I used is just a copy from the biblatex documentation). Also, ideally I'd like to filter by author rather than keyword. I've thought of using \addtocategory, but then it seems I would need to enter all the keys manually. Is there any way to automate this so as to produce a filter that includes only certain authors in the biblist?
    – SAG
    Commented May 23, 2015 at 14:39
  • @SAG Filtering by author names is a bit tricky, you can browse around here for some suggestions or ask a new question about that.
    – moewe
    Commented May 24, 2015 at 14:09
  • @SAG The bibliography driver specifies how an entry looks in the bibliography. Writing one is really a non-trivial matter and I don't feel that I could give a brief introduction that is sufficiently worked out.
    – moewe
    Commented May 24, 2015 at 14:20
  • I did figure out how to filer by author using \addtocategory by adapting code from the answer to this question. I may post a question about bibliography drivers at some point.
    – SAG
    Commented May 25, 2015 at 23:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .