\documentclass{article}
\usepackage[a4paper,landscape,margin=0.5in]{geometry}
\usepackage{tikz}
\begin{document}
\thispagestyle{empty}
\begin{center}
\huge
% January - 2023
\begin{tikzpicture}[scale=0.8, every node/.style={scale=0.8}]
\def\daywidth{4cm}
\def\dayheight{3cm}
\def\boxsize{1.75ex}
\def\boxsep{0.4ex}
\def\upperpadding{1.5cm}
\def\monthname{January}
\def\year{2023}
\def\startday{6} % Adjust this value to change the starting day of the week (0 - Sunday, 1 - Monday, etc.)
\def\numdays{31} % Adjust this value based on the actual number of days in the month
\def\daynames{{"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}}
% \node[anchor=north west] at (0.5*\daywidth*\numdays,0.5*\dayheight) {\monthname \ \year};
\foreach \day in {0,1,...,6} {
\node[anchor=north west, minimum width=\daywidth, minimum height=\boxsize, text depth=\boxsep, align=center,draw] at (30+\daywidth*\day, -\upperpadding) {\pgfmathparse{\daynames[\day]}\pgfmathresult};
}
% draw the empty boxes for the days before the first day of the month
\foreach \day in {1,...,\startday} {
\node[anchor=north west, minimum width=\daywidth, minimum height=\dayheight, text depth=\boxsep, align=center, draw] at (30+\daywidth*\day-\daywidth, -\upperpadding-3*\boxsize) {};
}
\foreach \d in {1,...,\numdays} {
\pgfmathsetmacro{\dy}{int((\d-1+\startday)/7)}
\pgfmathsetmacro{\dx}{mod(\d-1+\startday,7)}
\node[anchor=north west,minimum width=\daywidth,minimum height=\dayheight,draw] at (30+\dx*\daywidth,-\upperpadding-\dy*\dayheight- 3*\boxsize) {\d};
}
\end{tikzpicture}
\end{center}
\end{document}
Here is the output:
My question is why changing the \upperpadding variable does nothing. It does not give me an error. But it also does not change anything. Making it 0 or 20 does not matter. I believe the compiler is latexmk.
I am open to any other suggestions regarding this code. This is my first attempt. I may have overcomplicated things.

\begin{tikzpicture}) in the document. For\upperpaddingto make sense, you need something that is not moved. – hpekristiansen Jun 07 '23 at 21:54remember pictureand the specialcurrent pageis used. Quick fix would be to use\path(0,0);to make the origin actually part of your picture. (Or just use\vspace{\upperpadding}before the TikZ picture.) – Qrrbrbirlbel Jun 07 '23 at 21:54calendarlibrary: Q407675 and many others. – Qrrbrbirlbel Jun 07 '23 at 21:59