summaryrefslogtreecommitdiffstatshomepage
path: root/pa2cal.tex
blob: 21a614b5b61e0681fe7f2e0736466f25ffa1ee90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
\documentclass{article}
\usepackage[hidelinks]{hyperref}
\usepackage[letterpaper,margin=0.3in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{enumitem}
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{calendar}
\usetikzlibrary{shapes}
\usetikzlibrary{shapes.geometric}
% \usepackage{xcolor}
% \selectcolormodel{gray}
\renewcommand{\rmdefault}{cmss}
\definecolor{y}{RGB}{227,238,167}
\definecolor{g}{RGB}{127,205,187}
\definecolor{b}{RGB}{54,137,194}

% Define the date highlights
\newcommand{\ward}{\node[fill=y,circle] {};}
\newcommand{\church}{\node[fill=g,circle] {};}
\newcommand{\stake}{\node[fill=b,circle] {};}
\newcommand{\orangedot}{\node[fill=green!70,circle] {};}


\begin{document}
  \title{\vspace{-1cm}Palo Alto 2nd Ward 2019 Year-at-a-Glance\vspace{-1cm}}
  \date{}
  \author{}

  \maketitle
  \thispagestyle{empty} % Remove page numbers and headers
  \makeatletter

  % This way you can define your own conditions, for example, you
  % could make something as `full moon', `even week', `odd week',
  % et cetera. In principle. The math in TeX could be hard.
  \pgfkeys{/pgf/calendar/start of year/.code={%
      \ifnum\pgfcalendarifdateday=1\relax%
          \ifnum\pgfcalendarifdatemonth=1\relax\pgfcalendarmatchestrue\fi%
      \fi%
  }}%

  % Define our own style
  \tikzstyle{week list sunday}=[
      % Note that we cannot extend from week list,
      % the execute before day scope is cumulative
      execute before day scope={%
             \ifdate{day of month=1}{\ifdate{equals=\pgfcalendarbeginiso}{}{
             % On first of month, except when first date in calendar.
                 \pgfmathsetlength{\pgf@y}{\tikz@lib@cal@month@yshift}%
                 \pgftransformyshift{-\pgf@y}
             }}{}%
      },
      execute at begin day scope={%
          % Because for TikZ Monday is 0 and Sunday is 6,
          % we can't directly use \pgfcalendercurrentweekday,
          % but instead we define \c@pgf@counta (basically) as:
          % (\pgfcalendercurrentweekday + 1) % 7
          \pgfmathsetlength\pgf@x{\tikz@lib@cal@xshift}%
          \ifnum\pgfcalendarcurrentweekday=6
              \c@pgf@counta=0
          \else
              \c@pgf@counta=\pgfcalendarcurrentweekday
              \advance\c@pgf@counta by 1
          \fi
          \pgf@x=\c@pgf@counta\pgf@x
          % Shift to the right position for the day.
          \pgftransformxshift{\pgf@x}
      },
      execute after day scope={
          % Week is done, shift to the next line.
          \ifdate{Saturday}{
              \pgfmathsetlength{\pgf@y}{\tikz@lib@cal@yshift}%
              \pgftransformyshift{-\pgf@y}
          }{}%
      },
      % This should be defined, glancing from the source code.
      tikz@lib@cal@width=7
  ]

  % New style for drawing the year, it is always drawn
  % for January
  \tikzstyle{year label left}=[
      execute before day scope={
          \ifdate{start of year}{
              \drawyear
          }{}
      },
      % Right align
      every year/.append style={
          anchor=east,
      }
  ]

  % Style to force giving a month a year label.
  \tikzset{draw year/.style={
      execute before day scope={
          \ifdate{day of month=1}{\drawyear}{}
      }
  }}

  % This actually draws the year.
  \newcommand{\drawyear}{
      \pgfmathsetlength{\pgf@x}{\tikz@lib@cal@xshift}%
      \pgftransformxshift{-\pgf@x}
      % \tikzyearcode is defined by default
      \tikzyearcode
      \pgfmathsetlength{\pgf@x}{\tikz@lib@cal@xshift}%
      \pgftransformxshift{\pgf@x}
  }

  \makeatother

\begin{minipage}{0.28\linewidth}
  % The actual calendar is now rather easy:
  \begin{tikzpicture}[every calendar/.style={
      month label left,
      month text={\textit{\%mt}},
      month yshift=0pt,
      if={(Sunday) [blue!100]},
      week list sunday,
    },
    every day/.style={anchor=base},
    day text={\%d=},rounded corners=0,anchor=base,text height=1ex,text depth=-0.5ex
    ]\small
    \matrix[column sep=0em, row sep=0em] {
      \calendar[dates=2019-01-01 to 2019-12-last]
      if (equals=2019-03-30) {\ward}% Easter Breakfast
      if (equals=2019-05-03) {\ward}% Fathers & Kids Campout
      if (equals=2019-05-04) {\ward}%
      if (equals=2019-07-04) {\ward}% 4th of July Breakfast
      if (equals=2019-10-11) {\ward}% Annual Ward Campout
      if (equals=2019-10-12) {\ward}%
      if (equals=2019-11-30) {\stake}% Christmas Creche
      if (equals=2019-12-01) {\stake}% Christmas Creche
      if (equals=2019-12-02) {\stake}% Christmas Creche
      if (equals=2019-12-03) {\stake}% Christmas Creche
      if (equals=2019-12-04) {\stake}% Christmas Creche
      if (equals=2019-04-06) {\church}% General Conf
      if (equals=2019-04-07) {\church}%
      if (equals=2019-10-05) {\church}% General Conf
      if (equals=2019-10-06) {\church}%
      ; \\
    };
  \end{tikzpicture}

\end{minipage}
\begin{minipage}[t]{0.65\linewidth}
\subsection*{Important Dates}
\begin{itemize}[itemsep=1pt]
  \item[\begin{tikzpicture}\ward\end{tikzpicture}] Mar 30: Easter Breakfast at
    Foothills Park
  \item[\begin{tikzpicture}\church\end{tikzpicture}] Apr 6--7: General Conference
  \item[\begin{tikzpicture}\ward\end{tikzpicture}] May 3--4: Fathers \& Kids
    Campout at Foothills Park
  \item[\begin{tikzpicture}\ward\end{tikzpicture}] Jul 4: 4th of July Breakfast
  \item[\begin{tikzpicture}\church\end{tikzpicture}] Oct 5--6: General Conference
  \item[\begin{tikzpicture}\ward\end{tikzpicture}] Oct 11--12: Annual Ward
    Campout at Huddart Park
  \item[\begin{tikzpicture}\stake\end{tikzpicture}] Nov 30--Dec 4: Christmas
    Crèche Exhibit
\end{itemize}
\end{minipage}

  \begin{center}
    \begin{tabular}{llll}
      \begin{tikzpicture}\ward\end{tikzpicture} Palo Alto 2nd Ward Events &
      \begin{tikzpicture}\stake\end{tikzpicture} Menlo Park Stake Events &
      \begin{tikzpicture}\church\end{tikzpicture} Church-wide Events \\
    \end{tabular}

    \vspace{0.5em}
    Find the full, up-to-date calendar at \url{https://www.lds.org/church-calendar/}

    \vspace{0.3em}
    \footnotesize{This printout was last updated on \today.}
  \end{center}
\end{document}