We would like to use package tagging with xcookybooky to list recipes into categories based on multiple parameters (tags). The desired outcome would be two sections of soups:

a) soup AND meat

b) soup AND vegetable.

The tagging package support sorting with multiple tags, which behaves as OR operator for multiple tags. This results in listing all recipes containing tag soup or meat.

I looked into to package itself, but I do not understand enough to redefine new command which would perform AND operation between two lists.

Original code


How would you apply a filter on multiple tags (tag1 AND tag2) to a list of tagged recipes?

1 Answer 1


To achieve what you want it is necessary to rewrite essential parts of tagging.sty, therefore I suggest to create a file taggingx.sty with the following contents.

% Copyright 2021 Gernot Salzer
% Extension of tagging.sty v1.1.0.1 by Brent Longborough
% For the license, see tagging.sty
% ------------------------------------------------------



    \ifcsname tagged@##1\endcsname



This extension of the original package adds a command


which specifies the number of tags that have to be matched. The default is


which corresponds to the behavior of the original package.

To match two tags at the same time ('and' connective), define the tags and set this value to two.


Example: In the following document, all parts are included that are tagged with soup AND meat.


  Soup with meat.

  Soup with vegetables.

  Soup with meat and vegetables.


enter image description here

You must log in to answer this question.

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