Templates

Calendar

Preview

Calendar

Monthly and yearly calendar template with TikZ graphics

Category

Other

License

Free to use (MIT)

File

calendar/main.tex

main.texRead-only preview
\documentclass[11pt]{article}
\usepackage[margin=0.75in,landscape]{geometry}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{ifthen}

\definecolor{headerblue}{RGB}{30,80,150}
\definecolor{lightgray}{RGB}{240,240,240}
\definecolor{weekendgray}{RGB}{225,225,235}
\definecolor{todayred}{RGB}{220,50,50}

\pagestyle{empty}

\newcommand{\calmonth}{October}
\newcommand{\calyear}{2025}
\newcommand{\startday}{3} % 0=Sun,1=Mon,...,6=Sat -- October 2025 starts on Wednesday
\newcommand{\totaldays}{31}

\begin{document}

\begin{center}

\begin{tikzpicture}[
    every node/.style={inner sep=0pt, outer sep=0pt},
    dayheader/.style={font=\large\bfseries\color{white}, minimum width=3.4cm, minimum height=1cm, fill=headerblue, text centered},
    daycell/.style={minimum width=3.4cm, minimum height=2.2cm, anchor=north west, draw=gray!60, thick},
    daynum/.style={font=\small\bfseries, anchor=north east},
]

% Title
\node[font=\Huge\bfseries\color{headerblue}] at (11.9, 2) {\calmonth\ \calyear};

% Day-of-week headers
\foreach \d [count=\i from 0] in {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday} {
    \node[dayheader] at (\i*3.4, 0) {\d};
}

% Calendar grid
\pgfmathsetmacro{\startidx}{\startday}
\foreach \day in {1,...,\totaldays} {
    \pgfmathsetmacro{\cellindex}{int(\day - 1 + \startidx)}
    \pgfmathsetmacro{\col}{int(mod(\cellindex, 7))}
    \pgfmathsetmacro{\row}{int(floor(\cellindex / 7))}
    \pgfmathsetmacro{\xpos}{\col * 3.4 - 1.7}
    \pgfmathsetmacro{\ypos}{-0.5 - \row * 2.2}

    % Weekend shading
    \pgfmathsetmacro{\issunday}{ifthenelse(\col == 0, 1, 0)}
    \pgfmathsetmacro{\issaturday}{ifthenelse(\col == 6, 1, 0)}
    \pgfmathparse{int(\issunday + \issaturday)}
    \ifnum\pgfmathresult>0
        \fill[weekendgray] (\xpos, \ypos) rectangle ++(3.4, -2.2);
    \fi

    % Cell border
    \draw[gray!60, thick] (\xpos, \ypos) rectangle ++(3.4, -2.2);

    % Day number
    \node[daynum] at (\xpos + 3.2, \ypos - 0.1) {\day};
}

% Draw empty cells to complete the grid
\pgfmathsetmacro{\lastcell}{int(\totaldays - 1 + \startidx)}
\pgfmathsetmacro{\lastrow}{int(floor(\lastcell / 7))}
\pgfmathsetmacro{\totalcells}{int((\lastrow + 1) * 7 - 1)}

% Fill leading empty cells
\foreach \cell in {0,...,\numexpr\startidx-1\relax} {
    \pgfmathsetmacro{\col}{int(mod(\cell, 7))}
    \pgfmathsetmacro{\xpos}{\col * 3.4 - 1.7}
    \fill[lightgray] (\xpos, -0.5) rectangle ++(3.4, -2.2);
    \draw[gray!60, thick] (\xpos, -0.5) rectangle ++(3.4, -2.2);
}

% Fill trailing empty cells
\pgfmathsetmacro{\firstempty}{int(\totaldays + \startidx)}
\ifnum\firstempty<\numexpr\totalcells+1\relax
    \foreach \cell in {\firstempty,...,\totalcells} {
        \pgfmathsetmacro{\col}{int(mod(\cell, 7))}
        \pgfmathsetmacro{\row}{int(floor(\cell / 7))}
        \pgfmathsetmacro{\xpos}{\col * 3.4 - 1.7}
        \pgfmathsetmacro{\ypos}{-0.5 - \row * 2.2}
        \fill[lightgray] (\xpos, \ypos) rectangle ++(3.4, -2.2);
        \draw[gray!60, thick] (\xpos, \ypos) rectangle ++(3.4, -2.2);
    }
\fi

% Sample events
\node[font=\tiny\color{todayred}, anchor=north west, text width=3cm] at (3*3.4 - 1.7 + 0.15, -0.5 - 0.55) {Team Meeting};
\node[font=\tiny\color{headerblue}, anchor=north west, text width=3cm] at (4*3.4 - 1.7 + 0.15, -0.5 - 0.55) {Project Deadline};

\node[font=\tiny\color{todayred}, anchor=north west, text width=3cm] at (1*3.4 - 1.7 + 0.15, -0.5 - 2.2 - 0.55) {Code Review};

\node[font=\tiny\color{headerblue}, anchor=north west, text width=3cm] at (2*3.4 - 1.7 + 0.15, -0.5 - 2*2.2 - 0.55) {Sprint Planning};

\node[font=\tiny\color{todayred}, anchor=north west, text width=3cm] at (5*3.4 - 1.7 + 0.15, -0.5 - 3*2.2 - 0.55) {Demo Day};

\end{tikzpicture}

\end{center}

\end{document}
Bibby Mascot

PDF Preview

Create an account to compile and preview

Calendar LaTeX Template | Free Download & Preview - Bibby