I’ve produced the calendar below with TikZ but I think the colourings need to be made more salient by shading a box around the coloured dates (as there will be four of these years on a page and the colouring gets drowned out). How can I do that?

\calendar [dates=2012-01-01 to 2012-12-31,
month list,month label left,month yshift=1.25em]
if (Sunday) [black!50]
if (between=2012-08-09 and 2012-08-12)[orange]
if (between=2012-06-01 and 2012-06-03)[orange]
if (between=2012-04-05 and 2012-04-07)[orange]
if (between=2012-12-22 and 2012-12-27)[orange]
if (between=2012-09-10 and 2012-09-15)[blue] 
if (between=2012-08-17 and 2012-08-21)[blue] 
if (between=2012-06-29 and 2012-07-02)[blue] 
if (between=2012-05-14 and 2012-05-21)[blue] 
if (between=2012-11-02 and 2012-11-09)[darkgreen] 
if (between=2012-01-01 and 2012-01-27)[darkgreen] 
  • How can you do what? You could a) use another color, b) use a filling, c) use \contour. – Qrrbrbirlbel Oct 4 '13 at 23:30

Would this be salient enough?


\calendar [
  dates=2012-01-01 to 2012-12-31,
  month list, month label left, month yshift=1.25em,
    text width=width("00"),
    inner xsep=
      .5*\csname tikz@lib@cal@xshift\endcsname-.5*\csname tikz@text@width\endcsname,
    inner ysep=.5*\csname tikz@lib@cal@month@yshift\endcsname-.5*height("0")}
if (Sunday) [days={fill=black!50}]
if (between=2012-08-09 and 2012-08-12)[days={fill=orange}]
if (between=2012-06-01 and 2012-06-03)[days={fill=orange}]
if (between=2012-04-05 and 2012-04-07)[days={fill=orange}]
if (between=2012-12-22 and 2012-12-27)[days={fill=orange}]
if (between=2012-09-10 and 2012-09-15)[days={fill=blue,text=white}]
if (between=2012-08-17 and 2012-08-21)[days={fill=blue,text=white}]
if (between=2012-06-29 and 2012-07-02)[days={fill=blue,text=white}]
if (between=2012-05-14 and 2012-05-21)[days={fill=blue,text=white}]
if (between=2012-11-02 and 2012-11-09)[days={fill=darkgreen}]
if (between=2012-01-01 and 2012-01-27)[days={fill=darkgreen}]


enter image description here

  • Perfect. Thanks. I won't grey fill the Sundays, but otherwise, that's exactly what I wanted. – Daniel Harbour Oct 5 '13 at 1:11
  • Why do I get an error message when I replace \documentclass[12pt,tikz]{standalone} with \documentclass[12pt]{article} \usepackage{tikz}? I'd prefer to stick with article as my document class for the moment. – Daniel Harbour Oct 5 '13 at 10:45
  • The code that causes the error message is days={ ... }. But, commenting it out, you get white space around single-digit days, instead of the continuous box you get with two-digit days. A fast and nasty work around is to replace it with day text=\%d0, making all days two digits long. – Daniel Harbour Oct 5 '13 at 11:08
  • @DanielHarbour The standalone class uses article internally; it is only used in my example to reduce the code to the TikZ example. I don’t get an error with \documentclass[12pt]{article}\usepackage{tikz}. What do you get? Feel free to ask a follow-up question. – Qrrbrbirlbel Oct 5 '13 at 18:57

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.