I am trying to create a list of dates that I can not only use to create a calendar but also use it to output in the document. So far the implementation to display the calendar has been answered by Calendar with tikz

Throughout the document I have a check if the date is a holiday or not. If it is a holiday, then go to the next working day. There are a few examples already but they don't seem to meet my need (perhaps I do not understand the code well enough). The code that most closely represented what I needed can be found here Add (n) working days to a specific date

The issue that i have is that I would like to define the holidays or vacation days only once and using just month and day (like the calendar or first example) as opposed to year, month and day (in the second example).

Note: The dates that I am interested in spans multiple years.

I tried a simple example as follows:

\newcommand{\vacay}{equals=10-31, equals=05-31}

    }{\thisyear-\thismonth-\thisday \, this is a holiday}{\thisyear-\thismonth-\thisday \, is not holiday}
Passing in a holiday array:
}{\thisyear-\thismonth-\thisday \, this is a holiday}{\thisyear-\thismonth-\thisday \, is not holiday}

I am not sure why the second example (passing a holiday array) would not work in this case; or, if there is a better way to share an array of holidays for both a calendar and for text.

1 Answer 1


As always, this is an expansion issue.

The error message says

Package pgfkeys Error: I do not know the key '/pgf/calender/equals=10-31, equals=05-31'

(All conditionals are actually PGFkeys in the /pgf/calendar namespace.)

With a trivial, seemingly unnecessary key


we can remedy this and use this new style with the handler .expand once (or .expanded:

{style/.expand once=\vacay}

We could have done also something like


but the style style is much more user-friendly, in my opinion.




\newcommand*\vacay{equals=10-31, equals=05-31}
Passing normal: \thisyear-\thismonth-\thisday\space is%
    {equals=10-31, equals=05-31}{}{n't}
    a holiday.
Passing in a holiday array: \thisyear-\thismonth-\thisday\space is%
    {style/.expand once=\vacay}{}{n't}
    a holiday.


enter image description here

You must log in to answer this question.

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