diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-20 11:42:25 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-20 11:42:25 +0200 |
| commit | 900d1d781e62a08a1bda1285c8e8611a7baa0f2f (patch) | |
| tree | 621e920076409f74e164cfc15016ad9910bcf40a /templates/ef/ordo.tex | |
| parent | e2e56ac5af290b60ea01037e58e8bc00545c021c (diff) | |
| download | colitur-900d1d781e62a08a1bda1285c8e8611a7baa0f2f.tar.gz colitur-900d1d781e62a08a1bda1285c8e8611a7baa0f2f.zip | |
feat(templates): week headers stop repeating the month name
Every ordo booklet week header used to print the month name again
even though the month heading right above it already established it
-- pure noise, repeated once per week for the whole year. All seven
ordo flavours now print the week's own Roman numeral plus the span of
dates it covers instead, e.g. "Hebdomada I (Ian 1-2)", with no month
name on the line; the LaTeX table of contents and the Typst outline
(built automatically from its own headings, so editing the heading is
the whole fix there) read the same way.
A single-day week (e.g. a lone trailing Sunday) renders "Ian 31", not
"Ian 31-31": each flavour's dash sits inside an inverted single_day
section, so the engine -- which cannot itself compare first_dom to
last_dom -- never has to decide anything, it only follows the data.
The dash character matches each flavour's own existing convention:
LaTeX/Typst's own "--" ligature, groff's \(en escape (alongside its
existing \(bu), HTML's – entity (alongside its existing
·), and a literal en dash for the three flavours with no
escaping (adoc/md/txt).
Every in-template comment describing the new fields is written without
ever typing two curly braces together, including in the two comments
this touches that used to embed a live {{month_name}}/{{term.week}}
tag pair inside a LaTeX % comment -- harmless only because that whole
line already started with %, not because the engine has any comment
awareness (it has none).
Goldens regenerated through test_render_golden.ml's own render path
(Test_view.view_of + Template.render_string), not the CLI -- the two
differ in default language and would otherwise pin output the test
suite never produces. Grid goldens are untouched, matching the grid
templates, which have no week header.
Verified against real pdflatex (two passes) and typst compile output,
not merely the golden pins: both flavours print "Hebdomada I (Ian
1-2)", "Hebdomada II (Ian 3-9)", "Hebdomada III (Ian 10-16)" as their
first three week headers and identical text in the table of
contents/outline, and both show "Hebdomada VI (Ian 31)" for January's
own trailing single-day week with no dash.
Diffstat (limited to 'templates/ef/ordo.tex')
| -rw-r--r-- | templates/ef/ordo.tex | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/templates/ef/ordo.tex b/templates/ef/ordo.tex index a7fcbb3..4ffc9e9 100644 --- a/templates/ef/ordo.tex +++ b/templates/ef/ordo.tex @@ -7,11 +7,13 @@ % the top third of every page and cost 65 pages for a year that needed far % fewer; that requirement is reversed here on purpose, not merely relaxed). % Structure stays scannable through two header weights instead: every -% week still opens with its existing small header line ({{month_name}} . -% {{term.week}} N), and the month's own FIRST week additionally gets a -% large, ruled banner above that line ({{#first}}...{{/first}}, a real -% view field -- lib/render/view.ml -- not template-side arithmetic, since -% this engine has no way to test "is this the first item" any other way). +% week still opens with its own header line -- a Roman week number plus +% the span of in-month dates it covers, e.g. Hebdomada I (Ian 1-2), with +% no month name repeated, since the month heading above already +% establishes it -- and the month's own FIRST week additionally gets a +% large, ruled banner above that line (view field [first], lib/render/ +% view.ml -- not template-side arithmetic, since this engine has no way +% to test "is this the first item" any other way). % \needspace (a genuine, tiny dependency, not one of the deps this project % freezes at the OCaml level -- LaTeX packages are a template author's own % concern) keeps a header from being stranded alone at a page's bottom @@ -68,9 +70,15 @@ % 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. +% week object carries its own month number, month name and abbreviated +% month name fields (lib/render/view.ml) -- used throughout below instead +% of a parent-path reference, which this engine cannot express. The same +% view resolves the week's own Roman numeral too (num_roman, arabic num +% kept alongside it for a tradition that wants it), the day-of-month of +% its first and last in-month day (first_dom/last_dom), and single_day +% (true for a one-day week) -- a punctuation choice (Ian 1 vs Ian 1-2) +% this logic-less engine cannot make for itself, so the template below +% picks the dash only inside an inverted single_day section. % % 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 @@ -127,7 +135,7 @@ \begin{small} {{#months}} \textbf{ {{name}} }\par -{{#weeks}}\hspace*{4mm}{{term.week}} {{num}}\dotfill\pageref{w{{month_num}}-{{num}}}\par +{{#weeks}}\hspace*{4mm}{{term.week}} {{num_roman}} ({{month_abbr}} {{first_dom}}{{^single_day}}--{{last_dom}}{{/single_day}})\dotfill\pageref{w{{month_num}}-{{num}}}\par {{/weeks}} {{/months}} \end{small} @@ -142,7 +150,7 @@ {{/first}} \needspace{16mm} \label{w{{month_num}}-{{num}}} -{\bfseries\large {{month_name}} }\hfill{\small {{term.week}} {{num}}}\par\vspace{0.5mm} +{\bfseries\large {{term.week}} {{num_roman}} }{\small ({{month_abbr}} {{first_dom}}{{^single_day}}--{{last_dom}}{{/single_day}})}\par\vspace{0.5mm} {{#days}} {{#in_month}} \begin{tcolorbox}[colback=white,colframe=black!35,boxrule=0.3pt,left=1.4mm,right=1.4mm,top=0.2mm,bottom=0.2mm,before skip=0.2mm,after skip=0mm] |
