I'm writing my own class logbook to organize my work with students along the year. Unfortunately, I encountered troubles to perform a weekly schedule :
Because it'll cover all the year, I want to display only one week over two pages. So I need breakout just afterwards wednesday. But I can't stop the calendar and force it to continue on the next page. And repeating several times untill the end of the year... In the following MWE, i've interrupt after wednesday to begin a new calendar on thursday. Ideally, i do not want make those 52 breaks manually...
Saturday and Sunday do not require grid and take much less space hence they should be displayed one above the other. The remaining space will be accorded for a dedicated "Mémo" space. But the option
day list downward
has no effect in a began calendar. I've to compute them in a third one...Monday has to point the schedule time for the corresponding lines. I've written what monday should be but i'm not able to make it works.
On the lower right corner of the right pages (below Sunday) should be a quarter of a circle to cut it at the end of the week. Like a bookmark. I didn't tackle this issue yet.
Here is what I've written :
\documentclass{book}
\usepackage{tikz}
\usetikzlibrary{calendar}
\pagestyle{empty}
\usepackage{colortbl}
\usepackage[margin=1cm]{geometry}
%%To modify width of the days easier
\newlength{\WeekWidth}
\setlength{\WeekWidth}{6cm}
%%To define start and end of the calendar easier
\def\firstday{2022-09-01}
\def\lastday{2022-09-30}
%%To display the week numbers. I want to restart it after christmas holiday but I'll achieve that later by simply \setcounter for such special dates
\newcounter{SchoolWeek}
\setcounter{SchoolWeek}{0}
%%Command to make the cells for a "normal" working day aka (Tuesday and Friday)
\newcommand\weekday{%
\renewcommand{\arraystretch}{5.6}
\begin{tabular}{|p{\WeekWidth}|}
\hline
\rowcolor{gray!20}\raisebox{30pt}{\centering \%wt - \%d0/\%m0/\%y0} \\[-1.5cm]
\hline
\hline
\rowcolor{white}\\ \hline
\\ \hline\hline
\\ \hline
\\ \hline
\\ \hline
\rowcolor{gray!20}\\ \hline
\\ \hline
\\ \hline
\\ \hline\hline
\rowcolor{gray!20}\\ \hline
\end{tabular}
}
%%Command for Monday. As the first day of the week, it begins with a title - week number and the schedule of each cell for the next days
%% --- Currently, there is a node in the calendar code for the title. It doesn't match with a two column cells for the schedule time....
%% --- I'm not able to achieve a two column cells for monday with the node. So i don't use it.
\newcommand\monday{%
\renewcommand{\arraystretch}{5.6}
\begin{tabular}{|p{1cm}|p{\WeekWidth}|}
\hline
&\rowcolor{gray!20}\raisebox{30pt}{\centering \%wt - \%d0/\%m0/\%y0} \\[-1.5cm]
\hline\hline
\parbox{1cm}{8h25\\ 1\\ 9h15} &\rowcolor{white}\\ \hline
\parbox{1cm}{9h20\\ 2\\ 10h05} &\\ \hline\hline
\parbox{1cm}{10h20\\ 3\\ 11h05} &\\ \hline
\parbox{1cm}{11h10\\ 4\\ 11h55} &\\ \hline
\parbox{1cm}{12h00\\ 5\\ 12h45} &\\ \hline
\rowcolor{gray!20} \parbox{1cm}{12h50\\ 6\\ 13h35} &\\ \hline
\parbox{1cm}{13h40\\ 7\\ 14h25} &\\ \hline
\parbox{1cm}{14h30\\ 8\\ 15h15} &\\ \hline
\parbox{1cm}{15h20\\ 9\\ 16h05} &\\ \hline\hline
& \rowcolor{gray!20}\\ \hline
\end{tabular}
}
\newcommand\wednesday{%
\renewcommand{\arraystretch}{5.6}
\begin{tabular}{|p{\WeekWidth}|}
\hline
\rowcolor{gray!20}\raisebox{30pt}{\centering \%wt - \%d0/\%m0/\%y0} \\[-1.5cm]
\hline
\hline
\rowcolor{white}\\ \hline
\\ \hline\hline
\\ \hline
\\ \hline
\\ \hline\hline
\rowcolor{gray!20}\rule{0pt}{11.14cm}\\ \hline
\end{tabular}
}
%%Command to make special cells for saturday
\newcommand\saturday{%
\renewcommand{\arraystretch}{5.6}
\begin{tabular}{|p{\WeekWidth}|}
\hline
\rowcolor{red!50!gray!20!white}\raisebox{30pt}{\centering \%wt - \%d0/\%m0/\%y0} \\[-1.5cm]
\hline
\hline
\rowcolor{white}\rule{0pt}{9.4cm} \\
\hline
\end{tabular}
}
%%Command to make special cells for sunrday
\newcommand\sunday{%
\renewcommand{\arraystretch}{5.6}
\begin{tabular}{|p{\WeekWidth}|}
\hline
\rowcolor{red!50!gray!20!white}\raisebox{30pt}{\centering \%wt - \%d0/\%m0/\%y0} \\[-1.5cm]
\hline
\hline
\rowcolor{white}\rule{0pt}{10cm} \\
\hline
\hline
\parbox{\WeekWidth}{\textbf{\large Mémo :}\\
\rule{0pt}{2.4cm}}\\\hline
\end{tabular}
}
\begin{document}
%%% Expected code but it doesn't break automatically (and dimension too large, of course)
\def\firstday{2022-09-05}
\def\lastday{2022-09-11}
\begin{tikzpicture}
\calendar (cal)
[dates=\firstday to \lastday,
day list right,
day xshift={\WeekWidth+0.5cm},
day text={\weekday}]
%%% To write the text "Semaine XX - 1st date to last date
%%% --- I've problem to access the last day of the week... aka sunday
if (Monday) {\node at (-1.6,13.5) [anchor=north] {\stepcounter{SchoolWeek} \bfseries \Large \raisebox{-5pt}{\rule{3pt}{20pt}} Semaine \arabic{SchoolWeek} - \%d0/\%m0/\%y0 au \%d0/\%m0/\%y0};}
%%% To cut the noon of Wednesday
%%% --- I've inserted a try-and-see space left to align Wednesday with Tuesday
if (Wednesday) [day text={\wednesday}];
% %%% To write "Important cette semaine : ..............."
% %%% --- I don't have problem here
% if (Thursday) {\node at (1.2,13.5) [anchor=north] {\bfseries \large Important cette semaine : \makebox[10cm]{\em\dotfill}};}
% %%% To write special column for weekend.
% %%% ---- Saturday is a simple box and
% %%% ---- Sunday should be followed by a small box : "Mémo :"
% %%% ---- " day list downward" option does not work
% if (Saturday) [day list downward, day text={\saturday}];
% if (Sunday) [day list downward, day text={\sunday}];
\end{tikzpicture}
%%%Expected left page but dates written manually and monday do not have the first column with the schedule time.
\def\firstday{2022-09-12}
\def\lastday{2022-09-14}
\begin{tikzpicture}
\calendar (cal)
[dates=\firstday to \lastday,
day list right,
day xshift={\WeekWidth+0.5cm},
day text={\weekday}]
%%% To write the text "Semaine XX - 1st date to last date
%%% --- I've problem to access the last day of the week... aka sunday
if (Monday) {\node at (-1.6,13.5) [anchor=north] {\stepcounter{SchoolWeek} \bfseries \Large \raisebox{-5pt}{\rule{3pt}{20pt}} Semaine \arabic{SchoolWeek} - \%d0/\%m0/\%y0 au \%d0/\%m0/\%y0};}
%%% To cut the noon of Wednesday
%%% --- I've inserted a try-and-see space left to align Wednesday with Tuesday
if (Wednesday) [day text={\wednesday}];
%%% To write "Important cette semaine : ..............."
%%% --- I don't have problem here
% if (Thursday) {\node at (1.2,13.5) [anchor=north] {\bfseries \large Important cette semaine : \makebox[10cm]{\em\dotfill}};}
% %%% To write special column for weekend.
% %%% ---- Saturday is a simple box and
% %%% ---- Sunday should be followed by a small box : "Mémo :"
% %%% ---- " day list downward" option does not work
% if (Saturday) [day list downward, day text={\saturday}];
% if (Sunday) [day list downward, day text={\sunday}];
\end{tikzpicture}
%%%Expected right page for Thursday and Friday
%%%Expected left page but dates written manually
\def\firstday{2022-09-15}
\def\lastday{2022-09-16}
\begin{tikzpicture}
\calendar (cal)
[dates=\firstday to \lastday,
day list right,
day xshift={\WeekWidth+0.5cm},
day text={\weekday}]
%%% To write the text "Semaine XX - 1st date to last date
%%% --- I've problem to access the last day of the week... aka sunday
if (Monday) {\node at (-1.6,13.5) [anchor=north] {\stepcounter{SchoolWeek} \bfseries \Large \raisebox{-5pt}{\rule{3pt}{20pt}} Semaine \arabic{SchoolWeek} - \%d0/\%m0/\%y0 au \%d0/\%m0/\%y0};}
%%% To cut the noon of Wednesday
%%% --- I've inserted a try-and-see space left to align Wednesday with Tuesday
if (Wednesday) [day text={\wednesday}];
%%% To write "Important cette semaine : ..............."
%%% --- I don't have problem here
if (Thursday) {\node at (1.2,13.5) [anchor=north] {\bfseries \large Important cette semaine : \makebox[10cm]{\em\dotfill}};}
% %%% To write special column for weekend.
% %%% ---- Saturday is a simple box and
% %%% ---- Sunday should be followed by a small box : "Mémo :"
% %%% ---- " day list downward" option does not work
% if (Saturday) [day list downward, day text={\saturday}];
% if (Sunday) [day list downward, day text={\sunday}];
\end{tikzpicture}
%%%Expected weekend. It should be aside of friday
\def\firstday{2022-09-17}
\def\lastday{2022-09-18}
\begin{tikzpicture}
\calendar (cal)
[dates=\firstday to \lastday,
day list downward, % <---- This line is modified
day xshift={\WeekWidth+0.5cm},
day yshift={12.9cm}, % <--- This line is added to shift Sunday. Otherwise it'll erase Saturday
day text={\saturday}] % <----- This line is modified, without, i've weekday boxes although it's weekend....
%%% To write the text "Semaine XX - 1st date to last date
%%% --- I've problem to access the last day of the week... aka sunday
% if (Monday) {\node at (-1.6,13.5) [anchor=north] {\stepcounter{SchoolWeek} \bfseries \Large \raisebox{-5pt}{\rule{3pt}{20pt}} Semaine \arabic{SchoolWeek} - \%d0/\%m0/\%y0 au \%d0/\%m0/\%y0};}
%%% To cut the noon of Wednesday
%%% --- I've inserted a try-and-see space left to align Wednesday with Tuesday
% if (Wednesday) [day text={\wednesday}];
%%% To write "Important cette semaine : ..............."
%%% --- I don't have problem here
% if (Thursday) {\node at (1.2,13.5) [anchor=north] {\bfseries \large Important cette semaine : \makebox[10cm]{\em\dotfill}};}
%%% To write special column for weekend.
%%% ---- Saturday is a simple box and
%%% ---- Sunday should be followed by a small box : "Mémo :"
%%% ---- " day list downward" option does not work
% if (Saturday) [day text={\saturday}];
if (Sunday) [day text={\sunday}];
\end{tikzpicture}
\end{document}
And here is the draft of the final project :
This question seems a very specifical problem and i understand that it'll touch nobody or near. But as it covers several points, i'm sure someone will be interested of how to deal with one or another problem. In particular, i've never seen some examples of tikz-calendar for several pages calendar which seems current in my opinion.
I'll be glad if you address only one point or suggest me some way to improve my code. I'm on the pgf manual but i didn't seen anything useful for me yet.
Thank you for any help.