aboutsummaryrefslogtreecommitdiff
path: root/templates/ef/ordo.tex
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-20 12:47:29 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-20 12:47:47 +0200
commitaaca1304e9d00880b016d14529cf3809bd98fe39 (patch)
treedf6b1fcef4edb50277a3c312854033eaaf04b89b /templates/ef/ordo.tex
parent900d1d781e62a08a1bda1285c8e8611a7baa0f2f (diff)
downloadcolitur-aaca1304e9d00880b016d14529cf3809bd98fe39.tar.gz
colitur-aaca1304e9d00880b016d14529cf3809bd98fe39.zip
feat(templates): retune ordo.tex to ordo.typ's density, fix ordo.ms's own
ordo.tex was 53 pages / 6.9 days-per-page on 2027 against ordo.typ's 27 pages / 13.5 -- the user prefers the tighter Typst booklet. Read ordo.typ's own typographic decisions (base size, the day-number/name/detail-line size hierarchy, box padding, inter-box skip, leading) and matched them: an explicit 9pt/10.5 base (was \normalsize, 10pt), the day number and feast name both 9pt bold (bold distinguishes them, not size, as ordo.typ decided), 7pt weekday, 6.5pt detail lines, sharp-cornered boxes, and needspace amounts re-measured for the shorter boxes. Result: 29 pages / 12.6 days-per-page -- within the "a page or two of 27" target, reached without sacrificing legibility (verified against the rendered PDF, not assumed). The one real gotcha: \fontsize set inside a brace group that closes before the line-ending \\ has no effect on the interline glue TeX inserts for that break -- the glue uses the OUTER scope's \baselineskip, not the just-closed group's. This is exactly the shape of bug the pre-retune box already had (every \fontsize group closed before its own \par), which is why the first retune pass barely moved the page count. Fixed by declaring \fontsize/ \selectfont/\bfseries/\mdseries inline, ungrouped, immediately before the text each governs. Recorded in the file's own header for next time. ordo.ms looked comparatively fine (43 pages) but was rendering on A4, not A5 -- roughly double an A5 page's area, so normalised for area it was already looser than ordo.tex's own pre-retune baseline. Fixed, each found by rendering and reading the real PDF rather than assumed: added -P-pa5 to the Makefile's groff invocation (mirroring grid.ms's existing -P-pa4l); fixed the day box reading the RAW rank/colour strings (class-2, green) instead of the resolved Latin pair (rank_name/colour_name) -- exactly the "printed slugs" defect the ordo rebuild's own commit message named, which this file had regressed to; added -Kutf8 (groff's default input encoding produced visible mojibake on an accented Latin name); tightened fonts/ leading the same way as ordo.tex; found and fixed a stray-blank-line bug present since the file's original authoring (every day/week/month boundary left an accidental blank template line, read by groff as its own extra .sp); found and fixed a genuine print-safety bug (text sitting 0.13mm from the true page edge -- .pl, groff's text page length, is independent of -P-pa5's device paper selection and needed matching explicitly before ms's own FM-based bottom margin would fire at all); and added a .ne guard so a week header can no longer be stranded alone at a page's foot. Net: 43 pages (A4, broken) to 39 pages (real A5, print-safe, real Latin names, correct encoding, zero orphans) -- no numeric target set for this flavour, but no lower number was reachable without leaving one of the above unfixed. ordo.html and every grid.* flavour are untouched, as scoped. Both golden/ordo-2027.{tex,ms} regenerated through the real test harness path (Test_support's loaders + Test_view's en-with-la-fallback view_of), not the CLI, whose own --lang default (la) differs from the harness's and would have pinned content the suite never produces. Full suite green: 503 tests (504 with the exhaustive sweep). make check-templates/check-schema/check-citations all clean.
Diffstat (limited to 'templates/ef/ordo.tex')
-rw-r--r--templates/ef/ordo.tex116
1 files changed, 79 insertions, 37 deletions
diff --git a/templates/ef/ordo.tex b/templates/ef/ordo.tex
index 4ffc9e9..434fb1e 100644
--- a/templates/ef/ordo.tex
+++ b/templates/ef/ordo.tex
@@ -17,13 +17,13 @@
% \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
-% with its first day box pushed to the next one: 29mm covers the month
-% banner's own rule+title (~11.5mm) plus the week header below it
-% (~5.5mm) plus room for at least one day box (~10mm); 16mm covers just
-% the week header plus one day box. Both re-verified against the actual
-% typeset output, not derived from theory alone (the task report has the
-% before/after page counts and a scan proving no header is ever left
-% alone at a page's foot with nothing under it).
+% with its first day box pushed to the next one: 18mm covers the month
+% banner's own rule+title plus the week header below it plus room for at
+% least one (now much shorter, see the density retune below) day box;
+% 9mm covers just the week header plus one day box. Both re-verified
+% against the actual typeset output, not derived from theory alone (the
+% task report has the before/after page counts and a scan proving no
+% header is ever left alone at a page's foot with nothing under it).
%
% \label fires AFTER both \needspace calls below, not before: a \label
% placed before a \needspace that goes on to force a break captures the
@@ -43,17 +43,57 @@
% page even at reduced size (measured: 55-65% of the text height for a
% typical week, more with commemorations), so simply dropping the forced
% per-week \clearpage only let the year's many PARTIAL boundary weeks
-% double up, not full ones -- a real but small saving on its own. Three
-% changes together fit a genuinely useful second (often third, on a short
-% week) week onto the same page: \fontsize explicitly (not \scriptsize,
-% whose 7pt/8.4pt leading is looser than a dense booklet needs), the
-% feast name still a clearly-bolder 9pt, and rank/colour folded onto the
-% SAME line as the citations rather than a line of its own -- an A5 box
-% is far wider than it is tall (roughly 120mm of usable width here), so
-% "I classis . albus Epistola ... Evangelium ..." fits with room to
-% spare even on Holy Week's own longest citations (measured against the
-% rendered output, not assumed; see the task report for the page count
-% this bought).
+% double up, not full ones -- a real but small saving on its own. Rank/
+% colour folded onto the SAME line as the citations rather than a line of
+% its own -- an A5 box is far wider than it is tall (roughly 120mm of
+% usable width here), so "I classis . albus Epistola ... Evangelium ..."
+% fits with room to spare even on Holy Week's own longest citations
+% (measured against the rendered output, not assumed).
+%
+% DENSITY RETUNE (matched to ordo.typ's own decisions, task: bring ordo.tex
+% to Typst's density -- 53 pages/6.9 days-per-page down to 29 pages/12.6):
+% the document's own base size drops from \normalsize (10pt) to an explicit
+% 9pt/10.5 leading set once after \begin{document} (mirrors Typst's global
+% #set text(size: 9pt)); within a day box the SAME size hierarchy Typst
+% uses -- the day number and the feast name are BOTH the 9pt base (bold
+% is what distinguishes them, not size, exactly as ordo.typ decided), the
+% weekday name is 7pt, and every detail line (rank/colour/citations/
+% commemorations) is 6.5pt.
+%
+% The one genuinely non-obvious lesson from getting there (cost a full
+% false-start): \fontsize{n}{lead}\selectfont set INSIDE a brace group
+% that CLOSES before the line-ending \\ has NO effect on the interline
+% glue TeX inserts for that break -- the glue uses whatever \baselineskip
+% is active in the OUTER scope at the point \\ actually executes, not the
+% value the just-closed group asked for. This is not a stylistic
+% preference; it was measured directly (a synthetic two-baselineskip test
+% file, \fontsize{9}{9.7}...\\ in a closed group nested inside an OUTER
+% \fontsize{9}{20}, produced an exact 20pt gap, not 9.7pt) and it is
+% exactly the shape of bug the ORIGINAL (pre-retune) day box already had:
+% every one of its \fontsize groups closed before its own \par, so the
+% only thing actually controlling interline spacing throughout the whole
+% box was the ambient \normalsize baselineskip (12pt at the old 10pt base)
+% -- the box's own careful-looking 9pt/6.5pt \fontsize choices were, for
+% LEADING purposes, inert. The fix used throughout below: \fontsize and
+% \selectfont are issued INLINE (no enclosing group), immediately before
+% the text they size, with \\ following in the SAME scope -- the size
+% declared right before a line's own text is what governs the gap ABOVE
+% that line, confirmed by the same synthetic test the other way (a 6.5pt/
+% 7pt declaration right before a small line tightens only that one gap).
+% \bfseries/\mdseries are toggled the same inline way (no groups), which
+% is why a stray unbalanced brace anywhere in this box would fail loudly
+% at compile time rather than silently leak weight into later text.
+%
+% Two further, smaller finds while measuring the actual PDF, not assumed:
+% tcolorbox's default rounded corners undercount a box's own true height
+% when probed by scanning a fixed pixel column (the arc pulls the vertical
+% edge away near each corner) -- \texttt{sharp corners} removes the
+% ambiguity and, as a side effect, also matches Typst's own plain
+% rectangular block() more closely. And \parskip is set to 0pt globally
+% (\setlength{\parindent}{0pt} already was) since several day-box lines
+% are still separate \LaTeX{} paragraphs (broken by \\, not \par, so this
+% is defensive rather than load-bearing) and a nonzero default \parskip
+% would otherwise add unpredictable glue between them.
%
% Every fixed string (headings, the Epistle/Gospel/Commemoration/Week
% labels) comes from the view's term vocabulary rather than being written
@@ -120,48 +160,50 @@
% 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_name}}}
-\fancyfoot[C]{\small\thepage}
+\fancyhead[C]{\fontsize{8}{9}\selectfont {{term.ordo}} {{year}} \textperiodcentered\ {{rite_name}}}
+\fancyfoot[C]{\fontsize{8}{9}\selectfont\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\setlength{\parindent}{0pt}
+\setlength{\parskip}{0pt}
\begin{document}
+\fontsize{9}{10.5}\selectfont
\begin{center}
-\Large\bfseries {{term.ordo}} {{year}}\\[2pt]
-\normalsize\mdseries {{rite_name}}
+\fontsize{18}{20}\selectfont\bfseries {{term.ordo}} {{year}}\\[2pt]
+\fontsize{9}{10.5}\selectfont\mdseries {{rite_name}}
\end{center}
-\vspace{4mm}
-{\bfseries {{term.contents}}}\par\vspace{2mm}
-\begin{small}
+\vspace{3mm}
+{\bfseries {{term.contents}}}\par\vspace{1.5mm}
+{\fontsize{8}{9.2}\selectfont
{{#months}}
\textbf{ {{name}} }\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}
+}
\clearpage
{{#months}}
{{#weeks}}
{{#first}}
-\needspace{29mm}
-\vspace{2mm}\noindent\rule{\linewidth}{1pt}\par\vspace{0.8mm}
-{\LARGE\bfseries {{month_name}} {{year}} }\par\vspace{1mm}
+\needspace{18mm}
+\vspace{1.5mm}\noindent\rule{\linewidth}{1pt}\par\vspace{0.6mm}
+{\fontsize{15}{16.5}\selectfont\bfseries {{month_name}} {{year}} }\par\vspace{0.8mm}
{{/first}}
-\needspace{16mm}
+\needspace{9mm}
+\vspace{0.6mm}
\label{w{{month_num}}-{{num}}}
-{\bfseries\large {{term.week}} {{num_roman}} }{\small ({{month_abbr}} {{first_dom}}{{^single_day}}--{{last_dom}}{{/single_day}})}\par\vspace{0.5mm}
+{\fontsize{12}{13}\selectfont\bfseries {{term.week}} {{num_roman}} ({{month_abbr}} {{first_dom}}{{^single_day}}--{{last_dom}}{{/single_day}})}\par\vspace{0.3mm}
{{#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]
-{\bfseries {{dom}} } \;{\fontsize{6.5}{7.4}\selectfont {{weekday}} }\hfill\swatch{licol{{colour}}}\par
-{\fontsize{9}{10.2}\selectfont\bfseries {{name}} }\par
-{\fontsize{6.5}{7.4}\selectfont {{rank_name}} \textperiodcentered\ {{colour_name}} {{#first}}\quad {{term.epistle}}\ {{first}} {{/first}}{{#gospel}}\quad {{term.gospel}}\ {{gospel}} {{/gospel}}}
-{{#comms}}\par{\fontsize{6.5}{7.4}\selectfont {{term.commemoration}}\ {{name}} }{{/comms}}
+\begin{tcolorbox}[colback=white,colframe=black!35,boxrule=0.3pt,sharp corners,boxsep=0mm,left=1.6mm,right=1.6mm,top=0.4mm,bottom=0.4mm,before skip=0.3mm,after skip=0mm]
+\fontsize{9}{9}\selectfont\bfseries {{dom}} \fontsize{7}{9}\selectfont\mdseries\;{{weekday}}\hfill\swatch{licol{{colour}}}\\
+\fontsize{9}{9.7}\selectfont\bfseries {{name}}\\
+\fontsize{6.5}{7.4}\selectfont\mdseries {{rank_name}} \textperiodcentered\ {{colour_name}} {{#first}}\quad {{term.epistle}}\ {{first}} {{/first}}{{#gospel}}\quad {{term.gospel}}\ {{gospel}} {{/gospel}}{{#comms}}\\
+\fontsize{6.5}{7.4}\selectfont\mdseries {{term.commemoration}}\ {{name}}{{/comms}}
\end{tcolorbox}
{{/in_month}}
{{/days}}
-\vspace{1mm}
{{/weeks}}
{{/months}}
\end{document}