本文へスキップ
レシピ番号97

レシピ集 · 第5章 · 本の構成

ZoteroのBibTeX書き出しから作る文献リスト

ゼミの文献リストです。文献はZoteroのBibTeX書き出しをそのまま貼り付け、シカゴ方式の著者年形式で引用し、本文で引かない文献はnociteで加えます。

このページの内容
ジャンル
教科書 · 報告書
出力
Canvas
レベル
中級
Postext
Postext 1.65.0で検証済み
1.65.0以上が必要
ライセンス
2026年10月31日更新
コードMIT · 本文CC BY 4.0

1ページ(全2ページ)

  • 英語の見本:日本語版はまだありません
  • 仕上がり210 × 280 mm
  • 2段, 段間7 mm
  • Spectral 9.6/13.4
  • IBM Plex Sans Condensed
  • 2ページ
  • レベル
  • Postext 1.65.0
  • 組版時間547 ms
  • コード121行

かんたんな説明

大学のゼミの文献リストです。教員はZoteroが書き出したファイルをそのまま貼り付け、Postextが引用と、本文で触れない本も含めた一覧を刷ります。

できあがり

科学史・科学社会学を扱う6週のゼミの文献リストを、210×280mmのページに2段組みで組みます。1ページの上半分を深緑の面が占め、50ptのSpectral Lightで授業の題を置きます。その下の本文は、担当教員による各週の手引きです。文献はゼミのZoteroコレクションで、BibTeXとして書き出し、1行も手を加えずに文書に貼り付けています。Zoteroの引用キー、大文字を守る波括弧、{\"o}のアクセント、month = dec、file、keywords、urldateのフィールドもそのままです。本文はそのうち8つの文献を引用します。残りの5つは、ゼミでは扱わない参考書で、nociteを通じて一覧に入ります。

このレシピが答える質問

  • ZoteroからBibTeXで書き出した文献を使い、本文で引用しない文献も一覧に載せるには?
  • APA、IEEEなどの引用スタイルで、文献を引用し参考文献を作るには?

手短な答え

script.js · 28〜40行コード全体で見る
// The works come from a :::references{format=bibtex} block: the Zotero export pasted as it
// is. The text cites some of them; `nocite` in the front matter adds the rest by key, and
// `nocite: "@*"` would add the whole export. citeproc-js writes both in the style named.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
  style: 'chicago-author-date', // '(Gieryn 1983)', 'Shapin and Schaffer (1985)'
  link: true, // a citation jumps to its entry
  bibliography: {
    // includeUncited: true is the same as nocite: "@*", set from the design side.
    fontSize: em(0.94), lineHeight: pt(12.4), hangingIndent: mm(5), entrySpacing: pt(3.5),
    doi: 'link', // Zotero's doi field prints as https://doi.org/…; its url field is dropped
  },
};

材料

種類
Spectral, IBM Plex Sans Condensed (SIL OFL 1.1)
素材
なし:画像はすべてコードで描画

作り方

#1 · スタイルは一度だけ指定する

コードは上の手短な答えにあります。引用エンジンは最初のビルドの前に登録し、スタイルは1つの設定で決まります。シカゴ方式の著者年形式は、[@shapin_pump_1984]を「(Shapin 1984)」と、文中の@shapin_leviathan_1985を「Shapin and Schaffer (1985)」と書きます。キーはZoteroが第1著者、題の最初の主要な語、年から作ったものなので、gieryn_boundary-work_1983はハイフンを含んだままです。Postextはキーの中のハイフンやアンダースコアをキーの一部として読みます。

#2 · 書き出しをZoteroが書いたまま貼る

文書の最後のブロックが書き出しで、文献1つにつき1項目、Zoteroが書くとおりタブで字下げされています。

