かんたんな説明
1981年の公衆衛生の週報を、レター判の紙に組み直したものです。症例、報告した医師の一覧、編集部のコメントと、段落の種類ごとに見た目を変え、参考文献には自動で番号が付きます。
できあがり
USレター判の疫学週報6ページです。のちにエイズと呼ばれるものを米国疾病管理センター(CDC)が初めて記述した2本の報告を再録しています。ロサンゼルスのPneumocystis肺炎5例(1981年6月5日)と、それに続くカポジ肉腫の症例(1981年7月3日)です。題字は当時の官庁の広報誌をふまえたオリジナルのデザインで、青い帯にコンデンスのサンセリフの題字、その下にPlex Serifの2段組みが続きます。報告の声ごとにスタイルがあります。太字の番号ラベルの下の症例、小さなイタリックのReported by、Editorial Note(編集部注)、括弧付きの引用番号、番号付きの文献リストです。本文、参考文献、表はCDCが印刷したとおりで、タイムラインと2ページの症例表は編集部が加えたものです。
このレシピが答える質問
- 週報の報告を組むには(題字、症例、編集部注、番号付きの参考文献)?
- APA、IEEEなどの引用スタイルで、文献を引用し参考文献を作るには?
- 見出し行、結合セル、列幅、セルごとのそろえを備えた表を作るには?
- arXivやPubMed Centralのオープンアクセス論文を、引用・図・ライセンス表記を保ったままPostextで組み直すには?
手短な答え
// :::paragraphs{style="…"} wraps the blocks of each voice; **Patient 1:** is a run-in label.
const voice = (id, family, size, lead, extra) => ({ id, fontFamily: family, fontSize: pt(size),
lineHeight: pt(lead), color: col('ink'), boldColor: col('ink'), ...extra });
const aside = { textAlign: 'left', firstLineIndent: pt(0), snapToGrid: false };
const paragraphStyles = [
// Case histories and the Editorial Note: the body texture, bold labels in the accent.
voice('case', TEXT, 9.5, LEAD, { boldColor: col('accent'), boldFontWeight: 600 }),
voice('editorial', TEXT, 9.5, LEAD, { boldColor: col('accent'), boldFontWeight: 600 }),
// "Reported by …": the authors' line, italic small type in the condensed sans, off the grid.
voice('reported', LABEL, 7.8, 10.2, { ...aside, italic: true, color: col('muted'),
hyphenation: false, marginTop: pt(4), marginBottom: pt(6) }),
// A line the reprint adds, in the label face and the accent: never taken for 1981 text.
voice('editor', LABEL, 8, 10.6, { ...aside, italic: true, color: col('accent'),
marginTop: pt(3), marginBottom: pt(5) }),
voice('colophon', LABEL, 7.4, 9.6, { ...aside, color: col('muted'), marginTop: pt(LEAD) }),
];
// MMWR cited (1) in citation order, and each report (its H1 is a chapter) counted from 1.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = { style: 'american-medical-association', marker: 'parentheses',
numbering: 'chapter', bibliography: { scope: 'chapter', fontSize: em(0.86),
lineHeight: pt(10.6), entrySpacing: pt(1.5), labelAlign: 'right' } };
材料
- 機能
- 段落スタイルデザインした章扉参考文献から作る文献一覧引用スタイルによる引用脚注表スタイル独自のリソースの種類キャプションのスタイル図の配置柱とノンブルページの役割ごとの柱見出しスタイル見出しの属性1段組みと2段組み仕上がりサイズセマンティックカラーパレットPDFの書き出し
- 種類
- IBM Plex Serif, Libre Franklin, IBM Plex Sans Condensed (SIL OFL 1.1)
- 素材
- Figure 1, timeline of the five cases, drawn in code from the dates in the case reports (Ignacio Ferro, オリジナル)
作り方
#1 · 声ごとに段落スタイルを一つ
コードは上の手短な答えです。週報の報告はいくつかの調子で書かれています。症例、報告者の一覧、編集部のコメントです。それぞれを:::paragraphs{style="…"}で囲むと、言葉に手を入れずに見た目を変えられます。Reported byは7.8 ptのコンデンスのイタリックに下げてベースライングリッドから外し、症例は本文の調子のまま**Patient 1:**のラベルだけをアクセント色にします。引用は[@walzer1974]と書きます。american-medical-associationにmarker: 'parentheses'を組み合わせると(1)と印刷され、リストは週報と同じく引用順に並びます。numbering: 'chapter'で報告ごとに引用を1から数え、scope: 'chapter'で同じ番号のリストを各報告の下に置きます。
#2 · 最初の報告を開く題字
// Kicker and dateline are attributes of each report's H1; {titleText} read with inlineMarks
// keeps the italic genus. The July report opens where June ends, under a double rule.
const reportHead = (y, size) => [
text('kicker', '{attr.kicker}', LABEL, 8.5, { ...caps(8.5), color: col('accent'),
placement: at('container', 'top-left', 0, y, MEASURE) }),
text('title', '{titleText}', DISPLAY, size, { fontWeight: 800, lineHeight: 1.08,
inlineMarks: true, placement: at('#kicker', 'below', 0, 2.2, MEASURE) }),
text('dateline', '{attr.dateline}', LABEL, 9, { color: col('muted'),
placement: at('#title', 'below', 0, 2, MEASURE) }),
];
const masthead = { enabled: true, minHeight: mm(72), slot: { elements: [
{ kind: 'box', id: 'band', style: { backgroundColor: col('accent') }, placement: {
anchor: { to: 'page', edge: 'top-left' }, size: { width: 'fill', height: mm(49) } } },
// The series line, the reprint's number, its description and contents are the first H1's.
text('series', '{attr.series}', LABEL, 8,
{ ...caps(8), color: col('paper'), placement: at('page', 'top-left', SIDE, 11, 120) }),
text('number', '{attr.reprint}', LABEL, 8, { ...caps(8), color: col('paper'), align: 'right',
placement: at('page', 'top-right', -SIDE, 11, 50) }),
text('wordmark', 'Surveillance Notes', DISPLAY, 50, { fontWeight: 800, color: col('paper'),
letterSpacing: pt(-1), lineHeight: 1, placement: at('page', 'top-left', SIDE - 1, 18) }),
text('issue', '{attr.issue}', TEXT, 9.5,
{ lineHeight: 1.3, placement: at('container', 'top-left', 0, 29, 92) }),
text('contents', '{attr.contents}', LABEL, 8, { inlineMarks: true, lineHeight: 1.3,
placement: at('container', 'top-right', 0, 29, 76), align: 'left' }),
rule('rule-a', 46.5, 2), rule('rule-b', 48, 0.5), ...reportHead(52, 23),
] } };
const opener = { enabled: true, minHeight: mm(26), slot: { elements: [rule('rule-a', 0, 2),
rule('rule-b', 1.5, 0.5), ...reportHead(5, 18)] } };
題字は最初の報告の見出しスタイルのデザインなので、1ページに一度だけ印刷され、柱はそのページを飛ばします(pages: 'body')。小見出しと日付行は各報告のH1の属性から取り、表題は{titleText}です。テキスト要素にinlineMarks: trueを付けると、見出しの属名のイタリックが残ります。7月の報告は二重罫の下に同じ3つの要素を置いて始まります。その見出しスタイルはspanBreak: falseでページ幅に渡るので、見出しは6月の報告が終わったところから始まります。上の段は終わりがそろい、本文は下の2段に続きます。週報が報告を次々に続けて組んだのと同じです。
#3 · タブ区切りのテキストから3つの表
const NUMBER = /^[\d,.()% –]*$/; // a column of counts aligns right, its heading centred
const table = (tsv, headerRows, columnWidths) => {
const model = parseTSV(tsv, { headerRows });
const numeric = model.rows[0].map((_, c) => model.rows.slice(headerRows)
.every((row) => NUMBER.test(row[c].content)));
return { ...model, columnWidths, rows: model.rows.map((cells, r) => cells.map((cell, c) =>
(numeric[c] ? { ...cell, align: r < headerRows ? 'center' : 'right' } : cell))) };
};
// Two header rows, as the weekly printed them: "25th week ending" spans two columns.
const notifiable = [[0, 0, 1, 0], [0, 1, 0, 2], [0, 3, 1, 3], [0, 4, 0, 6]]
.reduce((m, [r1, c1, r2, c2]) => mergeCells(m, { start: { row: r1, col: c1 },
end: { row: r2, col: c2 } }), table(NOTIFIABLE, 2, [3.6, 1, 1, 1, 1.1, 1.1, 1.1]));
const added = 'Compiled for this reprint from the case reports; not part of the 1981 report.';
const res = (id, typeId, kind, placement, more) => ({ id, typeId, kind, placement,
createdAt: 0, updatedAt: 0, ...more });
const resources = [
res('fig-timeline', 'figure', 'svg', { position: 'bottom', span: 'page' }, {
svg: { fileId: 'timeline.svg', width: 1780, height: 490 },
caption: 'The five patients, September 1980 to May 1981, by month. The illness before '
+ 'the pneumonia is counted back from the month of diagnosis, as each report gives it.',
note: `Drawn by the editors. ${added}`,
altText: 'A timeline of five rows, one per patient: Pneumocystis pneumonia diagnosed '
+ 'between February and April 1981, two deaths in March and May.' }),
res('tbl-cases', 'table', 'table', { position: 'top', span: 'page' }, {
caption: 'The five case reports at a glance.', note: added,
table: { model: table(CASES, 1, [0.7, 0.45, 1, 2.2, 2.4, 1.5]) } }),
res('tbl-complaints', 'table', 'table', { position: 'bottom' }, {
caption: 'Presenting complaints in 20 patients with Kaposi’s sarcoma',
table: { model: table(COMPLAINTS, 1, [2, 1.15]) } }),
res('tbl-notifiable', 'table', 'table', { position: 'here' }, {
caption: 'Summary — cases of specified notifiable diseases, United States',
note: 'Cumulative totals include revised and delayed reports through previous weeks.',
table: { model: notifiable, styleId: 'weekly' } }),
];
表はどれもタブ区切りのテキストを入れたコンテンツスロットで、表計算ソフトからコピーしたときの形式です。parseTSVがこれを表のモデルにします。数字の列は右そろえで見出しは中央、4回のmergeCellsで届出疾患の集計表の2行の見出しを作ります。表の種類はH1ごとに番号を振り直す(resetOn: 'h1')ので、1981年と同じく報告ごとに表1があります。
#4 · 一つの青をすべてにリンク
const palette = { ink: '#1c1f24', accent: '#1f3f74', tint: '#e6eaf1', rule: '#a7b1c2',
muted: '#566070', paper: '#ffffff' };
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.accent })
.map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
帯、ラベル、ノンブル、表の見出し行、図はすべて同じパレットの項目を参照しています。accentを自分の週報の色に替えれば、6ページの色が一度に変わります。
レシピの全体
// ═══ Postext Cookbook · Nº 143 · A weekly bulletin report: the first AIDS reports ═══
// https://postext.dev/en/cookbook/outbreak-report-bulletin
// Code: MIT · Text: CDC, MMWR 1981;30:250–252 and 305–308 (public domain) · Chart: original
// Fonts: IBM Plex Serif, Libre Franklin, Plex Sans Condensed (OFL) · Needs postext ≥ 1.34.0
import {
buildDocumentWithFonts, renderPageToCanvas, registerCitationEngine, registerResourceImage,
defaultResourceTypes, parseTSV, mergeCells, inlineSvgFonts,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
import { createCiteprocEngine, STYLES, LOCALES } from 'https://esm.sh/postext-citeproc';
const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'outbreak-report-bulletin';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: a federal blue on office white, every colour linked by id
const palette = { ink: '#1c1f24', accent: '#1f3f74', tint: '#e6eaf1', rule: '#a7b1c2',
muted: '#566070', paper: '#ffffff' };
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.accent })
.map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
// #endregion
const [TEXT, DISPLAY, LABEL] = ['IBM Plex Serif', 'Libre Franklin', 'IBM Plex Sans Condensed'];
const [TRIM_W, TRIM_H, TOP, BOTTOM, SIDE, GUTTER] = [215.9, 279.4, 22, 20, 19, 6.35];
const MEASURE = TRIM_W - 2 * SIDE; // US Letter, two columns of 86 mm
const LEAD = 13; // pt: 9.5 pt Plex Serif, as a bulletin sets two columns of Letter
const text = (id, content, family, size, extra) => ({ kind: 'text', id, content, align: 'left',
fontFamily: family, fontSize: pt(size), color: col('ink'), overflow: 'wrap', ...extra });
const at = (to, edge, x, y, width) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) },
...(width && { size: { width: mm(width), height: 'auto' } }) });
const caps = (size, extra) => ({ fontFamily: LABEL, fontSize: pt(size), fontWeight: 600,
letterSpacing: pt(size * 0.18), textTransform: 'uppercase', ...extra });
const rule = (id, y, thickness) => ({ kind: 'rule', id, color: col('accent'),
thickness: pt(thickness), placement: at('container', 'top-left', 0, y, MEASURE) });
// #region masthead: the bulletin's band, issue strip and contents over the first report
// Kicker and dateline are attributes of each report's H1; {titleText} read with inlineMarks
// keeps the italic genus. The July report opens where June ends, under a double rule.
const reportHead = (y, size) => [
text('kicker', '{attr.kicker}', LABEL, 8.5, { ...caps(8.5), color: col('accent'),
placement: at('container', 'top-left', 0, y, MEASURE) }),
text('title', '{titleText}', DISPLAY, size, { fontWeight: 800, lineHeight: 1.08,
inlineMarks: true, placement: at('#kicker', 'below', 0, 2.2, MEASURE) }),
text('dateline', '{attr.dateline}', LABEL, 9, { color: col('muted'),
placement: at('#title', 'below', 0, 2, MEASURE) }),
];
const masthead = { enabled: true, minHeight: mm(72), slot: { elements: [
組み立てたscript.jsはそのまま動きます。任意のページのモジュールスクリプトに貼り付けるか、レシピをCodePenで開いてください。 GitHub上のレシピのフォルダー ↗ (新しいタブで開きます)
アレンジ
#上付きの参考文献番号
医学誌の多くは番号を括弧に入れず、上付きにします。
-const citations = { style: 'american-medical-association', marker: 'parentheses',
+const citations = { style: 'american-medical-association', marker: 'superscript',#報告ごとに改ページする
報告を別々に保存する再録シリーズでは、各報告を新しいページから始めます。
- { id: 'report', span: 'page', spanBreak: false, advancedDesign: opener },
+ { id: 'report', span: 'page', advancedDesign: opener },#バンクーバー方式の文献リスト
バンクーバー方式の医学論文では、同梱のelsevier-vancouverスタイルをNLMの参考文献の形に合わせて手直ししています。
よくあるつまずき
numbering: 'chapter'がないと、参考文献の番号は文書全体の通し番号になり、scope: 'chapter'はリストを分けるだけです。7月の報告は文献4と6〜23を引用することになり、週報が印刷した1〜19と食い違います。- 1981年の脚注Paired specimens not run in parallelの合印はアステリスクです。
footnotes.numberFormat: 'symbols'は*、†、‡の順に付け、ページごとに数え直します。このうちFontsourceの書体のlatinファイルにあるのはアステリスクだけで(ダガーはlatin-ext、ダブルダガーはどちらにもない)、1ページに脚注が2つか3つあるときは、それらの記号を含む書体を使うか、symbols: ['*', '§', '¶']を指定します。 - 1981年の文章は当時の用語も含めて印刷されたとおりに残し、そのことを奥付に記しています。再録では元の本文を直さず、編集部が加えたもの(タイムライン、症例表、最初の段落の下の青いイタリックの一行)は独自のスタイルで組み、そうと明記します。
クレジット
- 本文
- "Pneumocystis Pneumonia — Los Angeles", MMWR 1981;30(21):250–252, and "Kaposi's Sarcoma and Pneumocystis Pneumonia Among Homosexual Men — New York City and California", MMWR 1981;30(25):305–308, re-set in full from the printed issues; Table 1 of the first report and Figure 1 added by the editors from the case reports. "All material in the MMWR Series is in the public domain and may be used and reprinted without special permission; citation as to source, however, is appreciated." · Centers for Disease Control (CDC) · パブリックドメイン
- 画像
- Figure 1, timeline of the five cases, drawn in code from the dates in the case reports · Ignacio Ferro · オリジナル
- フォント
- IBM Plex Serif (SIL OFL 1.1) · Libre Franklin (SIL OFL 1.1) · IBM Plex Sans Condensed (SIL OFL 1.1)


