Sometime ago I've found a really nice snippet for creating Filofax (tm) organizer A5 calendar pages -- sadly I could not find the original source anymore. Subsequently I've modified it and now I'm looking forward to use it.
However, I couldn't manage to create more then two consistent pages. It would be really nice if I could add a loop so that I could create more then one week at the time. Maybe a month, a year, or even a arbitrary time span.
\documentclass[%
a5paper,
BCOR=2cm,% Space for hole puncher
DIV=25,% Size of textbody
9pt% Fontsize
]{scrbook}
%
%%%%%%%%%% PACKAGES %%%%%%%%%%
%
\usepackage{tabularx,booktabs,multirow}
%\renewcommand*\familydefault{\sfdefault}
%\usepackage{roboto}
\renewcommand{\familydefault}{\sfdefault}
%
%%%%%%%%%% COUNTER %%%%%%%%%%
%
\newcount\counter
\newcount\startdate
\newcount\starttime
\newcount\stoptime
\newcount\sundaybegin
\newcount\week
%
%%%%%%%%%% CUSTOMISATIONS %%%%%%%%%%
%
%% Month
\renewcommand{\month}{March}
%% Date to start the week with
\startdate=13
%% Morning starttime
\starttime=8
%% Evening time
\stoptime=20
%% Starttime sunday
% Min \starttime+1
% Max \stoptime-2
\sundaybegin=14
%% Weeknumber
\week=11
%% Rule width thick
\newcommand{\rulew}{.15em}
%% Extra space
%\setlength{\extrarowheight}{1pt}
%
%%%%%%%%%% DEFINITIONS %%%%%%%%%%
%
\newcommand{\lendt}{\cmidrule[\rulew](l){1-2}\cmidrule[\rulew](l){3-4}\cmidrule[\rulew](l){5-6}}
\newcommand{\lend}{\cmidrule(l){1-2}\cmidrule(l){3-4}\cmidrule(l){5-6}}
\newcommand{\lsun}{\cmidrule(l){1-2}\cmidrule(l){3-4}}
\newcommand{\lsunt}{\cmidrule(l){1-2}\cmidrule(l){3-4}\cmidrule[\rulew](l){5-6}}
\newcommand{\printday}[2]{{\LARGE \textbf{#1}}\,\, \large \textbf{#2}}
\newcommand{\neutralline}{& & & & &}
\newcommand{\footer}{\centering\rule{5.5cm}{\cmidrulewidth} \raisebox{-0.5ex}{\textbf{Dragosh Christian OTTO}} \rule{5.5cm}{\cmidrulewidth}}
\newcommand{\printmonth}{{\LARGE \textbf{\month}}}
%
%%%%%%%%%% TABLE CONTENT LEFT SIDE %%%%%%%%%%
%
% Correction due to \global\advance
\advance\startdate-6
%
\advance\stoptime1
\long\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
%
\def\tabledataleft{} \counter=\the\starttime
\loop
\edef\tabline{\the\counter & & \the\counter & & \the\counter & }
\expandafter\addto\expandafter\tabledataleft\expandafter{\tabline \\\lend}
\expandafter\addto\expandafter\tabledataleft\expandafter{\neutralline \\\lend}
\expandafter\addto\expandafter\tabledataleft\expandafter{\neutralline \\\lend}
\expandafter\addto\expandafter\tabledataleft\expandafter{\neutralline \\\lend}
\advance \counter 2
\ifnum \counter<\the\stoptime
\repeat
%
%%%%%%%%%% TABLE CONTENT RIGHT SIDE %%%%%%%%%%
%
\def\tabledatarightupper{} \counter=\the\starttime
\loop
\edef\tabline{\the\counter & & \the\counter & & & }
\expandafter\addto\expandafter\tabledatarightupper\expandafter{\tabline \\\lend}
\expandafter\addto\expandafter\tabledatarightupper\expandafter{\neutralline \\\lend}
\expandafter\addto\expandafter\tabledatarightupper\expandafter{\neutralline \\\lend}
\expandafter\addto\expandafter\tabledatarightupper\expandafter{\neutralline \\\lend}
\advance \counter 2
\ifnum \counter<\the\sundaybegin
\repeat
%
\advance\sundaybegin1
\def\tabledatarightinter{} \counter=\the\sundaybegin
\newcount\sundaystop
\sundaystop=\the\sundaybegin
\advance\sundaystop1
\loop
\edef\tabline{\the\counter & & \the\counter & & & }
%\expandafter\addto\expandafter\tabledatarightinter\expandafter{\neutralline \\\lsun}
\expandafter\addto\expandafter\tabledatarightinter\expandafter{\neutralline \\\lsun}
\expandafter\addto\expandafter\tabledatarightinter\expandafter{\neutralline \\\lsun}
\advance \counter 2
\ifnum \counter<\the\sundaystop
\repeat
\advance\sundaybegin-1
\advance\sundaystop1
%
\def\tabledatarightlower{} \counter=\the\sundaystop
\loop
\advance \counter 1
\edef\tabline{\the\counter & & \the\counter & & & }
\expandafter\addto\expandafter\tabledatarightlower\expandafter{\neutralline \\\lend}
\expandafter\addto\expandafter\tabledatarightlower\expandafter{\neutralline \\\lend}
\expandafter\addto\expandafter\tabledatarightlower\expandafter{\neutralline \\\lend}
\expandafter\addto\expandafter\tabledatarightlower\expandafter{\tabline \\\lend}
\advance \counter 1
\ifnum \counter<\the\stoptime
\repeat
\advance\sundaystop-1
%
\begin{document}
%
%% Empty page to start left
\thispagestyle{empty}
\mbox{}
\clearpage
%
\pagestyle{empty}
\enlargethispage{1cm}
%
%%%%%%%%%% LEFT TABLE %%%%%%%%%%
%
\noindent
\begin{tabularx}{\linewidth}{lXlXlX}
\multicolumn{6}{l}{\printmonth \hfill Week \the\week}\\[.2em]
\midrule[\rulew]
\addlinespace[.5em]
\multicolumn{2}{l}{\printday{\the\startdate}{Monday}} \global\advance\startdate 1\relax &%
\multicolumn{2}{l}{\printday{\the\startdate}{Tuesday}} \global\advance\startdate 1\relax &%
\multicolumn{2}{l}{\printday{\the\startdate}{Wednesday}}\global\advance\startdate 1\relax \\[1cm]
& & & & & \\\lendt
\tabledataleft
& & & & & \\[1cm]
\midrule[\rulew]
\end{tabularx}
%
\vfill
%\footer
%
\clearpage
\enlargethispage{1cm}
% Correction due to \global\advance
\advance\startdate-6
%
%%%%%%%%%% RIGHT TABLE %%%%%%%%%%
%
\noindent
\begin{tabularx}{\linewidth}{lXlXlX}
\multicolumn{6}{l}{Week \the\week \hfill \printmonth}\\[.2em]\midrule[\rulew]
\addlinespace[.5em]
\multicolumn{2}{l}{\printday{\the\startdate}{Thursday}} \global\advance\startdate 1\relax &%
\multicolumn{2}{l}{\printday{\the\startdate}{Friday}} \global\advance\startdate 1\relax &%
\multicolumn{2}{l}{\printday{\the\startdate}{Saturday}} \global\advance\startdate 1\relax \\[1cm]
& & & & & \\\lendt
\tabledatarightupper
%& & & & & \\\lsunt
\addlinespace[-.15em]
\the\sundaybegin & & \the\sundaybegin & & \multicolumn{2}{l}{\multirow{4}{*}[1.5em]{\printday{\the\startdate}{Sunday}}}\\\lsun
\tabledatarightinter
& & & & & \\\lsun
\the\sundaystop & & \the\sundaystop & & & \\\lsunt
\tabledatarightlower
& & & & & \\\lend
& & & & & \\\lend
& & & & & \\\lend
& & & & & \\[1cm]
\midrule[\rulew]
\end{tabularx}
%
\vfill
%\footer
\end{document}

LuaLaTeX) can't findpgfcalendar-ext.sty. The links 1 and 2 on the suggested linked answer are dead. You suggest that\ifodd\value{page}could be also used. Is it possible to offer also an solution with the standardtexlive-fullpackages? – alex Mar 15 '23 at 07:42tikz-ext, which providespgfcalendar-ext.sty, is a quite new package (first release AFAIK 2022). Since TeX Live packages from Linux distributions are often rather older, I would be surprised iftikz-extwould be offered via the Linux package manager. In Vanilla TeX Live, however, it is included since 2022 and installable viatlmgr. As a last resort, you could install it from CTAN. – cabohah Mar 15 '23 at 07:51tkiz-ext. The package documentation doesn't describe the installation process so I've used this one.. Now there seems to be some bracketting error. I've searched for 15m now and did not find any. If possible, please add an alternative version with\ifodd\value{page}. It could be important to other, unexperienced users (me), to test it. – alex Mar 15 '23 at 08:499ptbyfontsize=9pt. – cabohah Mar 15 '23 at 08:55\newcounter{weeknumber}for the week number which you have to manually set for the first week\setcounter{weeknumber}{11}and then increment it at the end of the week:\ifdate{Monday}{\advance\pgfcalendarcurrentjulian by 2}{\stepcounter{weeknumber}\advance\pgfcalendarcurrentjulian by 3}. – Qrrbrbirlbel Mar 15 '23 at 09:31pgfcalendar-ext.styandpgfcalendar-ext.code.texin the same folder as your main.texfile. The compiler should find them then. – Qrrbrbirlbel Mar 15 '23 at 09:33\usepackage{xfp}for\inteval. – Qrrbrbirlbel Mar 15 '23 at 09:34xfpinto the code with a specific comment for when this is required. Best whishes! – alex Mar 15 '23 at 14:10