Monday, February 16, 2009

Creating a Calendar in Linux

Today I found a great program called "pcal". It can create good looking postscript calendars. Most importantly, it can mark holidays in the postscript output if a 'date file' (normally named .calendar) is provided to it.

I created a holiday list in my .calendar file as follows (the * after the dates indicate a holiday):

8/1/09* "Muharram"
23/1/09* "Netaji's Birthday"
26/1/09* "Republic Day"
31/1/09* "Saraswati Puja"
10/3/09* "Fateh-Duaz-Duham"
....

and then used pcal as follows to generate a nice single a4 page calendar for 2009:

pcal -P a4 -o cal2009.ps -E -f .calendar -g holiday -w 2009

Here,
'-P a4' generates output for A4 sheet,
'-o cal2009.ps' names the output file,
'-E' lets pcal know that my "date file" has dates in European format,
'-f .calendar' tells pcal the name of my "date file",
'-g holidays' tells pcal to use a particular color (in my case the default grey) for holidays,
'-w' tells pcal to create a whole year calendar (i.e. a full year on a single page).

No comments: