aboutsummaryrefslogtreecommitdiff
path: root/templates/ef/ordo.tex
blob: 6a298df50f21665e2c49b0ac578dc17ca5823341 (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
% colitur ordo booklet -- LaTeX. flavour: latex
% Build: colitur table --year 2027 --template ordo.tex > ordo.tex && pdflatex ordo.tex &&
%        pdflatex ordo.tex   (twice, so \pageref in the table of contents settles)
%
% A5, one week per page, each day in a framed box with a colour swatch. Every
% fixed string (headings, the Epistle/Gospel/Commemoration/Week labels)
% comes from the view's term vocabulary rather than being written into this
% file, so a translated booklet needs no template edit -- only a different
% --lang.
%
% The observed day's own display name is a PLAIN resolved string
% (View.of_days, Task 5), never a lang-keyed object -- there is no
% dotted-la-with-slug-fallback idiom to write here at all; a day with no
% name in the shipped data still resolves to something printable (its slug,
% under --raw, or the lang table's own miss-echoes-the-key behaviour), so
% the plain name field alone is always enough.
%
% The engine has no parent-path syntax: nested inside a month's own week
% loop, a bare week-number reference finds the WEEK's own number, and there
% is no way to reach the enclosing month's from there. That is why each
% week object carries its own month number and month name fields
% (lib/render/view.ml, Task 5) -- used throughout below instead of a
% parent-path reference, which this engine cannot express.
%
% This template's own %-comments are plain text to the engine: it has no
% awareness of LaTeX's comment syntax, and a stray double-brace pair inside
% one would still be parsed as a tag -- which is why this whole header is
% deliberately written without ever typing two curly braces next to each
% other, even to name a field.
\documentclass[10pt]{article}
% includehead/includefoot: without them geometry seats the text block at
% top=/bottom= and fancyhdr then places the running header/footer OUTSIDE
% that block -- above the top margin and below the bottom one -- which on
% this page's original top=11mm/bottom=12mm pushed the header partly above
% the physical page edge (measured: yMin -5.5pt on a 0..595pt page) and the
% footer to within 1pt of the bottom edge. With includehead/includefoot the
% header/footer live INSIDE top=/bottom= instead, so headsep/footskip are
% also set explicitly (3mm/7mm) rather than left at article's defaults
% (25pt/30pt) -- those defaults alone would still overflow a 10mm margin
% and, measured, silently added 20 extra pages to the whole booklet by
% shrinking every day box. \headheight is left at fancyhdr's own default
% (12pt, confirmed by the log, no "increase \headheight" warning) since a
% single \small header line fits it without complaint.
\usepackage[a5paper,top=10mm,bottom=10mm,inner=14mm,outer=10mm,includehead,includefoot,headsep=3mm,footskip=7mm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{tcolorbox}
\usepackage{fancyhdr}
\usepackage[hidelinks]{hyperref}
\definecolor{licolwhite}{HTML}{FFFFFF}
\definecolor{licolred}{HTML}{C1272D}
\definecolor{licolgreen}{HTML}{2E7D32}
\definecolor{licolviolet}{HTML}{6A1B9A}
\definecolor{licolrose}{HTML}{E91E8C}
\definecolor{licolblack}{HTML}{000000}
% A framed square, always outlined in black regardless of fill -- so white
% (and, on a black background page, black) still reads as a swatch rather
% than a gap. tikz (a tcolorbox dependency already) draws the border; xcolor
% alone cannot outline a filled rule.
\newcommand{\swatch}[1]{\tikz[baseline=-0.6ex]{\fill[draw=black,line width=0.4pt,fill=#1] (0,0) rectangle (2.4ex,2.4ex);}}
\pagestyle{fancy}\fancyhf{}
\fancyhead[C]{\small {{term.ordo}} {{year}} \textperiodcentered\ {{rite}}}
\fancyfoot[C]{\small\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\setlength{\parindent}{0pt}
\begin{document}

\begin{center}
\Large\bfseries {{term.ordo}} {{year}}\\[2pt]
\normalsize\mdseries {{rite}}
\end{center}
\vspace{4mm}
{\bfseries {{term.contents}}}\par\vspace{2mm}
\begin{small}
{{#months}}
\textbf{ {{name}} }\par
{{#weeks}}\hspace*{4mm}{{term.week}} {{num}}\dotfill\pageref{w{{month_num}}-{{num}}}\par
{{/weeks}}
{{/months}}
\end{small}

\clearpage
{{#months}}
{{#weeks}}
\label{w{{month_num}}-{{num}}}
{\bfseries\large {{month_name}} }\hfill{\small {{term.week}} {{num}}}\par\vspace{0.5mm}
{{#days}}
{{#in_month}}
\begin{tcolorbox}[colback=white,colframe=black!35,boxrule=0.4pt,left=1.6mm,right=1.6mm,top=0.4mm,bottom=0.4mm,before skip=0.5mm,after skip=0mm]
{\bfseries {{dom}} } \;\; {\scriptsize {{weekday}} } \hfill \swatch{licol{{colour}}}\par
{\bfseries {{name}} }\par
{\scriptsize {{rank_name}} \textperiodcentered\ {{colour_name}} }\par
{{#first}}{\scriptsize {{term.epistle}}\ {{first}} }\quad{{/first}}{{#gospel}}{\scriptsize {{term.gospel}}\ {{gospel}} }{{/gospel}}
{{#comms}}\par{\scriptsize {{term.commemoration}}\ {{name}} }{{/comms}}
\end{tcolorbox}
{{/in_month}}
{{/days}}
\clearpage
{{/weeks}}
{{/months}}
\end{document}