%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2012 Robert Krause
% Copyright @COPYRIGHTDATE@ Louis Paternault
% License : Creative Commons Attribution License
%
% Produced by `scal` version @VERSION@.
% http://git.framasoft.org/spalax/scal
%
% Compile it using `lualatex`
%
% History:
% This file has been posted by original author Robert Krause on TeXample.net
% [1] on 13 July 2012. I (Louis Paternault) used it as a base for this
% template, for the scal software.
%
% [1] http://www.texample.net/tikz/examples/a-calender-for-doublesided-din-a4/
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Compile it using LuaLaTeX
%$ lualatex $basename

\documentclass[10pt]{article}

\IfFileExists{hyperref.sty}{
  \usepackage[
    pdftitle={Calendar for years
        2014
        2015
    },
    pdfcreator={LuaLaTeX, using a file generated by `scal` version @VERSION@},
  ]{hyperref}
}{
  % Hyperref not loaded
}

\usepackage{fontspec}
\renewcommand{\familydefault}{\sfdefault}

\usepackage[english]{babel}
\usepackage[english]{translator} % Internationalized  Month and Day names

\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{calendar}

\usepackage[a4paper, landscape, margin=.5cm]{geometry}

\newcommand{\cellwidth}{\textwidth/13}
\newcommand{\cellheight}{\textheight/34}
\newcommand{\cellsep}{2pt}

% Names of Holidays are inserted by employing this macro. Arguments:
% - #1: First day of holidays
% - #2: Holiday name
\def\printholiday#1#2{
    \node [anchor=north west, align=right, text width={\cellwidth-\cellsep-7pt}] at
    ($(cal-#1.north west)$) {\tiny{#2\par}};
}

% Display weeks
% - #1 Day in which week is to be written
% - #2 Week number (as LaTeX code)
\def\printweek#1#2{
    \node [anchor=east, align=center, color=gray] at
    ($(cal-#1.east)$) {{#2\par}};
}

% Display the year. Arguments are:
% - #1: Year
% - #2: First day of year
% - #3: First day of last month of year
\newcommand{\printyear}[3]{
  \draw[fill=red!70, draw=none]
    ($(cal-#1-#2-01.north west)+(0, {2*\cellheight})$)
    rectangle
    ($(cal-#1-#3-01.south east)+(0, {2*\cellheight})$)
    node[midway, text=white]{\textbf{#1}};
}

\pagestyle{empty}

\begin{document}


\begin{center}
\begin{tikzpicture}[every day/.style={anchor = north}]
\pgftransformyshift{\cellheight}
\calendar[
  dates=2014-3-01 to 2015-3-last,
  name=cal,
  day yshift = \cellheight,
  day code=
  {
    \node[name=\pgfcalendarsuggestedname,every day,shape=rectangle,
    minimum height= \cellheight, draw=black, text width = {\cellwidth-\cellsep-7pt}]{};
    \draw ($(\pgfcalendarsuggestedname.west)+(0  em,0)$)           node[anchor=west, color=gray]{\tikzdaytext};
    \draw ($(\pgfcalendarsuggestedname.west)+(1.5em,0)$) node[anchor=west, color=gray]{\footnotesize \pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday}};
  },
  execute before day scope=
  {
    \ifdate{day of month=1}
    {
      % Shift right
      \pgftransformxshift{\cellwidth}
      % Print month name 
      \draw (0,0) node [shape=rectangle, minimum height= \cellheight,
          text width = {\cellwidth-\cellsep-7pt}, fill = red!70, text= white, draw = red!70, text centered]
        {\textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth}}};
    }{}
    \ifdate{workday}
    {
      % normal days are white
      \tikzset{every day/.style={fill=white}}
      % Holidays
    }{}
    % Saturdays
    \ifdate{Saturday}{\tikzset{every day/.style={fill=red!10}}}{}
    % Sundays
    \ifdate{Sunday}{\tikzset{every day/.style={fill=red!20}}}{}
  },
 execute at begin day scope=
  {
    % each day is shifted down according to the day of month
    \pgftransformyshift{-{\cellheight * \number\pgfcalendarcurrentday}}
  }
];

% Print name of Holidays

% Print week numbers
  \printweek{2014-03-05}{10}
  \printweek{2014-03-12}{11}
  \printweek{2014-03-19}{12}
  \printweek{2014-03-26}{13}
  \printweek{2014-04-02}{14}
  \printweek{2014-04-09}{15}
  \printweek{2014-04-16}{16}
  \printweek{2014-04-23}{17}
  \printweek{2014-04-30}{18}
  \printweek{2014-05-07}{19}
  \printweek{2014-05-14}{20}
  \printweek{2014-05-21}{21}
  \printweek{2014-05-28}{22}
  \printweek{2014-06-04}{23}
  \printweek{2014-06-11}{24}
  \printweek{2014-06-18}{25}
  \printweek{2014-06-25}{26}
  \printweek{2014-07-02}{27}
  \printweek{2014-07-09}{28}
  \printweek{2014-07-16}{29}
  \printweek{2014-07-23}{30}
  \printweek{2014-07-30}{31}
  \printweek{2014-08-06}{32}
  \printweek{2014-08-13}{33}
  \printweek{2014-08-20}{34}
  \printweek{2014-08-27}{35}
  \printweek{2014-09-03}{36}
  \printweek{2014-09-10}{37}
  \printweek{2014-09-17}{38}
  \printweek{2014-09-24}{39}
  \printweek{2014-10-01}{40}
  \printweek{2014-10-08}{41}
  \printweek{2014-10-15}{42}
  \printweek{2014-10-22}{43}
  \printweek{2014-10-29}{44}
  \printweek{2014-11-05}{45}
  \printweek{2014-11-12}{46}
  \printweek{2014-11-19}{47}
  \printweek{2014-11-26}{48}
  \printweek{2014-12-03}{49}
  \printweek{2014-12-10}{50}
  \printweek{2014-12-17}{51}
  \printweek{2014-12-24}{52}
  \printweek{2014-12-31}{1}
  \printweek{2015-01-07}{2}
  \printweek{2015-01-14}{3}
  \printweek{2015-01-21}{4}
  \printweek{2015-01-28}{5}
  \printweek{2015-02-04}{6}
  \printweek{2015-02-11}{7}
  \printweek{2015-02-18}{8}
  \printweek{2015-02-25}{9}
  \printweek{2015-03-04}{10}
  \printweek{2015-03-11}{11}
  \printweek{2015-03-18}{12}
  \printweek{2015-03-25}{13}

% Print years
  \printyear{2014}{03}{12}
  \printyear{2015}{01}{03}
\end{tikzpicture}
\end{center}
\end{document}
