[Tex/LaTex] Weekday captions with the TikZ library “calendar”


I use the TikZ library calendar to produce a week list. The code looks like this:



    \tikz\calendar[dates=2011-02-01 to 2011-02-last,week list];

However, I want to add abbreviated captions for the weekdays (M, T, W, …) in the first line of the week list:

 M  T  W  T  F  S  S
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27

I couldn't find any option to the \calendar macro which produces this effect. Is there any other solution to achieve my goal?

Best Answer

There's no way of doing this with a single option, but the following code is a way of getting the weekday headings in a way that keeps all options of the week list calendar. It adds the style day letter headings (which in this form only makes sense to use with the week list style). The style of the headings can be set with the option day headings.



\tikzoption{day headings}{\tikzstyle{day heading}=[#1]}
\tikzstyle{day heading}=[]
\tikzstyle{day letter headings}=[
    execute before day scope={ \ifdate{day of month=1}{%
      \foreach \d/\l in {0/M,1/T,2/W,3/T,4/F,5/S,6/S} {
        \node[every day,day heading]{\l};%


    \tikz\calendar[dates=2011-02-01 to 2011-04-last,
        week list,
        month label above centered,
        day xshift = 0.8cm,
        day headings=orange,
        day letter headings

Week list calendar with single letter day headings