I use termcal for planning lessons and creating syllabi. I usually start by creating a blank calendar for one semester for just specific days of the week, with holidays marked etc. When I finish the plan, I fill in topics, quizzes and exams, homework info and other details for individual days.
A great advantage is that when I teach the same class again, usually I just need to change the starting day and the holidays, and can keep everything else pretty much unchanged.
This is my typical schedule (parts omitted to make it shorter):
\documentclass{article}
\usepackage{termcal}
% Few useful commands (our classes always meet either on Monday and Wednesday
% or on Tuesday and Thursday)
\newcommand{\MWClass}{%
\calday[Monday]{\classday} % Monday
\skipday % Tuesday (no class)
\calday[Wednesday]{\classday} % Wednesday
\skipday % Thursday (no class)
\skipday % Friday
\skipday\skipday % weekend (no class)
}
\newcommand{\TRClass}{%
\skipday % Monday (no class)
\calday[Tuesday]{\classday} % Tuesday
\skipday % Wednesday (no class)
\calday[Thursday]{\classday} % Thursday
\skipday % Friday
\skipday\skipday % weekend (no class)
}
\newcommand{\Holiday}[2]{%
\options{#1}{\noclassday}
\caltext{#1}{#2}
}
\begin{document}
\paragraph*{Tentative Schedule:}
\begin{center}
\begin{calendar}{1/11/2010}{16} % Semester starts on 1/11/2010 and last for 16
% weeks, including finals week
\setlength{\calboxdepth}{.3in}
\TRClass
% schedule
\caltexton{1}{1.1, 1.2 Review}
\caltextnext{1.3, 1.4 Review}
\caltextnext{2.1, 2.2 Linear Equations}
% ... and so on
% Holidays
\Holiday{1/18/2010}{Martin Luther King Day}
\Holiday{3/8/2010}{Spring Break}
% ... and so on
\options{4/26/2010}{\noclassday} % finals week
\options{4/27/2010}{\noclassday} % finals week
\options{4/28/2010}{\noclassday} % finals week
\options{4/29/2010}{\noclassday} % finals week
\options{4/30/2010}{\noclassday} % finals week
\caltext{4/27/2010}{\textbf{Final Exam}}
\end{calendar}
\end{center}
\end{document}
I did a little bit of rtfm and I've come up with some macros for that task.
First, we need to compute the 'day of the year' for a given date, i.e. the number of days that have passed since the beginning of a year with respect to a given date:
\newcount\begincnt
\def\initbegin{%
\pgfcalendardatetojulian{2014-01-01}{\begincnt}
}
\def\doy#1#2{%
\initbegin#1=#2\advance#1by-\begincnt\relax%
}
The initbegin
macro initializes the begincnt
counter to the julian day number (JDN) of the 1st of January we want to use in our calendar.
doy
gets the JDN of a 2014 date as input and sets the counter given as first argument to the day-of-the-year result.
With that we can define a weak of the year (woy) macro:
\def\woy#1#2{%
\doy{#1}{#2}\yearoff{\cnte}{#2}\advance#1by\cnte\divide#1by7\advance#1by1\relax%
}
Again, a result counter is the first argument and 2nd argument is a counter that contains the JDN of a date.
The yearoff
macro returns 2 for a 2014 date - it is needed as 'correction' for years where the first of January is not a Monday. Its code:
\newcount\cntd
\newcount\cnte
\def\myyear{}
\def\mydummy{}
\def\yearoff#1#2{%
\pgfcalendarjuliantodate{#2}{\myyear}{\mydummy}{\mydummy}%
\pgfcalendardatetojulian{\myyear-01-01}{\cntd}%
\pgfcalendarjuliantoweekday{\cntd}{#1}\relax%
}
With that we are (nearly) ready to define a custom pgf-key for ifdate-clauses in PGF- and TikZ-Calendar constructs:
\newcount\cnta
\newcount\cntb
\newcount\cntp
\pgfkeys{/pgf/calendar/modb/.cd,.value required,.code={
\woy{\cnta}{\pgfcalendarifdatejulian}\mod{\cntb}{\cnta}{\cntp}
\ifnum\cntb=#1\relax%
\pgfcalendarmatchestrue%
\fi%
}}
This filter uses another custom macro mod
to compute the modulo (\cntp
contains the number of parties):
\def\mod#1#2#3{%
#1=#2\relax%
\divide#1by#3\relax%
\multiply#1by-#3\relax%
\advance#1by#2\relax%
}
Examples
We can use the filter like this:
On 2014-01-06 the 2nd party is \pgfcalendarifdate{2014-01-06}{modb=1}{not} in charge.
Or in a TikZ-calendar command:
\tikz
\calendar[dates=2014-01-01 to 2014-03-last, week list,month label above centered]
if (modb=2) [nodes={fill=blue!60}]
;
(which colorizes all days where the third party is in charge)
Or as part of a calendar style:
\begin{tikzpicture}[every calendar/.style={
if={(modb=0) [nodes={fill=yellow!60}]}
}
Best Answer
I couldn't resist: Here is one way to draw this with TikZ. To make it nicer to use, there should be some additional wrapper around it, that automatically calculates the horizontal placement of the nodes. Besides that, the code is astonishingly non-verbose.
Of course, you can apply all the power of TikZ to actually make it look better (or worse...). For example, by simply replacing the
\tikzset
withone obtains