aboutsummaryrefslogtreecommitdiff
path: root/templates/ef
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-20 09:01:56 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-20 09:01:56 +0200
commit286e362bd02e7ef4130cccb36fbeb16b4fbb5a56 (patch)
treeee6fb2069475a6638f7e14ce89dc0b99e012ab2e /templates/ef
parent6994cb2008263678c183228c97dea673babb6f1e (diff)
downloadcolitur-286e362bd02e7ef4130cccb36fbeb16b4fbb5a56.tar.gz
colitur-286e362bd02e7ef4130cccb36fbeb16b4fbb5a56.zip
fix(templates): clear the wall calendar's class label of the border, add sigla
Problem 1: grid.tex's \daycell pushed the rank/class line to the exact bottom edge of its fixed-height parbox with \vfill, the same edge \hline draws the cell's bottom rule along, so 'I classis'/'IV classis'/'II classis' printed as if sliced by the rule. Fixed by nesting a second, shorter parbox (\cellh minus a new \cellpad, 1.5mm) inside the unchanged \cellh-tall outer one, so the \vfill only ever reaches to \cellpad above the rule, never touching it. \strut on both trailing lines belt-and-suspenders the fix for lines with no descenders. Problem 2: each cell now also carries the day's Epistle and Gospel references (view fields first/gospel), joined by a centred dot/bullet rather than repeated Ep./Ev. labels -- the same compact convention ordo.tex already uses between rank_name and colour_name. A grid cell is only ~3.5cm wide and Holy Week's own citations run 20-30 characters each, so class label and sigla get their own \tiny line apiece rather than being crammed onto one line and shrunk past readability; \cellh leaves about eleven \tiny lines of room, so two short lines cost little. Both first and gospel are wrapped in their own conditional section so a day missing either prints no stray separator (defensive: every day in the shipped EF lectionary has both, but nothing guarantees that of a future rite or overlay). grid.ms gains the same sigla, on their own .br line, using tbl's existing w() wrap rather than any manual line-splitting -- it was never subject to problem 1 (tbl auto-sizes row height, no fixed-height clipping risk) and never carried a class label to begin with, so none was added here. grid.html gains the sigla as a small, muted block-level span; unlike the two paper flavours it isn't boxed onto a fixed physical page, so the browser just grows the cell rather than needing any line-budget compromise. Verified with two pdflatex passes and groff -ms -t -Tpdf against all twelve 2027 months: zero Overfull warnings, 7 columns every row, class label and sigla both fully clear of every rule. test/golden/grid-2027.* regenerated through test_render_golden.ml's own render path (View.of_days + Template.render_string, the EN-with-LA-fallback lang table), not the CLI, per this project's own standing trap about the two tables differing.
Diffstat (limited to 'templates/ef')
-rw-r--r--templates/ef/grid.html18
-rw-r--r--templates/ef/grid.ms17
-rw-r--r--templates/ef/grid.tex43
3 files changed, 73 insertions, 5 deletions
diff --git a/templates/ef/grid.html b/templates/ef/grid.html
index b6ed229..e313f9d 100644
--- a/templates/ef/grid.html
+++ b/templates/ef/grid.html
@@ -5,7 +5,20 @@
ordo.html's own header comment for the full reasoning).
The weekday header row comes from the view's own top-level
weekday_headings list (name/last objects), not a hard-coded
- Dom/Lun/Mar row, so a translated calendar needs no template edit. -->
+ Dom/Lun/Mar row, so a translated calendar needs no template edit.
+ Sigla: each cell also carries the day's Epistle and Gospel
+ references (view fields first/gospel), joined by a middot rather
+ than repeated Ep./Ev. labels, the same compact choice grid.tex and
+ grid.ms make. Unlike those two, this flavour is not squeezed into a
+ fixed-height box on a fixed physical page -- a td here just grows
+ taller to fit whatever it holds -- so no manual line-splitting or
+ size shrinking beyond a small, muted secondary line is needed; that
+ is the sense in which this template can afford to use its own room
+ rather than copy the paper templates' compromise. Both first and
+ gospel are wrapped in their own first/gospel section so a day
+ missing either -- none does in the shipped EF lectionary, but
+ nothing guarantees a future rite or overlay keeps that invariant --
+ prints no stray separator. -->
<!doctype html>
<html lang="la"><head><meta charset="utf-8">
<title>Calendarium {{year}}</title>
@@ -17,6 +30,7 @@
td{border:1px solid #ddd;vertical-align:top;height:5em;width:14.28%;padding:.2em;font-size:.75em}
td.pad{background:#fafafa;border-color:#eee}
.dom{font-weight:bold;display:block}
+ .sigla{display:block;margin-top:.2em;color:#666;font-size:.85em}
.white{background:#fff} .red{background:#fdd} .green{background:#dfd}
.violet{background:#eae} .rose{background:#fde} .black{background:#ddd}
@media print{@page{size:landscape}body{margin:0}}
@@ -27,7 +41,7 @@
<caption>{{name}}</caption>
<tr>{{#weekday_headings}}<th>{{name}}</th>{{/weekday_headings}}</tr>
{{#weeks}}<tr>
- {{#days}}{{#in_month}}<td class="{{colour}}"><span class="dom">{{dom}}</span>{{name}}</td>{{/in_month}}{{^in_month}}<td class="pad"></td>{{/in_month}}{{/days}}
+ {{#days}}{{#in_month}}<td class="{{colour}}"><span class="dom">{{dom}}</span>{{name}}<span class="sigla">{{#first}}{{first}}{{/first}}{{#gospel}}{{#first}} &middot; {{/first}}{{gospel}}{{/gospel}}</span></td>{{/in_month}}{{^in_month}}<td class="pad"></td>{{/in_month}}{{/days}}
</tr>
{{/weeks}}
</table>
diff --git a/templates/ef/grid.ms b/templates/ef/grid.ms
index 2244815..727143b 100644
--- a/templates/ef/grid.ms
+++ b/templates/ef/grid.ms
@@ -78,6 +78,19 @@
.\" Every cell also carries a last flag, true on the seventh of its row: tbl
.\" needs the tab separator BETWEEN columns, not after the last one, and the
.\" engine has no unless-last construct, so the flag comes from data.
+.\"
+.\" Sigla: each cell also carries the day's Epistle and Gospel references
+.\" (view fields first/gospel), on their own .br line below the day/name
+.\" line and joined by \(bu rather than repeated Ep./Ev. labels -- the
+.\" same compact choice grid.tex makes, and the same separator glyph
+.\" ordo.ms already uses elsewhere in this template family. tbl's own
+.\" w() wrap (see above) takes care of a citation too long for the 1.3i
+.\" column; no template-side line-splitting is needed here the way
+.\" grid.tex needed one for its own fixed-height parbox. Both first and
+.\" gospel are wrapped in their own conditional section (mirroring
+.\" ordo.ms's own idiom) so a day missing either -- none does in the
+.\" shipped EF lectionary, but nothing guarantees a future rite or
+.\" overlay keeps that invariant -- prints no stray separator.
.pl 8.27i
.po 0.3i
.nr LL 10.9i
@@ -95,7 +108,9 @@ cw(1.3i) cw(1.3i) cw(1.3i) cw(1.3i) cw(1.3i) cw(1.3i) cw(1.3i)
lw(1.3i) lw(1.3i) lw(1.3i) lw(1.3i) lw(1.3i) lw(1.3i) lw(1.3i).
{{#weekday_headings}}{{name}}{{^last}} {{/last}}{{/weekday_headings}}
{{#weeks}}{{#days}}T{
-{{#in_month}}\fB{{dom}}\fP \s-2{{name}}\s+2{{/in_month}}
+{{#in_month}}\fB{{dom}}\fP \s-2{{name}}\s+2
+.br
+\s-2{{#first}}{{first}}{{/first}}{{#gospel}}{{#first}} \(bu {{/first}}{{gospel}}{{/gospel}}\s+2{{/in_month}}
{{#last}}T}{{/last}}{{^last}}T} {{/last}}{{/days}}
{{/weeks}}.TE
{{/months}}
diff --git a/templates/ef/grid.tex b/templates/ef/grid.tex
index 8f90372..9b7a3ef 100644
--- a/templates/ef/grid.tex
+++ b/templates/ef/grid.tex
@@ -32,6 +32,36 @@
% 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.
+%
+% Border clipping, fixed: the original \daycell put \vfill directly inside
+% the \cellh-tall parbox, so the rank line's own text sat flush against the
+% box's bottom edge -- the identical edge \hline draws the cell's bottom
+% rule along -- and printed as if sliced in half by the rule. The fix
+% keeps the OUTER parbox exactly \cellh tall (every cell in a row must
+% still be identical height, or the table stops being a grid), but nests a
+% SECOND parbox inside it that is only \cellh minus \cellpad tall and
+% carries the actual \vfill. That leaves a strip of \cellpad, genuinely
+% blank, between the last line of content and the rule -- not merely
+% smaller type or a hopeful \strut. \strut on both bottom lines is kept
+% too, belt and suspenders, so a line with no descenders still reserves a
+% descender's worth of depth.
+%
+% Sigla, compactly: each cell also carries the day's Epistle and Gospel
+% references (view fields first/gospel), joined by a centred dot rather
+% than repeating "Ep."/"Ev." labels -- the same choice ordo.tex already
+% made between rank_name and colour_name, kept consistent rather than
+% invented a second way. A cell is only about 3.5cm wide, and Holy Week's
+% own citations run to 20-30 characters each (a Passion narrative spanning
+% several chapters), so "rank_name . first . gospel" does not fit one
+% \tiny line together in the worst case -- measured against the rendered
+% width, not assumed. The rank line and the sigla therefore get their OWN
+% line each rather than being crammed onto one and shrunk past \tiny:
+% \cellh leaves ample vertical room (about eleven \tiny lines per cell),
+% so two short lines cost far less than illegible type would. Both first
+% and gospel are wrapped in their own conditional section (mirroring
+% ordo.tex's own idiom) so a day missing either (there is none in the
+% shipped EF lectionary, but a future rite or overlay is not guaranteed to
+% keep that invariant) prints no stray separator.
\documentclass[11pt,landscape]{article}
\usepackage[a4paper,margin=10mm]{geometry}
\usepackage[T1]{fontenc}
@@ -51,14 +81,23 @@
% 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}}
+\newlength{\cellpad}\setlength{\cellpad}{1.5mm}
+\newcommand{\daycell}[4]{%
+ \parbox[t][\cellh][t]{\cellw}{%
+ \parbox[t][\dimexpr\cellh-\cellpad\relax][t]{\cellw}{%
+ \raggedright\textbf{#1}\ \footnotesize #2\par\vfill
+ \tiny #3\strut\par
+ \tiny #4\strut
+ }%
+ }%
+}
\begin{document}
{{#months}}
{\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}}{{#days}}{{#in_month}}\cellcolor{c{{colour}}}\daycell{ {{dom}} }{ {{name}} }{ {{rank_name}} }{ {{#first}}{{first}}{{/first}}{{#gospel}}{{#first}}\ \textperiodcentered\ {{/first}}{{gospel}}{{/gospel}} }{{/in_month}}{{^last}} & {{/last}}{{/days}} \\ \hline
{{/weeks}}
\end{tabular}
\clearpage