Skip to content

Instantly share code, notes, and snippets.

@sjardim
Created April 1, 2025 13:09
Show Gist options
  • Save sjardim/ee8bf89eef8dc6586dff4904c4c0ef13 to your computer and use it in GitHub Desktop.
Save sjardim/ee8bf89eef8dc6586dff4904c4c0ef13 to your computer and use it in GitHub Desktop.
A full year calendar in A1 paper size, showing US holidays.
% DIN-A1 year calendar
% Author: Robert Krause
% Modified by: Sérgio Jardim (@sjardim)
% License : Creative Commons attribution license
% Submitted to TeXample.net on 13 July 2012
\documentclass[landscape,a1paper,21pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz} % Use the calendar.sty style
\usepackage{fancyhdr} % header and footer
\usepackage{fix-cm} % Large year in header
\usepackage[landscape, headheight = 1cm, margin=0cm,
top = 1.2cm, nofoot]{geometry}
\usetikzlibrary{calc}
\usetikzlibrary{calendar}
\usepackage{verbatim}
\title{Full Year Calendar with Holidays}
\author{jardim.sergio }
\date{December 2024}
\usepackage{PTSansNarrow}
\renewcommand*\familydefault{\sfdefault}
%========= INSTRUCTIONS ============================================
% TO EDIT THE CALENDAR, FOLLOW THE #NUMBERED STEPS (ONLY 3)
% IGNORE THE OTHER SETTINGS UNLESS YOU KNOW WHAT YOU'RE DOING :)
% LINES 32, 55 AND 87
% #01 Set the base year
% \def\year{2025}
\def\calendaryear{2025}
\edef\nextcalendaryear{\number\numexpr\calendaryear+1}
% Names of Holidays are inserted by employing this macro
\def\holiday#1#2{
\node [anchor=north west, text width= 5.9cm] at
($(cal-#1.north west)+(0em, 0em)$) {\tiny{#2}};
}
%Header
\renewcommand{\headrulewidth}{0.0pt}
\setlength{\headheight}{10ex}
%\chead{}
%Footer
\cfoot{\footnotesize\texttt{}}
\definecolor{titlescolor}{RGB}{79,23,168}
\definecolor{holidaycolor}{RGB}{230,208,255}
\begin{document}
\pagestyle{fancy}
\begin{center}
\begin{tikzpicture}[every day/.style={anchor = north}]
\calendar[
% #02 Set the months period (that will appear as columns)
dates=2025-01-01 to 2026-01-31,
name=cal,
day yshift = 1em,
day code=
{
\node[name=\pgfcalendarsuggestedname,every day,shape=rectangle,
minimum height= 1.7cm, text width = 5.9cm, draw = black]{\hskip-.15cm\bfseries\tikzdaytext};
\draw (-9ex, -1.4ex) node[anchor = west]{\tiny%
\pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday}};
},
execute before day scope=
{
\ifdate{day of month=1}
{
% Shift right
\pgftransformxshift{6.4cm}
% Print month name
\draw (0,-.2ex)node [shape=rectangle, minimum height= 1cm,
text width = 5.9cm, fill = titlescolor, text= white, draw = titlescolor, text centered]
{\MakeUppercase{\large\textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth}\strut}}};
}{}
\ifdate{workday}
{
% normal days are white
\tikzset{every day/.style={fill=none}}
}{}
% Saturdays
\ifdate{Saturday}{\tikzset{every day/.style={fill=black!10}}}{}
% Sundays
\ifdate{Sunday}{\tikzset{every day/.style={fill=black!20}}}{}
% Federal Holidays
\ifdate{equals=\calendaryear-01-01}{\tikzset{every day/.style={fill=holidaycolor}}}{}
\ifdate{equals=\calendaryear-01-20}{\tikzset{every day/.style={fill=holidaycolor}}}{}
\ifdate{equals=\calendaryear-02-17}{\tikzset{every day/.style={fill=holidaycolor}}}{}
\ifdate{equals=\calendaryear-05-26}{\tikzset{every day/.style={fill=holidaycolor}}}{}
\ifdate{equals=\calendaryear-06-19}{\tikzset{every day/.style={fill=holidaycolor}}}{}
\ifdate{equals=\calendaryear-07-04}{\tikzset{every day/.style={fill=holidaycolor}}}{}
\ifdate{equals=\calendaryear-09-01}{\tikzset{every day/.style={fill=holidaycolor}}}{}
\ifdate{equals=\calendaryear-10-13}{\tikzset{every day/.style={fill=holidaycolor}}}{}
\ifdate{equals=\calendaryear-11-11}{\tikzset{every day/.style={fill=holidaycolor}}}{}
\ifdate{equals=\calendaryear-11-27}{\tikzset{every day/.style={fill=holidaycolor}}}{}
\ifdate{equals=\calendaryear-12-25}{\tikzset{every day/.style={fill=holidaycolor}}}{}
\ifdate{equals=\nextcalendaryear-01-01}{\tikzset{every day/.style={fill=holidaycolor}}}{}
},
execute at begin day scope=
{
% each day is shifted down according to the day of month
\pgftransformyshift{-1.7*\pgfcalendarcurrentday cm}
}
];
% Print name of Holidays
\holiday{\calendaryear-01-01}{New Year's Day}
\holiday{\calendaryear-01-20}{Martin Luther King Jr. Day}
\holiday{\calendaryear-02-17}{Presidents' Day}
\holiday{\calendaryear-05-26}{Memorial Day}
\holiday{\calendaryear-06-19}{Juneteenth}
\holiday{\calendaryear-07-04}{Independence Day}
\holiday{\calendaryear-09-01}{Labor Day}
\holiday{\calendaryear-10-13}{Columbus Day}
\holiday{\calendaryear-11-11}{Veterans Day}
\holiday{\calendaryear-11-27}{Thanksgiving Day}
\holiday{\calendaryear-12-25}{Christmas Day}
\holiday{\nextcalendaryear-01-01}{New Year's Day}
\end{tikzpicture}
\end{center}
\end{document}
@sjardim
Copy link
Author

sjardim commented Apr 1, 2025

If you compile it on you should get this result (screenshot).
CleanShot 2025-04-01 at 14 10 39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment