aboutsummaryrefslogtreecommitdiff
path: root/templates/ef/grid.ms
diff options
context:
space:
mode:
Diffstat (limited to 'templates/ef/grid.ms')
-rw-r--r--templates/ef/grid.ms95
1 files changed, 95 insertions, 0 deletions
diff --git a/templates/ef/grid.ms b/templates/ef/grid.ms
new file mode 100644
index 0000000..703f46b
--- /dev/null
+++ b/templates/ef/grid.ms
@@ -0,0 +1,95 @@
+.\" colitur wall calendar -- groff ms with tbl. flavour: groff
+.\" Build: colitur table --year 2027 --template grid.ms | groff -ms -t -Tpdf -P-pa4l > grid.pdf
+.\"
+.\" LANDSCAPE, not the ms default portrait: with allbox cells and Latin-less
+.\" days falling back to the raw slug (some fallback slugs run past 40
+.\" characters, e.g. "commemoration-of-the-baptism-of-the-lord"), seven
+.\" columns of real content do not fit a portrait line length at any
+.\" reasonable point size. "-P-pa4l" is gropdf's own landscape papersize
+.\" (groff_font(5): a trailing "l" on a papersize name swaps width/height at
+.\" the OUTPUT DEVICE level) -- it must be a command-line flag, not a request
+.\" inside this file: an in-document "\X'papersize=a4l'" escape was tried and
+.\" rejected (it does not actually rotate gropdf's page in this groff, and
+.\" throws diagnostics doing it). ".pl"/".po"/".ll" below independently widen
+.\" TROFF's OWN idea of the page to match -- ".pl"/".ll" are requests, unlike
+.\" the device's own physical page size, and are not implied by "-P-pa4l" --
+.\" so both halves are needed, or one side clips the other.
+.\"
+.\" ".TL" (the ms title macro, s.tmac) ITSELF narrows the line length to
+.\" 5/6 of register "LL" for the title text, and never widens it back
+.\" afterward -- there is no third place in s.tmac that ever does. Setting
+.\" only the primitive ".ll" before ".TL" is therefore not enough: ".TL"
+.\" overwrites it and every table for the rest of the document inherits
+.\" the NARROWED value, silently, which is a second, independent way the
+.\" original template lost its width (found by reading s.tmac itself, not
+.\" guessed). Fixed by setting register "LL" (what ".TL" actually reads)
+.\" and re-asserting ".ll" once more, explicitly, right after the title.
+.\"
+.\" Every column is a FIXED-WIDTH, WRAPPING tbl "w()" block, not a plain "l":
+.\" without "w()" tbl sizes a column to its single widest entry and does NOT
+.\" wrap, so a 40-character slug forces every column that wide -- seven of
+.\" them together run far past any line length, tbl warns "table wider than
+.\" line length", and whatever falls past the physical page edge is not a
+.\" rendering nicety missing, it is GONE: `pdftotext -layout` (and a printed
+.\" page) show only however many columns fit, not all seven. "w()" makes
+.\" each column wrap its own text block instead, the same fix grid.tex
+.\" already uses via LaTeX's "p{2.6cm}" (see that file's own comment) --
+.\" this is the tbl-native equivalent, not a different design.
+.\"
+.\" "w()" alone is NOT sufficient, and this is the part that actually cost
+.\" the time: tbl only wraps a cell as a text block when its content is
+.\" delimited by "T{"/"T}" on their own lines. A PLAIN cell entry in a
+.\" "w()" column (what the first attempt at this fix used) is never
+.\" wrapped at all -- tbl just widens the column past the requested "w()"
+.\" to fit the single longest unbroken entry, exactly reproducing the
+.\" original bug. Confirmed directly against tbl's own generated troff
+.\" code (`tbl grid.ms`, grep "3w0 .*>?"): every column width register is
+.\" `max(w(), \w'cell text')`, so an un-delimited 40-character cell always
+.\" wins that max. Every day cell below is therefore its own "T{"/"T}"
+.\" block; the closing "T}" and the following column's opening "T{" share
+.\" one line with the tab between them (the standard tbl idiom: "T}<TAB>
+.\" T{"). The template writes that as "{{#last}}T}{{/last}}{{^last}}T}
+.\" <TAB>{{/last}}" rather than "T}{{^last}}<TAB>{{/last}}T{" so that no
+.\" literal "T{" ever sits directly against a "{{"/"}}" delimiter in the
+.\" source -- three braces in a row there parses as a malformed tag, not
+.\" as literal text followed by a tag.
+.\"
+.\" ".na" (no-adjust, ragged right) is required alongside the wrap, not
+.\" cosmetic: a hyphenated slug like "commemoration-of-the-baptism-of-the-
+.\" lord" DOES break at its own hyphens once wrapping is active (verified:
+.\" troff's filler treats an ASCII hyphen as a break point), but adjusted
+.\" (justified) fill in a column this narrow cannot always stretch such a
+.\" line to the full measure and troff warns "cannot adjust line" for
+.\" every such row -- another warning `make check-templates` must fail on.
+.\" Ragged-right removes the stretching, not the wrapping.
+.\"
+.\" 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) -- see ordo.tex's own comment for why the fallback is
+.\" written as a name-section wrapping a plain var and its inverse, rather
+.\" than a single dotted lookup and its inverse.
+.\"
+.\" 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.
+.pl 8.27i
+.po 0.3i
+.nr LL 10.9i
+.ll \n[LL]u
+.TL
+Calendarium {{year}} \(bu {{rite}}
+.ll \n[LL]u
+.na
+{{#months}}
+.SH
+{{name.la}}
+.TS
+allbox;
+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).
+Dom Lun Mar Mer Iov Ven Sab
+{{#weeks}}{{#days}}T{
+{{#in_month}}\fB{{dom}}\fP \s-2{{#name}}{{la}}{{^la}}{{slug}}{{/la}}{{/name}}\s+2{{/in_month}}
+{{#last}}T}{{/last}}{{^last}}T} {{/last}}{{/days}}
+{{/weeks}}.TE
+{{/months}}