@article{gieryn_boundary-work_1983,
	title = {Boundary-{Work} and the {Demarcation} of {Science} from {Non}-{Science}: …},
	url = {https://www.jstor.org/stable/2095325},
	doi = {10.2307/2095325},
	urldate = {2026-08-21},
	journal = {American Sociological Review},
	author = {Gieryn, Thomas F.},
	month = dec,
	year = {1983},
	keywords = {demarcation, week 4},
	pages = {781--795},
	file = {JSTOR Full Text PDF:/Users/hps214/Zotero/storage/2HJ8M6PA/Gieryn - 1983 - ….pdf:application/pdf},
}

読み込み処理は、大文字を守る波括弧を外し、{\"o}と{\'e}をöとéに合成し、--をenダッシュに変え、month = decを素の月名として読みます。urldateは閲覧日に、languageはその項目の言語になります。file、keywords、abstract、shorttitleは読み飛ばすので、ハードディスク上の情報がページに出ることはありません。

#3 · 本文で引かない文献を加える

フロントマターにキーで列挙します。

---
title: "Science as a Social Practice"
nocite: "@fleck_genesis_1979, @merton_sociology_1973, @latour_science_1987, @rheinberger_toward_1997, @lopez_pinero_ciencia_1979"
---

一覧には、引用したすべての文献にこの5つを加え、シカゴ方式の求めるとおり著者順にまとめて並べます。引用していない項目に印は付きません。nocite: "@*"は書き出し全体を並べます。bibliography.includeUncited: trueは同じことを設定の側から行うので、常にライブラリー全体を刷るデザインに向きます。

#4 · 案内カードの緑の面

script.js · 44〜68行コード全体で見る
const BAND = 132; // mm from the trim's top to the band's foot
const onBand = { color: col('paper'), align: 'left', overflow: 'wrap' };
const opener = {
  enabled: true,
  minHeight: mm(BAND - TOP + 9), // the columns start 9 mm under the band
  slot: { elements: [
    { kind: 'box', id: 'band', style: { backgroundColor: col('accent') },
      placement: { anchor: { to: 'page', edge: 'top-left' },
        size: { width: 'fill', height: mm(BAND) } } },
    { kind: 'text', id: 'kicker', content: '{attr.kicker}', ...onBand, fontFamily: LABEL,
      fontSize: pt(8.5), fontWeight: 600, letterSpacing: pt(1.7), textTransform: 'uppercase',
      placement: { anchor: { to: 'container', edge: 'top-left' }, offset: { y: mm(14) } } },
    { kind: 'text', id: 'title', content: '{titleText}', ...onBand, fontFamily: TEXT,
      fontSize: pt(50), fontWeight: 300, lineHeight: 1.02,
      placement: { anchor: { to: '#kicker', edge: 'below' }, offset: { y: mm(7) },
        size: { width: mm(150), height: 'auto' } } },
    { kind: 'rule', id: 'rule', direction: 'horizontal', thickness: pt(1), color: col('tint'),
      placement: { anchor: { to: '#title', edge: 'below' }, offset: { y: mm(7) },
        size: { width: mm(18) } } },
    { kind: 'text', id: 'lead', content: '{attr.lead}', ...onBand, fontFamily: TEXT,
      italic: true, fontSize: pt(13), lineHeight: 1.3, color: col('tint'),
      placement: { anchor: { to: '#rule', edge: 'below' }, offset: { y: mm(6) },
        size: { width: mm(128), height: 'auto' } } },
  ] },
};

帯は仕上がりに固定した深さ132mmの箱で、2つの段はその9mm下から始まります。題、罫、リードはbelowのアンカーでつないであるので、授業の題が長くなるとリードは重ならずに下へ押し下げられます。

script.js · 15〜21行コード全体で見る
const palette = {
  ink: '#1c211f', accent: '#2d5b48', tint: '#dfe9e2', rule: '#c3cdc6', muted: '#5c6862',
  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' } }));

レシピの全体

Sandbox
// ═══ Postext Cookbook · Nº 097 · A reading list from a Zotero BibTeX export ═══════
// https://postext.dev/en/cookbook/zotero-bibtex-nocite
// Code: MIT · Text: original (CC BY 4.0) · Pictures: none
// Fonts: Spectral, IBM Plex Sans Condensed (SIL OFL 1.1) · Needs postext ≥ 1.65.0
import {
  buildDocumentWithFonts, renderPageToCanvas, registerCitationEngine,
} from 'https://esm.sh/postext';
import { createCiteprocEngine, STYLES, LOCALES } from 'https://esm.sh/postext-citeproc';

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

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: a department green, one tint, everything else in ink
const palette = {
  ink: '#1c211f', accent: '#2d5b48', tint: '#dfe9e2', rule: '#c3cdc6', muted: '#5c6862',
  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, LABEL] = ['Spectral', 'IBM Plex Sans Condensed'];
const LEAD = 13.4; // pt
const [TOP, OUTER] = [24, 18]; // mm

// #region answer: Chicago author-date, and a list that holds more than the text cites
// The works come from a :::references{format=bibtex} block: the Zotero export pasted as it
// is. The text cites some of them; `nocite` in the front matter adds the rest by key, and
// `nocite: "@*"` would add the whole export. citeproc-js writes both in the style named.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
  style: 'chicago-author-date', // '(Gieryn 1983)', 'Shapin and Schaffer (1985)'
  link: true, // a citation jumps to its entry
  bibliography: {
    // includeUncited: true is the same as nocite: "@*", set from the design side.
    fontSize: em(0.94), lineHeight: pt(12.4), hangingIndent: mm(5), entrySpacing: pt(3.5),
    doi: 'link', // Zotero's doi field prints as https://doi.org/…; its url field is dropped
  },
};
// #endregion

// #region opener: a green field over the top half, the course in white on it
const BAND = 132; // mm from the trim's top to the band's foot
const onBand = { color: col('paper'), align: 'left', overflow: 'wrap' };
const opener = {
  enabled: true,
  minHeight: mm(BAND - TOP + 9), // the columns start 9 mm under the band

組み立てたscript.jsはそのまま動きます。任意のページのモジュールスクリプトに貼り付けるか、レシピをCodePenで開いてください。 GitHub上のレシピのフォルダー ↗ (新しいタブで開きます)

アレンジ

#Zoteroのコレクション全体を並べる

書き出しそのものが一覧になる場合は、キーを省きます。ブロックの項目は、引用の有無にかかわらずすべて刷られます。

-nocite: "@fleck_genesis_1979, @merton_sociology_1973, @latour_science_1987, …"
+nocite: "@*"

#スタイルを変える

同じキーのまま、ほかに何も変えずにハーバード方式(Cite Them Right)の一覧になります。

-  style: 'chicago-author-date', // '(Gieryn 1983)', 'Shapin and Schaffer (1985)'
+  style: 'harvard-cite-them-right',

よくあるつまずき

つまずき

何にも一致しないnociteのキーは何の知らせもなく捨てられる

文献のない引用キーはunknownCitationKeyを出しますが、どの項目にも一致しないnociteのキーは警告なしに飛ばされます。キーは書き出したデータからコピーし、文献一覧の項目数を数えてください。 参考文献から作る文献一覧 →

  • nociteのキーがどの項目にも一致しないと、警告なしに捨てられます。キーは手で入力せず書き出しからコピーし、ページ上の項目数を数えて確かめます。
  • Zoteroはデータからキーを作ります。Zoteroで著者名や題を直すと、次の書き出しでキーが変わることがあり、そのキーの引用がすべて壊れます。本文を書く前にキーを固定しておきます。Zoteroは項目の「その他」(Extra)フィールドのCitation Key: …という行を読みます。
  • Zoteroは既定ではUTF-8で書き出し、アクセントはそのままの文字になります。ここのブロックは西欧のエンコーディングのオプションで書き出したので{\"o}の形になっています。Postextはどちらも読めます。
  • シカゴ方式の第18版は出版地を省くので、addressフィールドは刷られません。DOIのある論文はDOIを刷り、JSTORのurlは刷りません。

クレジット

レシピ
Ignacio Ferro
本文
書き下ろしの文章, CC BY 4.0
フォント
Spectral (SIL OFL 1.1) · IBM Plex Sans Condensed (SIL OFL 1.1)
Sandbox