aboutsummaryrefslogtreecommitdiff
path: root/templates/ef/grid.tex
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-19 23:48:35 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-19 23:48:35 +0200
commitecadd969e1d96918820a1fdac0cf0d520d96ba06 (patch)
treea06ed1160bfd28ae4578d9445242e48ac9ac3ea4 /templates/ef/grid.tex
parent6762ce46af3cb12bc6ae37cda762c5d95add7903 (diff)
parent329d07b49e397cb65ab52e7ca019b47313027136 (diff)
downloadcolitur-ecadd969e1d96918820a1fdac0cf0d520d96ba06.tar.gz
colitur-ecadd969e1d96918820a1fdac0cf0d520d96ba06.zip
feat: naming, localisation and the rebuilt printed output
colitur computed the calendar correctly and could not say what it had computed. A printed ordo read ef-septuagesima-sunday-2 where a reader expects Dominica in Sexagesima, and the wall calendar showed slugs in every cell. lib/naming a language table and a config file, both pure and total, parsing the INI reader Overlay_ini already had lang/ la.ini and en.ini -- 725 names, every one transcribed from the 1962 Missal and citing the line it came from templates the ordo rebuilt as an A5 booklet: one week per page, a table of contents, framed days, a colour swatch; the wall calendar now fills its sheet instead of a quarter of it tools check_citations.py verifies all 400 citations resolve, with 33 self-tests of its own Names resolve through lang -> declared fallback -> the slug, so a partial translation is usable from its first line and the fully degraded case is the old output rather than a blank page. colitur day and colitur readings are BYTE-IDENTICAL to before, verified against main rather than asserted; --lang, --raw and the lang/config subcommands are still to come, and man/colitur-templates.5 still documents the pre-naming view, so writing a custom template needs the source until that lands.
Diffstat (limited to 'templates/ef/grid.tex')
-rw-r--r--templates/ef/grid.tex75
1 files changed, 53 insertions, 22 deletions
diff --git a/templates/ef/grid.tex b/templates/ef/grid.tex
index 51432e9..8f90372 100644
--- a/templates/ef/grid.tex
+++ b/templates/ef/grid.tex
@@ -1,35 +1,66 @@
-% colitur wall calendar -- LaTeX. flavour: latex
+% colitur wall calendar -- A4 landscape, one month per page. flavour: latex
% Build: colitur table --year 2027 --template grid.tex > grid.tex && pdflatex grid.tex
+% This template has no table of contents and no cross-references (unlike
+% ordo.tex), so a single pdflatex pass is enough -- there is nothing for a
+% second pass to resolve.
%
-% Day label falls back to the slug when the day carries no Latin name (most
-% temporal days, and most sanctoral entries, which are Latin-less in the
-% shipped data). The fallback is written as a name-section wrapping a plain
-% var and its inverse, deliberately NOT as a single dotted-path lookup
-% followed by its own inverse: a dotted lookup that misses climbs to the
-% enclosing scope for the WHOLE path, and the month object also carries a
-% same-named key one level up, so the naive form would render the month's
-% own Latin name on every day lacking one, and never fall back at all.
+% The grid must FILL the page, not sit in its top quarter: \arraystretch
+% alone only pads a row's NATURAL height, it cannot make a table taller
+% than its own content wants to be, which is exactly why the previous
+% version floated at the top with the rest of the page blank. The fix is
+% to compute an explicit row height from the text height itself (\cellh
+% below) and give every cell a fixed-height parbox of that size, so the
+% table's total height is dictated by the page, not by its content. Every
+% month in the 1583-9999 domain has either 5 or 6 Sunday-started weeks
+% (never fewer), so dividing the available height by 6 fills at least 5/6
+% of it on a 5-week month and all of it on a 6-week one -- never a quarter.
%
-% Every cell also carries a last flag, true on the seventh of its row: the
-% engine has no unless-last construct, so the separator BETWEEN cells comes
-% from data, not the template. A trailing separator on every cell would give
-% eight columns for seven and pdflatex would reject the file outright.
-\documentclass[10pt,landscape]{article}
+% Real names, not slugs: the observed day's own display name is a PLAIN
+% resolved string (View.of_days, Task 5), interpolated directly as a plain
+% var below -- there is no dotted-la-with-slug-fallback idiom left to
+% write (see ordo.tex's own header comment for the full reasoning; it
+% applies here unchanged).
+%
+% The weekday header row comes from the view's top-level weekday_headings
+% list (name/last objects), not a hard-coded "Dom Lun Mar" row: the engine
+% rejects an EMPTY tag path -- a bare dot inside a section, on its own --
+% as a parse error, so the loop below must name a field on each heading
+% object rather than interpolate the section's own value directly, and a
+% hard-coded row would not be localised anyway. Every cell (day and
+% heading alike) also carries a last flag, true on the seventh of its row:
+% a LaTeX table row needs the ampersand separator BETWEEN cells, not after
+% the last one, and the engine has no unless-last construct, so the flag
+% is data -- rendered only when NOT last. A trailing ampersand gives eight
+% columns for seven cells and pdflatex rejects the file outright.
+\documentclass[11pt,landscape]{article}
\usepackage[a4paper,margin=10mm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[table]{xcolor}
-\definecolor{lwhite}{HTML}{FFFFFF}\definecolor{lred}{HTML}{FFDDDD}
-\definecolor{lgreen}{HTML}{DDFFDD}\definecolor{lviolet}{HTML}{EEAAEE}
-\definecolor{lrose}{HTML}{FFDDEE}\definecolor{lblack}{HTML}{DDDDDD}
+\usepackage{array}
+\definecolor{cwhite}{HTML}{FFFFFF}
+\definecolor{cred}{HTML}{F8DCDC}
+\definecolor{cgreen}{HTML}{DDEEDD}
+\definecolor{cviolet}{HTML}{E6DAF0}
+\definecolor{crose}{HTML}{FADCE8}
+\definecolor{cblack}{HTML}{DCDCDC}
+\setlength{\parindent}{0pt}
+\pagestyle{empty}
+% Seven equal columns filling the text width, and rows stretched so six
+% possible week rows fill the text height -- see the header comment above
+% for why a fixed row height, not \arraystretch, is what makes this work.
+\newlength{\cellw}\setlength{\cellw}{\dimexpr(\textwidth-14\tabcolsep-8\arrayrulewidth)/7\relax}
+\newlength{\cellh}\setlength{\cellh}{\dimexpr(\textheight-18mm)/6\relax}
+\newcommand{\daycell}[3]{\parbox[t][\cellh][t]{\cellw}{\raggedright\textbf{#1}\ \footnotesize #2\par\vfill\tiny #3}}
\begin{document}
{{#months}}
-\section*{ {{name.la}} {{year}} }
-\begin{tabular}{|p{2.6cm}|p{2.6cm}|p{2.6cm}|p{2.6cm}|p{2.6cm}|p{2.6cm}|p{2.6cm}|}
-\hline Dom & Lun & Mar & Mer & Iov & Ven & Sab \\ \hline
-{{#weeks}}{{#days}}{{#in_month}}\cellcolor{l{{colour}}}\textbf{ {{dom}} } \footnotesize {{#name}}{{la}}{{^la}}{{slug}}{{/la}}{{/name}}{{/in_month}}{{^last}} & {{/last}}{{/days}} \\ \hline
+{\LARGE\bfseries {{name}} {{year}}}\par\vspace{2mm}
+\renewcommand{\arraystretch}{1}
+\begin{tabular}{|*{7}{p{\cellw}|}}\hline
+{{#weekday_headings}}\textbf{ {{name}} }{{^last}} & {{/last}}{{/weekday_headings}} \\ \hline
+{{#weeks}}{{#days}}{{#in_month}}\cellcolor{c{{colour}}}\daycell{ {{dom}} }{ {{name}} }{ {{rank_name}} }{{/in_month}}{{^last}} & {{/last}}{{/days}} \\ \hline
{{/weeks}}
\end{tabular}
-\newpage
+\clearpage
{{/months}}
\end{document}