# An amendment with deletions struck and insertions underlined

> A comparative print of a copyright act: deleted words struck through, new words underlined, then the amended text in a box whose clauses hang.

- HTML version: https://postext.dev/en/cookbook/amendment-redline
- Recipe Nº 182 · Type & text · Level 2 (Intermediate) · Outputs: Canvas, PDF
- Genres: Reports
- Requires postext ≥ 1.73.0, postext-pdf ≥ 1.73.0 · tested with 1.73.0, postext-pdf 1.73.0 on 2026-11-10
- Pages: [1](https://postext.dev/cookbook/amendment-redline/en/p01.webp?v=7991e2d7), [2](https://postext.dev/cookbook/amendment-redline/en/p02.webp?v=7991e2d7), [3](https://postext.dev/cookbook/amendment-redline/en/p03.webp?v=7991e2d7), [4](https://postext.dev/cookbook/amendment-redline/en/p04.webp?v=7991e2d7), [5](https://postext.dev/cookbook/amendment-redline/en/p05.webp?v=7991e2d7)
- PDF: https://postext.dev/cookbook/amendment-redline/en/amendment-redline.pdf?v=7991e2d7
- Open in Sandbox: https://postext.dev/en/sandbox#recipe=amendment-redline&lang=en (.postext: https://postext.dev/cookbook/amendment-redline/en/amendment-redline.postext)
- Last updated: 2026-11-10
- Other languages: [es](https://postext.dev/es/cookbook/amendment-redline.md), [ca](https://postext.dev/ca/cookbook/amendment-redline.md), [de](https://postext.dev/de/cookbook/amendment-redline.md), [fr](https://postext.dev/fr/cookbook/amendment-redline.md), [it](https://postext.dev/it/cookbook/amendment-redline.md), [pt](https://postext.dev/pt/cookbook/amendment-redline.md), [zh](https://postext.dev/zh/cookbook/amendment-redline.md), [ja](https://postext.dev/ja/cookbook/amendment-redline.md), [ar](https://postext.dev/ar/cookbook/amendment-redline.md)

## In short

A short legislative print. It shows the old wording of a law with the removed words crossed out and the new words underlined, then the whole amended section in a shaded box.

## What you'll build

A committee print of the kind that goes out with a bill: five pages that show what section 102 of the Sonny Bono Copyright Term Extension Act of 1998 did to title 17 of the United States Code. The Act only says "strike 'fifty' and insert '70'"; this print sets the law as it stood with each change marked in place, deletions struck through and insertions underlined, the coding legend that federal and state drafters print over such texts, and then section 302 as amended in a tinted box, each subsection letter at the edge and its lines hung under the text. The Spanish edition does the same for the three reforms of the Spanish Constitution, published in the BOE in 1992, 2011 and 2024.

**This recipe answers:**

- How do I show an amendment with the deleted words struck through and the new words underlined?

## The short answer

The marks live in the Markdown; the boxes hang their clauses.

```js
// script.js, lines 37–64
// In the text, ~~fifty~~ strikes a deleted word and :underline[70] underlines the new one.
// Both lines are painted from the face's own metrics and take no room, so the struck and
// the inserted words justify and hyphenate like any others. The amended text then sits in
// a box whose paragraphs hang: '(a)', a tab, and every turnover line under the text.
const label = { fontFamily: SANS, fontSize: pt(7.5), fontWeight: 700, letterSpacing: pt(1.1),
  textTransform: 'uppercase', color: col('accent') };
const clauses = { fontFamily: SERIF, fontSize: pt(9.5), lineHeight: pt(13), color: col('ink'),
  boldColor: col('ink'), italicColor: col('ink'), textAlign: 'left', // a box's measure is short
  hangingIndent: HANG, // every line but the first starts 7 mm in (postext ≥ 1.71)
  tabStops: [{ position: HANG }] }; // and the tab after the marker takes the text there
const pad = (v, h) => ({ top: mm(v), right: mm(h), bottom: mm(v), left: mm(h) });
const calloutStyles = [
  // The coding legend: a red rule down its side, the label face.
  { id: 'legend', backgroundEnabled: false,
    stripe: { enabled: true, side: 'left', width: pt(2.5), color: col('accent') },
    padding: pad(1.5, 3.5), body: { fontFamily: SANS, fontSize: pt(9), lineHeight: pt(12.5),
      color: col('ink'), boldColor: col('accent'), firstLineIndent: pt(0), textAlign: 'left' } },
  // The bill's own words: a red rule on top, clauses hung, no tint.
  { id: 'bill', backgroundEnabled: false,
    stripe: { enabled: true, side: 'top', width: pt(2.5), color: col('accent') },
    padding: pad(2.5, 0), body: clauses, keepTogether: false, // it may run on to the next page
    // its title keeps its case: "(b)" stays "(b)"
    titleStyle: { ...label, textTransform: 'none', letterSpacing: pt(0.2), fontSize: pt(8.5),
      color: col('ink') } },
  // The text as amended: a tint, the clauses hung the same way.
  { id: 'amended', background: col('tint'), padding: pad(3.5, 4.5), titleStyle: label,
    body: clauses },
];
```

## Ingredients

**Teaches**

- [Strikethrough](https://postext.dev/en/docs/document-format-inline.md#strikethrough): A line through a phrase written as ~~text~~, as a price list strikes the old price beside the new one: the words stay ordinary text and break across lines, the line follows each piece.
- [Underline](https://postext.dev/en/docs/document-format-inline.md#underline): A line under a phrase written as :underline[text] (or ++text++ with bodyText.plusUnderline on), as a form underlines an instruction that must not be missed: the words stay ordinary text and break across lines, the line follows each piece.
- [Hanging paragraphs in a box](https://postext.dev/en/docs/configuration-callouts.md#typography-inside-a-box): A box style's body.hangingIndent hangs every paragraph of the box: the marker, a number or a clause letter, starts at the box's inner edge and the text and its turnover lines stand a little further in, as clauses, notes and definitions are set.

**Also uses**

- [Tab stops and leaders](https://postext.dev/en/docs/configuration-text.md#tab-stops)
- [Callout boxes](https://postext.dev/en/docs/configuration-callouts.md#callout-styles)
- [Boxes that split or stay whole](https://postext.dev/en/docs/configuration-callouts.md#the-callout-container)
- [Semantic colour palette](https://postext.dev/en/docs/configuration-fonts-colors-viewers.md#color-palette)
- [Designed openers](https://postext.dev/en/docs/configuration-headings.md#span-and-advanced-design)
- [Heading attributes](https://postext.dev/en/docs/document-format.md#heading-attributes)
- [Running heads and folios](https://postext.dev/en/docs/configuration-headers-footers.md#headers--footers)
- [Heads by page role](https://postext.dev/en/docs/configuration-headers-footers.md#text-elements)
- [Mirrored margins](https://postext.dev/en/docs/configuration-page-layout.md#mirrored-margins)
- [Paragraph styles](https://postext.dev/en/docs/configuration-styles.md#paragraph-styles)
- [Widows, orphans and runts](https://postext.dev/en/docs/configuration-page-flow.md#orphans-widows-runts-and-keep-together-rules)
- [PDF export](https://postext.dev/en/docs/configuration-pdf-output.md#generating-pdfs)
- [Fonts embedded in the PDF](https://postext.dev/en/docs/configuration-pdf-output.md#why-a-font-provider)

**Config at a glance**

- [`bodyText`](https://postext.dev/en/docs/configuration-text.md#body-text), [`calloutStyles`](https://postext.dev/en/docs/configuration-callouts.md#callout-styles), [`colorPalette`](https://postext.dev/en/docs/configuration-fonts-colors-viewers.md#color-palette), [`footer`](https://postext.dev/en/docs/configuration-headers-footers.md#headers--footers), [`header`](https://postext.dev/en/docs/configuration-headers-footers.md#headers--footers), [`headings`](https://postext.dev/en/docs/configuration-headings.md#headings), [`layout`](https://postext.dev/en/docs/configuration-page-layout.md#layout), [`locale`](https://postext.dev/en/docs/configuration-language.md#hyphenation), [`page`](https://postext.dev/en/docs/configuration-page-layout.md#page), [`paragraphStyles`](https://postext.dev/en/docs/configuration-styles.md#paragraph-styles)

**APIs**

- [`buildDocumentWithFonts`](https://postext.dev/en/docs/configuration-programmatic-usage.md#loading-fonts-before-layout), [`decompressWoff2`](https://postext.dev/en/docs/configuration-pdf-output.md#browser-font-provider-fontsource--woff2), [`renderPageToCanvas`](https://postext.dev/en/docs/configuration-programmatic-usage.md#rendering-a-page-to-a-bitmap), [`renderToPdf`](https://postext.dev/en/docs/configuration-pdf-output.md#generating-pdfs)

**Typefaces**

- Source Serif 4 (OFL-1.1), Source Sans 3 (OFL-1.1)

## Method

### 1 · Mark the change where it happens

The code is [the short answer](https://postext.dev/en/cookbook/amendment-redline.md#the-short-answer) above. The marks themselves are Markdown: `~~fifty~~ :underline[70]` strikes the old word and underlines the new one ([strikethrough](https://postext.dev/en/docs/document-format-inline.md#strikethrough), [underline](https://postext.dev/en/docs/document-format-inline.md#underline)). Neither line takes room, so a struck clause of six lines justifies and hyphenates like the text around it, and on page 3 the whole of the old subsection 304(b) is struck and its replacement underlined in one paragraph. Each line is drawn from the face's own strikeout and underline metrics, in the colour of the words, so the small capitals of a catchline get their own line at their own height.

### 2 · Hang the clauses in the box

`body.hangingIndent` on a box style hangs every paragraph of the box ([typography inside a box](https://postext.dev/en/docs/configuration-callouts.md#typography-inside-a-box)): the first line starts at the box's inner edge and the turnovers 7 mm in. A tab stop at the same 7 mm takes the text after "(a)" or "(c)" to that edge whatever the width of the letter, so you write `(a):tab In General.—…` in the Markdown. The bill's own clauses and the amended section share the typography and differ only in their frame: a red rule over the bill, a tint behind the law in force. The bill's box may split (`keepTogether: false`), so page 1 ends on its first two clauses.

### 3 · A band for the opener

```js
// script.js, lines 68–82
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });
const BAND = 66; // mm from the trim top to the foot of the band
const opener = { enabled: true, minHeight: mm(BAND - 22 + 6), marginBottom: pt(0), slot: {
  elements: [
    { kind: 'box', id: 'band', style: { backgroundColor: col('band') },
      placement: { ...at('bleed', 'top-left'), size: { width: 'fill', height: mm(BAND + 3) } } },
    { kind: 'text', id: 'kicker', content: '{attr.kicker}', ...label, color: col('pale'),
      placement: { ...at('container', 'top-left', 0, 6), size: { width: mm(112) } } },
    { kind: 'text', id: 'title', content: '{titleText}', fontFamily: SERIF, fontWeight: 700,
      fontSize: pt(30), lineHeight: 1.05, color: col('paper'), align: 'left',
      placement: { ...at('#kicker', 'below', 0, 3), size: { width: mm(112), height: 'auto' } } },
    { kind: 'text', id: 'dek', content: '{attr.dek}', fontFamily: SERIF, italic: true,
      fontSize: pt(10.5), lineHeight: 1.3, color: col('pale'), align: 'left',
      placement: { ...at('#title', 'below', 0, 3.5), size: { width: mm(104), height: 'auto' } } },
  ] } };
```

The navy band runs off the top and both sides of the page, and the kicker and the standfirst come from attributes on the heading line ([heading attributes](https://postext.dev/en/docs/document-format.md#heading-attributes)). `minHeight` sets where the legend starts, a few millimetres under the band.

### 4 · Running heads by parity

```js
// script.js, lines 86–98
const head = (id, content, parity, edge, x, extra = {}) => ({
  kind: 'text', id, content, parity, pages: 'body', fontFamily: SANS, fontSize: pt(7.5),
  fontWeight: 600, letterSpacing: pt(1.1), textTransform: 'uppercase', color: col('muted'),
  placement: { anchor: { to: 'page', edge }, offset: { x: mm(x), y: mm(13) } }, ...extra });
const folio = { fontWeight: 700, color: col('ink') };
const header = { elements: [
  head('verso-folio', '{pageNumber}', 'even', 'top-left', OUTER, folio),
  head('verso-title', '{title}', 'even', 'top-left', OUTER + 8),
  head('recto-title', '{firstMark.h2}', 'odd', 'top-right', -(OUTER + 8)),
  head('recto-folio', '{pageNumber}', 'odd', 'top-right', -OUTER, folio),
] };
const footer = { elements: [head('drop-folio', '{pageNumber}', 'all', 'top', 0,
  { ...folio, pages: 'opener', placement: at('container', 'top', 0, 9) })] };
```

The verso carries the print's title and the recto the part of the print the page opens in, read from the first second-level heading on it. `pages: 'body'` keeps them off the opener, which carries a drop folio instead.

## The whole recipe

One file, composed from the recipe's folder with the sample text and the Cookbook's shared kit inlined; it builds its own page. To run it, put it in a `<script type="module">` on an empty page, or paste it into the JS panel of a new CodePen (as a module). It imports postext from esm.sh, so there is nothing to install or build.

- Source folder: https://github.com/drnachio/postext/tree/main/cookbook/amendment-redline

### script.js

```js
// ═══ Postext Cookbook · Nº 182 · An amendment shown struck through and underlined ═════
// https://postext.dev/en/cookbook/amendment-redline
// Code: MIT · Text: Pub. L. 105-298 and 17 U.S.C. (US Gov., PD); Constitución Española (BOE)
// Fonts: Source Serif 4, Source Sans 3 (SIL OFL 1.1) · Needs postext ≥ 1.73.0
// A comparative print: the law as it stood, each deletion ~~struck through~~ and each
// insertion :underline[underlined], then the amended text in a box whose clauses hang.
import { buildDocumentWithFonts, renderPageToCanvas } from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'amendment-redline';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: a government-print navy, one red for rules and labels
const palette = {
  ink: '#1b1d22', // text: a cool near-black
  band: '#1f2b47', // the opener's band: navy
  accent: '#a1321f', // labels, stripes, the legend's rule
  tint: '#eef0f4', // the box of the amended text
  rule: '#c7ccd6', // hairlines
  muted: '#5d6370', // running heads, notes, colophon
  paper: '#ffffff',
  pale: '#c9d2e6', // the kicker and the standfirst on the band
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [
  ...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
  { id: 'main-color', name: 'accent (defaults)', value: { hex: palette.accent, model: 'hex' } },
];
// #endregion
const SERIF = 'Source Serif 4', SANS = 'Source Sans 3';
const TRIM = [152, 229], INNER = 20, OUTER = 17; // mm: a 6 × 9 in committee print
const LEAD = 14; // pt: the body leading
const HANG = mm(7); // how far the clauses of a box hang: the width of "(a)" and a space

// #region answer: the marks live in the Markdown; the boxes hang their clauses
// In the text, ~~fifty~~ strikes a deleted word and :underline[70] underlines the new one.
// Both lines are painted from the face's own metrics and take no room, so the struck and
// the inserted words justify and hyphenate like any others. The amended text then sits in
// a box whose paragraphs hang: '(a)', a tab, and every turnover line under the text.
const label = { fontFamily: SANS, fontSize: pt(7.5), fontWeight: 700, letterSpacing: pt(1.1),
  textTransform: 'uppercase', color: col('accent') };
const clauses = { fontFamily: SERIF, fontSize: pt(9.5), lineHeight: pt(13), color: col('ink'),
  boldColor: col('ink'), italicColor: col('ink'), textAlign: 'left', // a box's measure is short
  hangingIndent: HANG, // every line but the first starts 7 mm in (postext ≥ 1.71)
  tabStops: [{ position: HANG }] }; // and the tab after the marker takes the text there
const pad = (v, h) => ({ top: mm(v), right: mm(h), bottom: mm(v), left: mm(h) });
const calloutStyles = [
  // The coding legend: a red rule down its side, the label face.
  { id: 'legend', backgroundEnabled: false,
    stripe: { enabled: true, side: 'left', width: pt(2.5), color: col('accent') },
    padding: pad(1.5, 3.5), body: { fontFamily: SANS, fontSize: pt(9), lineHeight: pt(12.5),
      color: col('ink'), boldColor: col('accent'), firstLineIndent: pt(0), textAlign: 'left' } },
  // The bill's own words: a red rule on top, clauses hung, no tint.
  { id: 'bill', backgroundEnabled: false,
    stripe: { enabled: true, side: 'top', width: pt(2.5), color: col('accent') },
    padding: pad(2.5, 0), body: clauses, keepTogether: false, // it may run on to the next page
    // its title keeps its case: "(b)" stays "(b)"
    titleStyle: { ...label, textTransform: 'none', letterSpacing: pt(0.2), fontSize: pt(8.5),
      color: col('ink') } },
  // The text as amended: a tint, the clauses hung the same way.
  { id: 'amended', background: col('tint'), padding: pad(3.5, 4.5), titleStyle: label,
    body: clauses },
];
// #endregion

// #region opener: a navy band off the top of the page, the kicker and title on it
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });
const BAND = 66; // mm from the trim top to the foot of the band
const opener = { enabled: true, minHeight: mm(BAND - 22 + 6), marginBottom: pt(0), slot: {
  elements: [
    { kind: 'box', id: 'band', style: { backgroundColor: col('band') },
      placement: { ...at('bleed', 'top-left'), size: { width: 'fill', height: mm(BAND + 3) } } },
    { kind: 'text', id: 'kicker', content: '{attr.kicker}', ...label, color: col('pale'),
      placement: { ...at('container', 'top-left', 0, 6), size: { width: mm(112) } } },
    { kind: 'text', id: 'title', content: '{titleText}', fontFamily: SERIF, fontWeight: 700,
      fontSize: pt(30), lineHeight: 1.05, color: col('paper'), align: 'left',
      placement: { ...at('#kicker', 'below', 0, 3), size: { width: mm(112), height: 'auto' } } },
    { kind: 'text', id: 'dek', content: '{attr.dek}', fontFamily: SERIF, italic: true,
      fontSize: pt(10.5), lineHeight: 1.3, color: col('pale'), align: 'left',
      placement: { ...at('#title', 'below', 0, 3.5), size: { width: mm(104), height: 'auto' } } },
  ] } };
// #endregion

// #region running-heads: the print's title on the verso, the part on the recto
const head = (id, content, parity, edge, x, extra = {}) => ({
  kind: 'text', id, content, parity, pages: 'body', fontFamily: SANS, fontSize: pt(7.5),
  fontWeight: 600, letterSpacing: pt(1.1), textTransform: 'uppercase', color: col('muted'),
  placement: { anchor: { to: 'page', edge }, offset: { x: mm(x), y: mm(13) } }, ...extra });
const folio = { fontWeight: 700, color: col('ink') };
const header = { elements: [
  head('verso-folio', '{pageNumber}', 'even', 'top-left', OUTER, folio),
  head('verso-title', '{title}', 'even', 'top-left', OUTER + 8),
  head('recto-title', '{firstMark.h2}', 'odd', 'top-right', -(OUTER + 8)),
  head('recto-folio', '{pageNumber}', 'odd', 'top-right', -OUTER, folio),
] };
const footer = { elements: [head('drop-folio', '{pageNumber}', 'all', 'top', 0,
  { ...folio, pages: 'opener', placement: at('container', 'top', 0, 9) })] };
// #endregion

const config = {
  locale: t({ en: 'en-us', es: 'es' }),
  colorPalette,
  page: { sizePreset: 'custom', width: mm(TRIM[0]), height: mm(TRIM[1]), dpi: 150,
    margins: { top: mm(22), bottom: mm(22), left: mm(INNER), right: mm(OUTER), mirror: true } },
  layout: { layoutType: 'single' },
  bodyText: {
    fontFamily: SERIF, fontSize: pt(10), lineHeight: pt(LEAD), color: col('ink'),
    boldColor: col('ink'), italicColor: col('ink'), referenceColor: col('ink'),
    textAlign: 'justify', firstLineIndent: mm(4.5), indentAfterHeading: false,
    hyphenation: { enabled: true }, optimalLineBreaking: true,
    avoidWidows: true, avoidOrphans: true, avoidRunts: true,
  },
  headings: { fontFamily: SERIF, color: col('ink'), fontWeight: 700, levels: [
    { level: 1, fontSize: pt(30), breakBefore: { parity: 'odd' }, advancedDesign: opener,
      marginBottom: pt(0) },
    { level: 2, ...label, fontSize: pt(8.5), lineHeight: pt(LEAD), marginTop: pt(LEAD),
      marginBottom: pt(LEAD / 2) },
    // A section catchline of the Code: bold serif, its turnovers hung under the title.
    { level: 3, fontSize: pt(10), lineHeight: pt(13), marginTop: pt(LEAD / 2),
      marginBottom: pt(LEAD / 2) },
  ] },
  paragraphStyles: [
    // The asterisks of omitted matter, as a comparative print sets them.
    { id: 'elision', textAlign: 'center', firstLineIndent: pt(0), color: col('muted'),
      letterSpacing: em(0.6), marginTop: pt(3), marginBottom: pt(3) },
    { id: 'colophon', fontFamily: SANS, fontSize: pt(7.3), lineHeight: pt(10),
      color: col('muted'), textAlign: 'left', firstLineIndent: pt(0), marginTop: pt(LEAD) },
  ],
  calloutStyles,
  header,
  footer,
};

// ─── 2 · Content ────────────────────────────────────────────────────────────
const markdown = String.raw`---
title: "Copyright Term Extension"
---

# Changes in Existing Law {kicker="S. 505 · Public Law 105-298 · October 27, 1998" dek="Section 102 of the Sonny Bono Copyright Term Extension Act, set out against the sections of title 17 it amends."}

:::callout{type="legend"}
**Coding:** words ~~struck through~~ are deletions; words :underline[underlined] are additions. Matter in which no change is made is printed in roman.
:::

The Sonny Bono Copyright Term Extension Act was signed on October 27, 1998. Its section 102 lengthened every term in chapter 3 of title 17 by twenty years: life of the author and fifty years became life and seventy, the seventy-five years from publication for a work made for hire became ninety-five, and the hundred years from creation became one hundred and twenty.

The Act makes these changes the way most federal statutes do, by amendment: it names the words to strike and the words to insert, and it never prints the section it changes. A reader of the bill alone cannot see the law it leaves behind. This print sets the amending text first, then the sections of the Code as they stood in 1997 with each change marked in place, and last the whole of section 302 as amended.

## The amending text

Subsection (b) of section 102 amends section 302 of title 17, the basic term for works created on or after January 1, 1978. It reads:

:::callout{type="bill" title="Sec. 102(b) · Section 302 of title 17, United States Code, is amended—"}
(1):tab in subsection (a) by striking “fifty” and inserting “70”;

(2):tab in subsection (b) by striking “fifty” and inserting “70”;

(3):tab in subsection (c) in the first sentence— (A) by striking “seventy-five” and inserting “95”; and (B) by striking “one hundred” and inserting “120”; and

(4):tab in subsection (e) in the first sentence— (A) by striking “seventy-five” and inserting “95”; (B) by striking “one hundred” and inserting “120”; and (C) by striking “fifty” each place it appears and inserting “70”.
:::

Subsection (c) changes one date in section 303, and subsection (d) amends section 304, in part by striking its subsection (b) and writing a new one in its place.

## Title 17, United States Code

### § 302. Duration of copyright: Works created on or after January 1, 1978

(a) :smallcaps[In General].—Copyright in a work created on or after January 1, 1978, subsists from its creation and, except as provided by the following subsections, endures for a term consisting of the life of the author and ~~fifty~~ :underline[70] years after the author’s death.

(b) :smallcaps[Joint Works].—In the case of a joint work prepared by two or more authors who did not work for hire, the copyright endures for a term consisting of the life of the last surviving author and ~~fifty~~ :underline[70] years after such last surviving author’s death.

(c) :smallcaps[Anonymous Works, Pseudonymous Works, and Works Made for Hire].—In the case of an anonymous work, a pseudonymous work, or a work made for hire, the copyright endures for a term of ~~seventy-five~~ :underline[95] years from the year of its first publication, or a term of ~~one hundred~~ :underline[120] years from the year of its creation, whichever expires first. If, before the end of such term, the identity of one or more of the authors of an anonymous or pseudonymous work is revealed in the records of a registration made for that work under subsections (a) or (d) of section 408, or in the records provided by this subsection, the copyright in the work endures for the term specified by subsection (a) or (b), based on the life of the author or authors whose identity has been revealed.

:::paragraphs{style="elision"}
\* \* \* \* \* \* \*
:::

(e) :smallcaps[Presumption as to Author’s Death].—After a period of ~~seventy-five~~ :underline[95] years from the year of first publication of a work, or a period of ~~one hundred~~ :underline[120] years from the year of its creation, whichever expires first, any person who obtains from the Copyright Office a certified report that the records provided by subsection (d) disclose nothing to indicate that the author of the work is living, or died less than ~~fifty~~ :underline[70] years before, is entitled to the benefits of a presumption that the author has been dead for at least ~~fifty~~ :underline[70] years. Reliance in good faith upon this presumption shall be a complete defense to any action for infringement under this title.

### § 303. Duration of copyright: Works created but not published or copyrighted before January 1, 1978

(a) Copyright in a work created before January 1, 1978, but not theretofore in the public domain or copyrighted, subsists from January 1, 1978, and endures for the term provided by section 302. In no case, however, shall the term of copyright in such a work expire before December 31, 2002; and, if the work is published on or before December 31, 2002, the term of copyright shall not expire before December 31, ~~2027~~ :underline[2047].

### § 304. Duration of copyright: Subsisting copyrights

:::paragraphs{style="elision"}
\* \* \* \* \* \* \*
:::

(b) ~~:smallcaps[Copyrights in Their Renewal Term or Registered for Renewal Before January 1, 1978].—The duration of any copyright, the renewal term of which is subsisting at any time between December 31, 1976, and December 31, 1977, inclusive, or for which renewal registration is made between December 31, 1976, and December 31, 1977, inclusive, is extended to endure for a term of seventy-five years from the date copyright was originally secured.~~ :underline[:smallcaps[Copyrights in Their Renewal Term at the Time of the Effective Date of the Sonny Bono Copyright Term Extension Act].—Any copyright still in its renewal term at the time that the Sonny Bono Copyright Term Extension Act becomes effective shall have a copyright term of 95 years from the date copyright was originally secured.]

## Section 302 as amended

Read with the amendments made, section 302 stands as follows. Subsection (d), which the Act left alone, is printed with the others, so the box can be read as the law in force.

:::callout{type="amended" title="§ 302 · Works created on or after January 1, 1978"}
(a):tab :smallcaps[In General].—Copyright in a work created on or after January 1, 1978, subsists from its creation and, except as provided by the following subsections, endures for a term consisting of the life of the author and 70 years after the author’s death.

(b):tab :smallcaps[Joint Works].—In the case of a joint work prepared by two or more authors who did not work for hire, the copyright endures for a term consisting of the life of the last surviving author and 70 years after such last surviving author’s death.

(c):tab :smallcaps[Anonymous Works, Pseudonymous Works, and Works Made for Hire].—In the case of an anonymous work, a pseudonymous work, or a work made for hire, the copyright endures for a term of 95 years from the year of its first publication, or a term of 120 years from the year of its creation, whichever expires first. If, before the end of such term, the identity of one or more of the authors of an anonymous or pseudonymous work is revealed in the records of a registration made for that work under subsections (a) or (d) of section 408, or in the records provided by this subsection, the copyright in the work endures for the term specified by subsection (a) or (b), based on the life of the author or authors whose identity has been revealed.

(d):tab :smallcaps[Records Relating to Death of Authors].—Any person having an interest in a copyright may at any time record in the Copyright Office a statement of the date of death of the author of the copyrighted work, or a statement that the author is still living on a particular date. The statement shall identify the person filing it, the nature of that person’s interest, and the source of the information recorded, and shall comply in form and content with requirements that the Register of Copyrights shall prescribe by regulation.

(e):tab :smallcaps[Presumption as to Author’s Death].—After a period of 95 years from the year of first publication of a work, or a period of 120 years from the year of its creation, whichever expires first, any person who obtains from the Copyright Office a certified report that the records provided by subsection (d) disclose nothing to indicate that the author of the work is living, or died less than 70 years before, is entitled to the benefits of a presumption that the author has been dead for at least 70 years. Reliance in good faith upon this presumption shall be a complete defense to any action for infringement under this title.
:::

The Supreme Court upheld the extension in *Eldred v. Ashcroft*, 537 U.S. 186 (2003). Because the Act also added twenty years to works already under copyright, no published work entered the public domain in the United States by expiry of its term until January 1, 2019, when the books, songs and films of 1923 came out of copyright.

:::paragraphs{style="colophon"}
Set in Source Serif 4 and Source Sans 3 (SIL Open Font License) · Text: Pub. L. 105-298, 112 Stat. 2827, and 17 U.S.C. §§ 302–304 as in force in 1997, works of the United States Government in the public domain; subsections (c) and (d) of section 302 are shortened by their last sentences · Editor’s notes: CC BY 4.0.
:::
`; // content.<lang>.md, inlined by the Cookbook

// ─── 3 · Fonts ──────────────────────────────────────────────────────────────
const FONTS = {
  'Source Serif 4': ['400', '400i', '700'],
  'Source Sans 3': ['400', '600', '700'],
};

// ─── 4 · Build & show ───────────────────────────────────────────────────────
const doc = await buildDocumentWithFonts({ markdown }, config, kitFonts(FONTS));
showPages(doc, { title: t({ en: 'Copyright term extension: changes in existing law',
  es: 'Las reformas de la Constitución: texto comparado' }) });
offerPdf(() => renderToPdf(doc, { fontProvider: fontsourceProvider }), `${RECIPE}.pdf`);

// ─── Kit ── helpers shared by every Cookbook recipe · postext.dev/cookbook ─────

// ─── Kit · core v1 ── the same in every recipe · postext.dev/cookbook
function mm(value) { return { value, unit: 'mm' }; }
function pt(value) { return { value, unit: 'pt' }; }
function em(value) { return { value, unit: 'em' }; }
/** The sample language's string: t({ en: 'Figure', es: 'Figura' }). */
function t(strings) { return strings[LANG] ?? Object.values(strings)[0]; }
/** A file in this recipe's assets folder, served from the Postext repo by jsDelivr. */
function asset(file) { return `https://cdn.jsdelivr.net/gh/drnachio/postext@main/cookbook/${RECIPE}/assets/${file}`; }

// ─── Kit · fonts v3 ── the same in every recipe · postext.dev/cookbook
// Postext loads the faces a config asks for before layout and asks the kit
// for Fontsource's files, the ones the PDF embeds too.

/** buildDocumentWithFonts' options: the resolver, and FONTS' faces loaded
 *  with the config's. FONTS = { 'Family Name': ['400', '400i', '700'] }. */
function kitFonts(FONTS = {}) {
  const faces = Object.entries(FONTS).flatMap(([family, specs]) => specs.map((spec) =>
    ({ family, weight: parseInt(spec, 10), style: spec.endsWith('i') ? 'italic' : 'normal' })));
  return { resolve: fontsourceResolver, faces };
}

/** A face's files with their ranges: latin, then latin-ext and greek when
 *  `text` needs them (kitSubsetsFor). Null for a face Fontsource lacks. */
async function fontsourceResolver(family, weight, style, { text = '' } = {}) {
  const id = fontsourceId(family);
  const meta = await fontsourceMeta(family);
  if (meta && !(await fontsourceWeights(family, style)).includes(weight)) return null;
  kitStatus('Loading fonts…');
  const at = await fontsourceAt(id);
  return ['latin', ...kitSubsetsFor(text, meta)].map((subset) => ({
    source: `${at}files/${id}-${subset}-${weight}-${style}.woff2`,
    unicodeRange: kitRanges()[subset],
  }));
}

/** Each file's unicode-range (a function: the kit runs after the pen's code). */
function kitRanges() {
  return {
    latin: 'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,'
      + 'U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
    'latin-ext': 'U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,'
      + 'U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF',
    greek: 'U+0370-03FF',
  };
}

/** For the cjk, arabic and comics blocks: loads `faces` (as FONTS) for the
 *  sample `text`; `optional` skips a face Fontsource lacks. Files are added in
 *  the order asked, the last winning a shared character. Resolves to the count. */
async function loadFonts(faces, text = '', { optional = false } = {}) {
  kitStatus('Loading fonts…');
  const ranges = kitRanges();
  const jobs = [];
  for (const [family, specs] of Object.entries(faces)) {
    const id = fontsourceId(family);
    const todo = [...new Set(specs)].map((spec) => [parseInt(spec, 10), spec.endsWith('i') ? 'italic' : 'normal'])
      .filter(([weight, style]) => !hasFace(family, weight, style)); // before any await
    const at = fontsourceAt(id);
    const meta = optional || /[^\0-ÿ]/u.test(text) ? await fontsourceMeta(family) : null;
    const subsets = ['latin', ...kitSubsetsFor(text, meta)];
    for (const [weight, style] of todo) {
      if (optional && !(meta && (await fontsourceWeights(family, style)).includes(weight))) continue;
      for (const subset of subsets) {
        const url = `${await at}files/${id}-${subset}-${weight}-${style}.woff2`;
        const face = new FontFace(family, `url(${url}) format('woff2')`,
          { weight: String(weight), style, unicodeRange: ranges[subset] });
        jobs.push(face.load().catch(() => {
          if (subset === 'latin' && !optional) throw new Error(`Fontsource has no ${family} ${weight} ${style}`);
        }));
      }
    }
  }
  const ready = await Promise.all(jobs).catch((error) => { kitFail(error); throw error; });
  return ready.filter((face) => face && document.fonts.add(face)).length;
}

/** A loaded FontFace covers this face (fonts.check() says yes to any family). */
function hasFace(family, weight, style) {
  for (const face of document.fonts) {
    if (face.status !== 'loaded' || face.style !== style) continue;
    if (face.family.replace(/^["']|["']$/g, '') !== family) continue;
    const [low, high = low] = face.weight.split(' ').map(Number);
    if (weight >= low && weight <= high) return true;
  }
  return false;
}

/** The files beyond latin `text` needs that `meta`'s family ships. */
function kitSubsetsFor(text, meta) {
  return [[/[Ā-˿ᴀ-ᶿḀ-ỿ†ℓⱠ-Ɀ꜠-ꟿ]/u, 'latin-ext'], [/[Ͱ-Ͽ]/u, 'greek']]
    .filter(([re, x]) => re.test(text) && meta?.subsets?.includes(x)).map(([, x]) => x);
}

/** Fontsource's id for a family: 'Source Serif 4' → 'source-serif-4'. */
function fontsourceId(family) { return family.toLowerCase().replace(/\s+/g, '-'); }

/** A package's folder at the one version @5 names now (#766). */
function fontsourceAt(id, u = `https://cdn.jsdelivr.net/npm/@fontsource/${id}@`) {
  return (fontsourceAt.c ??= {})[id] ??= fetch(u + '5/package.json').then((r) => r.json())
    .then((p) => p.version || 5, () => 5).then((v) => `${u}${v}/`);
}

/** The family's Fontsource metadata (weights, styles, subsets), or null. */
function fontsourceMeta(family, id = fontsourceId(family)) {
  return (fontsourceMeta.c ??= {})[id] ??= fetch(`https://api.fontsource.org/v1/fonts/${id}`)
    .then((res) => (res.ok ? res.json() : null), () => null);
}

/** The weights the package ships in `style`: the API pairs none (no Libre
 *  Caslon 700 italic file), so italics are read from latin-italic.css. */
function fontsourceWeights(family, style, id = fontsourceId(family)) {
  return (fontsourceWeights.c ??= {})[id + style] ??= fontsourceMeta(family).then(async (m) => {
    if (!m?.styles.includes(style)) return m ? [] : [400, 700];
    const css = style === 'italic' ? await fetch(`${await fontsourceAt(id)}latin-italic.css`).then((r) => (r.ok ? r.text() : ''), () => '') : '';
    const w = [...css.matchAll(/weight: (\d+)/g)].map((x) => +x[1]);
    return w.length ? w : m.weights;
  });
}

// ─── Kit · viewer v2 ── the same in every recipe · postext.dev/cookbook
/** The pages as spreads on a dark desk, page 1 alone, then verso | recto,
 *  each painted when it scrolls near. Other options go to renderPageToCanvas. */
function showPages(docs, { title, width = 460, ...render } = {}) {
  const root = viewer(title);
  const pages = [docs].flat().flatMap((doc) =>
    doc.pages.map((page) => ({ doc, page, n: (doc.pageIndexOffset ?? 0) + page.index })));
  const spreads = [];
  let verso = null;
  for (const p of pages) {
    if (p.n % 2 === 1) { if (verso) spreads.push([verso, null]); verso = p; }
    else { spreads.push([verso, p]); verso = null; }
  }
  if (verso) spreads.push([verso, null]);
  const density = Math.min(window.devicePixelRatio || 1, 2);
  showPages.painter?.disconnect();
  const painter = new IntersectionObserver((entries) => {
    for (const { isIntersecting, target } of entries) {
      if (!isIntersecting) continue;
      painter.unobserve(target);
      const { doc, page } = target.postext;
      renderPageToCanvas(page, doc, target, { ...render, scale: (width * density) / page.width });
    }
  }, { rootMargin: '800px' });
  showPages.painter = painter;
  root.replaceChildren(...spreads.map((pair) => {
    const spread = document.createElement('div');
    spread.className = 'pt-spread';
    for (const p of pair) {
      const figure = document.createElement('figure');
      if (p) {
        const label = p.page.pageLabel || String(p.n + 1);
        const canvas = document.createElement('canvas');
        canvas.postext = p;
        canvas.style.aspectRatio = `${p.page.width} / ${p.page.height}`;
        canvas.setAttribute('role', 'img');
        canvas.setAttribute('aria-label', `Page ${label}`);
        const folio = document.createElement('figcaption');
        folio.textContent = label;
        figure.append(canvas, folio);
        painter.observe(canvas);
      } else figure.className = 'pt-blank';
      spread.append(figure);
    }
    return spread;
  }));
  kitStatus(`${pages.length} ${pages.length === 1 ? 'page' : 'pages'}`);
  document.documentElement.dataset.postext = 'ready';
  return pages.length;
}

/** The desk, the bar and the error reporting, created once. */
function viewer(title) {
  if (!document.getElementById('pt-kit')) {
    document.head.insertAdjacentHTML('beforeend', `<style id="pt-kit">
      :root { color-scheme: dark; }
      body { margin: 0; background: #0e1014; color: #b9bcc4; font: 13px/1.45 system-ui, sans-serif; }
      #pt-bar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center;
        gap: 6px 16px; padding: 10px 16px; background: rgb(14 16 20 / .92); backdrop-filter: blur(6px);
        border-bottom: 1px solid #23262d; }
      #pt-bar strong { color: #f4f1ea; font-weight: 600; }
      #pt-actions { display: flex; gap: 12px; margin-left: auto; }
      #pt-actions a, #pt-actions button { color: #d8a21a; font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
      #pages { display: grid; justify-items: center; gap: 48px; padding: 32px 16px 72px; }
      .pt-spread { display: flex; }
      .pt-spread figure { margin: 0; width: min(460px, 44vw); }
      .pt-spread canvas { display: block; width: 100%; background: #fff;
        box-shadow: 0 1px 2px rgb(0 0 0 / .5), 0 22px 44px -16px rgb(0 0 0 / .8); }
      .pt-spread figure:first-child canvas { box-shadow: inset -14px 0 14px -14px rgb(0 0 0 / .18), 0 1px 2px rgb(0 0 0 / .5), 0 22px 44px -16px rgb(0 0 0 / .8); }
      .pt-spread figcaption { margin-top: 10px; text-align: center; font: 600 10px/1 system-ui, sans-serif;
        letter-spacing: .18em; text-transform: uppercase; color: #6c7079; }
      .pt-blank { visibility: hidden; }
      @media (max-width: 760px) {
        .pt-spread { flex-direction: column; gap: 32px; }
        .pt-spread figure { width: min(460px, 92vw); }
        .pt-blank { display: none; }
      }
    </style>`);
    document.body.insertAdjacentHTML('afterbegin',
      '<header id="pt-bar"><strong id="pt-title"></strong><span id="pt-status" role="status"></span><span id="pt-actions"></span></header>');
    document.getElementById('pt-title').textContent = document.title || 'Postext';
    addEventListener('error', (event) => kitFail(event.error ?? event.message));
    addEventListener('unhandledrejection', (event) => kitFail(event.reason));
  }
  if (title) document.getElementById('pt-title').textContent = title;
  return document.getElementById('pages')
    ?? document.body.appendChild(Object.assign(document.createElement('main'), { id: 'pages' }));
}

function kitStatus(text) {
  viewer();
  document.getElementById('pt-status').textContent = text;
}

function kitFail(error) {
  document.documentElement.dataset.postext = 'error';
  kitStatus(`Error: ${error?.message ?? error}`);
}

// ─── Kit · pdf v3 ── the same in every recipe that exports a PDF
/** The Fontsource files the screen used, as TrueType, with their range and
 *  place: the nearest weight the family ships in that style, upright with no italic;
 *  latin, then what its letters need (kitSubsetsFor). */
async function fontsourceProvider(family, weight, style, request) {
  const id = fontsourceId(family);
  const meta = await fontsourceMeta(family);
  const s = style === 'italic' && meta && !meta.styles.includes('italic') ? 'normal' : style;
  const shipped = meta ? await fontsourceWeights(family, s) : [];
  const weights = shipped.length ? shipped : [400, 700];
  const w = weights.reduce((a, b) => (Math.abs(b - weight) < Math.abs(a - weight) ? b : a));
  const text = String.fromCodePoint(...(request?.codePoints ?? []));
  const files = await Promise.all(['latin', ...kitSubsetsFor(text, meta)].map(async (subset, order) => {
    const res = await fetch(`${await fontsourceAt(id)}files/${id}-${subset}-${w}-${s}.woff2`);
    if (!res.ok) throw new Error(`Fontsource has no ${family} ${w} ${s} ${subset}`);
    return Object.assign(await decompressWoff2(new Uint8Array(await res.arrayBuffer())),
      { unicodeRange: kitRanges()[subset], order });
  }));
  return files.length === 1 ? files[0] : files;
}

/** A "Build the PDF" button; then "Open the PDF" (a new tab: CodePen's frame
 *  shows no PDFs) and a download link. */
function offerPdf(makePdf, filename) {
  viewer();
  const button = Object.assign(document.createElement('button'), { type: 'button', textContent: 'Build the PDF' });
  button.dataset.postextPdf = filename;
  button.addEventListener('click', async () => {
    button.disabled = true;
    button.textContent = 'Building the PDF…';
    try {
      const bytes = await makePdf();
      const url = URL.createObjectURL(new Blob([bytes], { type: 'application/pdf' }));
      const size = `${Math.max(1, Math.round(bytes.length / 1024))} KB`;
      button.replaceWith(
        Object.assign(document.createElement('a'), { href: url, target: '_blank', rel: 'noopener', textContent: 'Open the PDF ↗' }),
        Object.assign(document.createElement('a'), { href: url, download: filename, textContent: `Download ${filename} · ${size}` }));
    } catch (error) {
      button.disabled = false;
      button.textContent = 'Build the PDF';
      kitFail(error);
    }
  });
  document.getElementById('pt-actions').append(button);
}

// ─── /Kit ───────────────────────────────────────────────────────────────────────
```

## Variations

### Write insertions as `++text++`

With `plusUnderline` on, `++70++` underlines like `:underline[70]`, the spelling Pandoc and markdown-it use for inserted text.

```diff
     textAlign: 'justify', firstLineIndent: mm(4.5), indentAfterHeading: false,
+    plusUnderline: true, // ++text++ underlines; C++ in the text is then written C\+\+
```

### Keep the bill's clauses together

Without `keepTogether: false` the box moves whole to page 2 and page 1 ends on the line that introduces it.

```diff
-    padding: pad(2.5, 0), body: clauses, keepTogether: false, // it may run on to the next page
+    padding: pad(2.5, 0), body: clauses,
```

## Pitfalls

- A paragraph that opens with a number and a full stop (`2. Solamente…`) is read as a list item, and a backslash before the stop prints. The Spanish edition puts a word joiner (U+2060) between the digit and the stop in the running text, and in the box writes the tab straight after the stop, `1.:tab`, which no list marker matches.
- Colour alone would not survive a photocopy, which is how such prints often travel; struck and underlined words read in black and white, which is why drafters chose them.

## Credits

- Recipe: Ignacio Ferro ([@drnachio](https://github.com/drnachio))
- Text: Section 102 of the Sonny Bono Copyright Term Extension Act (Pub. L. 105-298, 112 Stat. 2827, 1998) and sections 302–304 of title 17, United States Code, as in force in 1997: United States Congress ([source](https://www.govinfo.gov/content/pkg/PLAW-105publ298/html/PLAW-105publ298.htm)), public domain
- Text: Articles 13.2, 49 and 135 of the Spanish Constitution in their 1978 wording and the reforms of 1992, 2011 and 2024 (official texts, not subject to copyright under art. 13 LPI): Cortes Generales, Boletín Oficial del Estado ([source](https://www.boe.es/buscar/act.php?id=BOE-A-1978-31229)), public domain
- Text: The editor’s notes, the coding legends and the colophons: Ignacio Ferro, CC-BY-4.0
- Type: Source Serif 4 (OFL-1.1), Source Sans 3 (OFL-1.1)
- Code: MIT · Sample content: CC-BY-4.0

## Related

- [Nº 099 · A legal opinion cited in OSCOLA](https://postext.dev/en/cookbook/legal-opinion-oscola.md): A four-page case comment whose [@robinson2018, para 21] citations become OSCOLA footnotes: cases in italics, neutral citations, ibid and (n 1) cross-references. · Level 2 (Intermediate) · Papers & academic
- [Nº 176 · Old-style, lining and tabular figures](https://postext.dev/en/cookbook/old-style-and-tabular-figures.md): Thoreau's accounts from Walden: figureStyle sets lining figures in the small-capital headings and tabular ones in the accounts; the prose keeps old-style. · Level 2 (Intermediate) · Fiction, drama & literary prose
- [Nº 128 · A Meiji proclamation in kanji and katakana](https://postext.dev/en/cookbook/katakana-majiri-proclamation.md): The 1889 Constitution set vertically in kanji and katakana: articles 第一條 from a japanese-informal list counter, a ruled frame, countersignatures at the foot. · Level 2 (Intermediate) · Reports, Single sheets & ephemera
