One LaTeX design for a company, in three templates

A company that writes with LaTeX ends up with a document class, a letter class
and a presentation theme that share a design and not a line of code. Every fix
is then made three times, two of them late and the third never.

Here the page is written once. A company declares its colours, faces and logo in
one file, and the document template, the letter class and the presentation theme
read that one file. Nothing in the suite carries a colour value, a font name or
a file name of any company, which is what lets it be published while the
companies stay private.

Every measure of the page follows from a measurement or from a named definition:
the room the head and the foot need is taken from the boxes they really build,
one line of the body text stands between the head and the text and between the
text and the foot, a heading never stands alone at the foot of a page, a picture
takes the size of the family, and a Markdown file reaches the same page as the
same document written in LaTeX.

The suite ships with a company that does not exist, Nordwind AG, so that it
builds and is measured anywhere: three colours, the TeX Gyre families every
installation carries, and an icon drawn in TikZ.

574 checks over five measurements, all of them on the rendered page or on the
build log rather than on the source.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marc WäckerlinandClaude Opus 5 committed 2026-09-22 15:06:07 +02:00
commit adc58e19d7
39 files changed
+6627

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
-- Copyright (c) 2026 Marc Wäckerlin. SPDX-License-Identifier: MIT
-- Long inline code gets the break opportunities a path or an identifier
-- offers, so that it wraps instead of standing outside the page.
--
-- `payment/stripe_utils/stripe_connector.py:214` is one word to LaTeX: it
-- carries no space, and hyphenation patterns do not apply to a typewriter face,
-- so the line runs over the right edge and the last characters stand next to
-- the paper. Measured over one report: 30 of 44 places where something left the
-- type area were spans of this kind, up to 44 points out.
--
-- A break is offered after the characters that structure such a name, and
-- before a capital that follows a small letter, which is where a reader of
-- `CreditCardCustomerBasicInfoSerializer` reads a boundary anyway. No hyphen is
-- inserted: a hyphen in a path would be read as part of the path.
--
-- Only a span from 16 characters up is treated. The shortest one that left the
-- type area in that document was `plim/settings.py:25` at 19 characters, and a
-- short span finds room on the next line by itself, where breaking it would
-- only make it harder to read.
local THRESHOLD = 16
local function pieces(text)
local parts, current = {}, ''
for index = 1, #text do
local char = text:sub(index, index)
local following = text:sub(index + 1, index + 1)
current = current .. char
local structural = char:match('[/._:%-]') and following ~= ''
local camel = char:match('%l') and following:match('%u')
if structural or camel then
parts[#parts + 1] = current
current = ''
end
end
if current ~= '' then
parts[#parts + 1] = current
end
return parts
end
function Code(code)
if not FORMAT:match('latex') then return nil end
if #code.text < THRESHOLD then return nil end
local parts = pieces(code.text)
if #parts < 2 then return nil end
local result = {}
for index, part in ipairs(parts) do
result[#result + 1] = pandoc.Code(part)
if index < #parts then
result[#result + 1] = pandoc.RawInline('latex', '\\allowbreak{}')
end
end
return result
end