かんたんな説明
異なる著者による論考を集めた本です。各論考の題の下に著者名が入り、論文集の通例どおり、最後にそれぞれの文献一覧が付きます。
できあがり
『The Working Page』は印刷の歴史をめぐる小さな論文集で、2人の研究者が編集し、3人が執筆しています。各論考は寄稿者から、それぞれ自分のBibTeXブロックを含むMarkdownファイルとして届き、本もその形のまま保ちます。判型は155 × 235mm、書体はLibre Caslon、扉は赤、章は番号、題、寄稿者名で始まります。各章はChicago著者・年方式による自分の「References」一覧で終わり、そこにはその論考が引用した文献だけが入ります。Eisensteinの『Printing Press as an Agent of Change』は2人の寄稿者が引用しているので、両方の一覧に載ります。Gaskellの『New Introduction to Bibliography』も同じく、第1章と第3章に載ります。
このレシピが答える質問
- 編著の各章に、専用の著者と参考文献を与えるには?
- APA、IEEEなどの引用スタイルで、文献を引用し参考文献を作るには?
手短な答え
// Citations are [@key] in the text; each contributor's BibTeX goes in a :::references block
// in their own chapter. Register the engine once, before the first build.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
style: 'chicago-author-date', // the humanities' author-date: (Eisenstein 1979)
bibliography: {
// 'chapter': a :::bibliography lists the works its own document cites, so a work two
// contributors cite appears in both lists. 'book' (the default) would print one list,
// after the last chapter. The scope is per document, not per H1: each essay must be a
// document of its own in buildBundle (see the chapters region).
scope: 'chapter',
title: '', // no bold title paragraph: each chapter has its own ## References heading
fontSize: em(0.9), lineHeight: pt(12.4), hangingIndent: mm(5), entrySpacing: pt(2.6),
},
};
// Numbering and disambiguation still see the whole book: two Smiths of 2001 in different
// chapters would print 2001a and 2001b, as one bibliography would.
材料
- 機能
- 参考文献から作る文献一覧引用スタイルによる引用章ごとに組む本見出しの属性デザインした章扉目次柱とノンブルページの役割ごとの柱見出しスタイル番号のない章表紙、扉、奥付デザイン要素の基準位置フロートする囲み見開きの余白セマンティックカラーパレットPDFの書き出し
- 種類
- Libre Caslon Text, Libre Caslon Display, IBM Plex Sans Condensed (SIL OFL 1.1)
- 素材
- なし:画像はすべてコードで描画
作り方
#1 · 寄稿者ごとに1つの文書
// A chapter's :::bibliography lists what that document cites; one Markdown file holding all
// three essays would make every list repeat the works of the chapters before it.
const chapters = [front, lowe, okafor, ferrer].map((markdown) => ({ markdown }));
const book = () => buildBundle({ chapters, config: config(), resources: [] });
手短な答えのスコープは、文書のスコープです。buildBundleは4つの文書を1冊の本として組むので、ノンブル、章番号、目次は通して続き、一方で各:::bibliographyは自分のファイルの引用を集めます。文献データは寄稿者が書いた場所に置いたままです。どの章で定義したキーも本全体で有効なので、共有の項目が1つあれば足りたのですが、章が自己完結していれば、ほかの論考の一覧を壊さずに章を入れ替えたり並べ直したりできます。
#2 · 著者名は見出しの属性
// # The Compositor's Day {author="Margaret Lowe" short="The Compositor's Day"}
const byline = text('byline', '{attr.author}', { fontFamily: TEXT, italic: true,
fontSize: pt(12), color: col('ink'), align: 'left' }, below('title', 4));
const versoAuthor = head('verso-author', '{attr.author}', 'even',
at('page', 'top-left', MARGIN.outer + 8, 13)); // in the running head
const tocAuthor = { enabled: true, attr: 'author', fontFamily: TEXT, fontSize: pt(9.5),
color: col('muted') }; // a line under each title in the contents (italic by default)
各論考の題にはauthor="…"と、柱に使う短い題short="…"が付いています。章扉は題の下に著者名を印字し、偶数ページの柱はそのページが属する論考の著者を示し、目次は各項目の下に1行で著者名を印字します。本の前付けで寄稿者を二度並べるところはありません。
#3 · 章扉
// Nine lines of reserve and a line of margin under them (the level's marginBottom): ten
// lines, 48 mm, under a one-line title. A two-line title reaches past the reserve, and the
// margin then carries the text a line lower, clear of the rule.
const opener = { enabled: true, minHeight: pt(LEAD * 9), slot: { elements: [
text('kicker', t({ en: 'Chapter {number}', es: 'Capítulo {number}' }), { ...label,
fontSize: pt(8.5), letterSpacing: pt(1.7), color: col('accent') },
at('container', 'top-left', 0, 4)),
text('title', '{titleText}', { fontFamily: DISPLAY, fontSize: pt(28), lineHeight: 1.08,
color: col('ink'), align: 'left', overflow: 'wrap' }, below('kicker', 3, { width: 'fill' })),
byline,
{ kind: 'rule', id: 'rule', direction: 'horizontal', thickness: pt(1.2), color: col('accent'),
placement: { ...below('byline', 6), size: { width: mm(16) } } },
] } };
キッカー、題、著者名は版面の上から順に積み重なり、それぞれ1つ前の要素の下に固定されています。そのため第3章のような2行の題では、著者名と罫もいっしょに下がります。題が1行のとき、確保分によって本文は48mm、10行分下がります。2行の題ではもう1行多く取るので、罫が本文に触れることはなく、第3章の本文はほかの2章より1行下から始まります。
#4 · 著者が大勢いる本の柱
function head(id, content, parity, placement, look = {}) { // hoisted: the byline uses it
return { ...text(id, content, { ...label, fontWeight: 500, fontSize: pt(7.5),
letterSpacing: pt(1.1), color: col('muted'), ...look }, placement), parity, pages: 'body' };
}
const folio = { fontWeight: 600, color: col('ink') };
const header = { elements: [
head('verso-folio', '{pageNumber}', 'even', at('page', 'top-left', MARGIN.outer, 13), folio),
versoAuthor,
head('recto-title', '{attr.short}', 'odd', at('page', 'top-right', -(MARGIN.outer + 8), 13),
{ align: 'right' }),
head('recto-folio', '{pageNumber}', 'odd', at('page', 'top-right', -MARGIN.outer, 13),
{ ...folio, align: 'right' }),
] };
const footer = { elements: [{ ...head('drop-folio', '{pageNumber}', 'all',
at('container', 'top', 0, 9), { ...folio, align: 'center' }), pages: 'opener' }] };
編著では偶数ページに寄稿者、奇数ページに章を出します。単著なら書名と章を出すところです。柱はpages: 'body'で絞り込んでいるので、章扉には下がりノンブルだけが入ります。
#5 · 前付け
const bare = { numbered: false, toc: false, header: { elements: [] }, footer: { elements: [] } };
const cover = { enabled: true, slot: { elements: [
{ kind: 'box', id: 'field', style: { backgroundColor: col('accent') },
placement: { ...at('bleed', 'top-left'), size: { width: 'fill', height: mm(150) } } },
text('title', '{titleText}', { fontFamily: DISPLAY, fontSize: pt(58), lineHeight: 1,
color: col('paper'), align: 'left', overflow: 'wrap' },
{ ...at('page', 'top-left', MARGIN.inner, 64), size: { width: mm(118) } }),
text('subtitle', '{subtitle}', { fontFamily: TEXT, italic: true, fontSize: pt(15),
color: col('paper'), align: 'left' }, below('title', 5)),
text('editors', '{attr.editors}', { ...label, fontSize: pt(9), letterSpacing: pt(1.8),
color: col('accent') }, at('page', 'top-left', MARGIN.inner, 162)),
text('contributors', '{attr.contributors}', { fontFamily: TEXT, italic: true, fontSize: pt(12),
color: col('ink'), align: 'left' }, below('editors', 3)),
text('imprint', '{attr.imprint}', { ...label, fontWeight: 500, fontSize: pt(7.5),
letterSpacing: pt(1.5), color: col('muted') }, at('page', 'bottom-left', MARGIN.inner, -16)),
] } };
const contentsOpener = { enabled: true, minHeight: mm(40), slot: { elements: [
text('kicker', '{title}', { ...label, fontSize: pt(8.5), letterSpacing: pt(1.7),
color: col('accent') }, at('container', 'top-left', 0, 4)),
text('title', '{titleText}', { fontFamily: DISPLAY, fontSize: pt(28), color: col('ink'),
align: 'left' }, below('kicker', 3)),
] } };
const contents = {
levels: [{ level: 1, fontFamily: TEXT, fontSize: pt(12.5), lineHeight: pt(LEAD),
numberFontFamily: LABEL, numberFontSize: pt(10), numberFontWeight: 600,
numberColor: col('accent'), numberWidth: mm(6), numberGap: mm(3), marginBottom: pt(LEAD) }],
pageNumber: { fontFamily: LABEL, fontSize: pt(9), fontWeight: 600, color: col('ink'),
width: mm(7) },
leader: { char: '. ', gap: mm(2) },
subtitle: tocAuthor,
};
扉と目次は最初の文書にある番号なしの2つの見出しで、柱も目次の項目も持ちません。そのデザインは{title}と{subtitle}をフロントマターから、編者と寄稿者を見出し自身の属性から取ります。
レシピの全体
// ═══ Postext Cookbook · Nº 098 · An edited volume with a bibliography per chapter ═════
// https://postext.dev/en/cookbook/edited-volume-chapter-bibliographies
// Code: MIT · Text: original (CC BY 4.0) · Pictures: none
// Fonts: Libre Caslon Text & Display, IBM Plex Sans Condensed (OFL 1.1) · Needs postext ≥ 1.28.0
// Three essays by three contributors, each a Markdown document of its own with its own
// BibTeX block, laid out by buildBundle as one volume: every chapter closes on its own list.
import {
buildBundle, prepareFonts, withLoadedFonts, renderPageToCanvas, registerCitationEngine,
} 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 = 'edited-volume-chapter-bibliographies';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: printer's red on a warm paper, the rest in ink
const palette = {
ink: '#211c19', // text: a warm near-black
accent: '#8e2b1f', // printer's red: the cover field, kickers, the references heading
rule: '#cdbfb2', // hairlines
muted: '#6b5f57', // running heads, the contents' contributors, the colophon
paper: '#fcfaf6', // the page, and the type on the red field
};
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 = 'Libre Caslon Text', DISPLAY = 'Libre Caslon Display';
const LABEL = 'IBM Plex Sans Condensed';
const MARGIN = { top: 23, bottom: 22, inner: 20, outer: 18 }; // mm, mirrored
const LEAD = 13.8; // body leading in pt: the baseline grid
const label = { fontFamily: LABEL, fontWeight: 600, textTransform: 'uppercase', align: 'left' };
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });
const below = (id, y, size) => ({ ...at(`#${id}`, 'below', 0, y), ...(size && { size }) });
const text = (id, content, look, placement) => ({ kind: 'text', id, content, ...look, placement });
// #region answer: one list per chapter: scope 'chapter' over a book of separate documents
// Citations are [@key] in the text; each contributor's BibTeX goes in a :::references block
// in their own chapter. Register the engine once, before the first build.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
style: 'chicago-author-date', // the humanities' author-date: (Eisenstein 1979)
bibliography: {
// 'chapter': a :::bibliography lists the works its own document cites, so a work two
// contributors cite appears in both lists. 'book' (the default) would print one list,
// after the last chapter. The scope is per document, not per H1: each essay must be a
// document of its own in buildBundle (see the chapters region).
組み立てたscript.jsはそのまま動きます。任意のページのモジュールスクリプトに貼り付けるか、レシピをCodePenで開いてください。 GitHub上のレシピのフォルダー ↗ (新しいタブで開きます)
アレンジ
#全体で1つの一覧にする
すべての文献を巻末の1つの参考文献にまとめる出版社もあります。スコープを変え、3つの## References見出しを削除すると、一覧は最後の章のあとに続きます。
- scope: 'chapter',
- title: '', // no bold title paragraph: each chapter has its own ## References heading
+ scope: 'book',
+ title: 'Bibliography',#APAで引用する
社会科学の論文集なら、スタイルを変えるだけで、ほかは何も変えません。
- style: 'chicago-author-date', // the humanities' author-date: (Eisenstein 1979)
+ style: 'apa',よくあるつまずき
つまずき
2回定義したキーは、何の知らせもなく最初の項目が使われる
参考文献は本全体で数えられます。2つの章に書いたキーは最初の定義が使われ、2つ目は警告なしに無視されます。複数の著者による本では、寄稿者ごとにキーに接頭辞を付けてください。 参考文献から作る文献一覧 →
つまずき
属性値には{も}も書けない。"を含む値は一重引用符で囲む
属性値は閉じ波かっこで終わるため、{や}を含められません。二重引用符を含む値は一重引用符で囲みます。ドル記号は問題ありません。 見出しの属性 →
つまずき
見出しスタイルはその階層の改ページを受け継ぐ
headingStylesの項目は、指定しなかったフィールドをすべて見出しの階層から受け継ぎ、breakBeforeも例外ではありません。:::pagebreakのあとのH1に付けた目次や奥付のスタイルはparity 'odd'を受け継ぎ、白ページの後ろに置かれます。こうしたスタイルにはbreakBefore: { enabled: false }を指定してください。 見出しスタイル →
scope: 'chapter'が並べるのは、その文書が:::bibliographyより前で引用したものであって、そのH1の節が引用したものではありません。すべての論考を1つのMarkdownファイルに入れると、2つ目の一覧は1つ目の論考の文献を繰り返し、3つ目は両方を繰り返します。- 同じキーが複数あるときは、本全体で最初の定義が優先されます。2人の寄稿者が別々の文献に同じ
smith2001を使うと、あとの論考は何の知らせもなく先の寄稿者の本を引用します。寄稿者ごとにキーに接頭辞を付けるか、一覧を原稿と照合してください。 - 同じ著者・同じ年の区別は本全体で決まります。別々の章にある、Smithの2001年の異なる2つの著作は、ある章の一覧にそのうち1つしかなくても、2001a、2001bと印字されることがあります。
- ページの頭に来る小見出しは、既定では上のアキをすべて失い、グリッドにそろえるための1行未満のアキが見出しの下に入ります。10ページの頭のWhose lettersは、同じページの下にあるWhat the reader seesより本文から離れてしまいます。
headings.columnHeadSpace: 'remainder'を指定すると、その1行未満のアキが小見出しの上に残ります(見出し)。1段組みの本に向いています。小見出しが少し下から始まっても、隣に比べる段の頭がないからです。
クレジット
- 本文
- 書き下ろしの文章, CC BY 4.0
- フォント
- Libre Caslon Text (SIL OFL 1.1) · Libre Caslon Display (SIL OFL 1.1) · IBM Plex Sans Condensed (SIL OFL 1.1)


