# 删去的划删除线、新增的加下划线的修正对照

> 一份版权法的修正对照本：删去的词加删除线，新增的词加下划线，最后把修正后的条文放进一个条款悬挂排列的框里。

- HTML版本: https://postext.dev/zh/cookbook/amendment-redline
- 食谱 No. 182 · 字体与文字 · 难度 2 (中级) · 输出: Canvas, PDF
- 体裁: 报告
- 需要 postext ≥ 1.73.0, postext-pdf ≥ 1.73.0 · 已用 1.73.0, postext-pdf 1.73.0 测试，日期 2026-11-10
- 页面: [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
- 在沙盒中打开: https://postext.dev/zh/sandbox#recipe=amendment-redline&lang=en (.postext: https://postext.dev/cookbook/amendment-redline/en/amendment-redline.postext)
- 最后更新: 2026-11-10
- 其他语言: [en](https://postext.dev/en/cookbook/amendment-redline.md), [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), [ja](https://postext.dev/ja/cookbook/amendment-redline.md), [ar](https://postext.dev/ar/cookbook/amendment-redline.md)

## 简单来说

一份简短的立法对照文件。先列出法律的旧文，删去的词划掉，新增的词加下划线，再把修正后的整节放进一个灰色的框里。

## 成品一览

一份随法案印发的委员会文件：五页，展示 1998 年《桑尼·波诺版权期限延长法》第 102 条对《美国法典》第 17 编做了哪些修改。法律本身只说“删去‘fifty’，插入‘70’”；这份文件把修改前的法律排出来，每处改动标在原位，删去的划删除线，新增的加下划线，上面印着联邦和各州起草人员在这类文本前印的图例；随后是修正后的第 302 条，放在一个浅色底的框里，各款字母在框边，正文及其转行悬挂在后。西班牙语版用同样的办法排出西班牙宪法 1992、2011 和 2024 年在《国家官方公报》（BOE）上公布的三次修改。

**这份食谱回答的问题:**

- 怎样展示一项修正：删去的词加删除线，新增的词加下划线？

## 简短回答

```js
// script.js, 行 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 },
];
```

## 用料

**讲解**

- [删除线](https://postext.dev/zh/docs/document-format-inline.md#删除线): 用 ~~text~~ 写出的贯穿短语的线，就像价目表划掉原价、旁边写上新价：文字仍是普通正文，可以跨行，线跟着每一行上的那一段。
- [下划线](https://postext.dev/zh/docs/document-format-inline.md#下划线): 用 :underline[text] 写出的画在短语下面的线（打开 bodyText.plusUnderline 后也可写 ++text++），就像表格给不能漏看的提示加下划线：文字仍是普通正文，可以跨行，线跟着每一行上的那一段。
- [框内悬挂缩进的段落](https://postext.dev/zh/docs/configuration-callouts.md#框内的排版): 框样式的 body.hangingIndent 让框内每个段落悬挂排列：标记（编号或条款字母）从框的内边开始，正文及其转行退进一点，就像条款、注释和定义的排法。

**还用到**

- [制表位与前导符](https://postext.dev/zh/docs/configuration-text.md#制表位)
- [标注框](https://postext.dev/zh/docs/configuration-callouts.md#标注框样式)
- [拆分或保持完整的框](https://postext.dev/zh/docs/configuration-callouts.md#callout容器)
- [语义调色板](https://postext.dev/zh/docs/configuration-fonts-colors-viewers.md#调色板)
- [设计过的章首页](https://postext.dev/zh/docs/configuration-headings.md#通栏与高级设计)
- [标题属性](https://postext.dev/zh/docs/document-format.md#标题属性)
- [书眉与页码](https://postext.dev/zh/docs/configuration-headers-footers.md#页眉与页脚)
- [按页面角色显示书眉](https://postext.dev/zh/docs/configuration-headers-footers.md#文本元素)
- [对称页边距](https://postext.dev/zh/docs/configuration-page-layout.md#对称页边距)
- [段落样式](https://postext.dev/zh/docs/configuration-styles.md#段落样式)
- [段末孤行、段首孤行与孤字](https://postext.dev/zh/docs/configuration-page-flow.md#段首孤行段末孤行孤字与不拆分规则)
- [导出PDF](https://postext.dev/zh/docs/configuration-pdf-output.md#生成pdf)
- [嵌入PDF的字体](https://postext.dev/zh/docs/configuration-pdf-output.md#为什么需要字体提供函数)

**配置一览**

- [`bodyText`](https://postext.dev/zh/docs/configuration-text.md#正文), [`calloutStyles`](https://postext.dev/zh/docs/configuration-callouts.md#标注框样式), [`colorPalette`](https://postext.dev/zh/docs/configuration-fonts-colors-viewers.md#调色板), [`footer`](https://postext.dev/zh/docs/configuration-headers-footers.md#页眉与页脚), [`header`](https://postext.dev/zh/docs/configuration-headers-footers.md#页眉与页脚), [`headings`](https://postext.dev/zh/docs/configuration-headings.md#标题), [`layout`](https://postext.dev/zh/docs/configuration-page-layout.md#版式), [`locale`](https://postext.dev/zh/docs/configuration-language.md#断词), [`page`](https://postext.dev/zh/docs/configuration-page-layout.md#页面), [`paragraphStyles`](https://postext.dev/zh/docs/configuration-styles.md#段落样式)

**API**

- [`buildDocumentWithFonts`](https://postext.dev/zh/docs/configuration-programmatic-usage.md#排版前加载字体), [`decompressWoff2`](https://postext.dev/zh/docs/configuration-pdf-output.md#浏览器字体提供函数fontsource--woff2), [`renderPageToCanvas`](https://postext.dev/zh/docs/configuration-programmatic-usage.md#把页面渲染为位图), [`renderToPdf`](https://postext.dev/zh/docs/configuration-pdf-output.md#生成pdf)

**字体**

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

## 做法

### 1 · 在改动发生的地方标出改动

代码就是上面的[简短回答](https://postext.dev/zh/cookbook/amendment-redline.md#简短回答)。标记写在 Markdown 里：`~~fifty~~ :underline[70]` 划掉旧词，给新词加下划线（[删除线](https://postext.dev/zh/docs/document-format-inline.md#删除线)、[下划线](https://postext.dev/zh/docs/document-format-inline.md#下划线)）。两种线都不占位置，所以一段六行的被删条款和周围的正文一样两端对齐、断词；第 3 页上旧的第 304(b) 款整段划掉，新条文在同一段里加下划线。每条线都按字体本身的删除线和下划线参数画出，颜色跟随文字，所以小型大写的款目标题有自己高度上的线。

### 2 · 让框里的条款悬挂排列

在框样式里设 `body.hangingIndent`，框内所有段落都悬挂排列（[框内的排版](https://postext.dev/zh/docs/configuration-callouts.md#框内的排版)）：首行从框的内边开始，其余各行退进 7 mm。在同样 7 mm 处设一个制表位，把“(a)”或“(c)”后面的正文带到这条边上，不管字母多宽；所以 Markdown 里写 `(a):tab In General.—…`。法案条款和修正后的条文用同一套排版，只是框不同：法案上方一条红线，现行条文后面一层底色。法案的框可以拆开（`keepTogether: false`），所以第 1 页以它的前两项结束。

### 3 · 开篇的色带

```js
// script.js, 行 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' } } },
  ] } };
```

深蓝色带从页面上边和左右两边出血，栏目标签和导语来自标题行上的属性（[标题属性](https://postext.dev/zh/docs/document-format.md#标题属性)）。`minHeight` 决定图例从哪里开始，在色带下方几毫米处。

### 4 · 按奇偶页排的书眉

```js
// script.js, 行 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) })] };
```

偶数页印文件标题，奇数页印该页开头所在的部分，取自页上第一个二级标题。`pages: 'body'` 让书眉不出现在开篇页，开篇页改在页脚印页码。

## 完整食谱

一个文件，由食谱文件夹合成，示例文本和排版食谱的公共工具包都已内联；它自己排出页面。要运行它，把它放进空白页面的`<script type="module">`，或粘贴到新建CodePen的JS面板里（设为模块）。它从esm.sh导入postext，不需要安装或构建。

- 食谱文件夹: 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 ───────────────────────────────────────────────────────────────────────
```

## 变化

### 把新增部分写成 `++text++`

打开 `plusUnderline` 后，`++70++` 和 `:underline[70]` 一样加下划线，这是 Pandoc 和 markdown-it 表示插入文字的写法。

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

### 让法案的条款不拆开

去掉 `keepTogether: false`，整个框移到第 2 页，第 1 页停在引出它的那一行。

```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,
```

## 常见问题

- 以数字加句点开头的段落（`2. Solamente…`）会被当作列表项，在句点前加反斜杠则会把反斜杠印出来。西班牙语版在正文里于数字和句点之间放一个字连接符（U+2060），在框里则把制表符紧跟在句点后面写成 `1.:tab`，这不是列表标记。
- 只靠颜色经不起复印，而这类文件常常就是复印着传阅的；删除线和下划线在黑白复印件上照样看得清，起草人员正是因此选用它们。

## 致谢

- 食谱: Ignacio Ferro ([@drnachio](https://github.com/drnachio))
- 文字: 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 ([来源](https://www.govinfo.gov/content/pkg/PLAW-105publ298/html/PLAW-105publ298.htm)), 公有领域
- 文字: 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 ([来源](https://www.boe.es/buscar/act.php?id=BOE-A-1978-31229)), 公有领域
- 文字: The editor’s notes, the coding legends and the colophons: Ignacio Ferro, CC-BY-4.0
- 字体: Source Serif 4 (OFL-1.1), Source Sans 3 (OFL-1.1)
- 代码: MIT · 示例内容: CC-BY-4.0

## 相关食谱

- [No. 099 · 用OSCOLA格式引注的法律评论](https://postext.dev/zh/cookbook/legal-opinion-oscola.md): 一篇四页的判例评论：正文写[@robinson2018, para 21]，引文按OSCOLA排成脚注，判例名用斜体，带中立引注、ibid和(n 1)回指。 · 难度 2 (中级) · 论文与学术出版物
- [No. 176 · 旧式数字、等高数字与等宽数字](https://postext.dev/zh/cookbook/old-style-and-tabular-figures.md): 《瓦尔登湖》里梭罗的账目：figureStyle让小型大写字母标题用等高数字，账目用等宽数字，正文保留字体自带的旧式数字。 · 难度 2 (中级) · 小说、戏剧与文学散文
- [No. 128 · 汉字片假名混写的明治文告](https://postext.dev/zh/cookbook/katakana-majiri-proclamation.md): 1889年宪法竖排，用汉字和片假名：条文编号第一條来自japanese-informal列表计数器，外加文武线边框，副署排在行末。 · 难度 2 (中级) · 报告, 单页与零散印品
