> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/ja/to-2/07-creating-multiple-bibliographies-in-the-same-document.md).

# 同じ文書で複数の参考文献リストを作成する

## はじめに

この記事では、適切なパッケージを使って同じ LaTeX 文書内に複数の参考文献一覧を作成する方法を説明します。既定では、各 LaTeX 文書には参考文献一覧は 1 つだけ含められ、次のいずれかの形式になります。 `\begin{thebibliography}\bibitem...\end{thebibliography}` リストの形式、または `\bibligraphystyle{...}\bibliography{...}`、または `\printbibliography`。しかし、必要に応じて *複数の参考文献一覧*を作成したい場合があります。文書全体ではなく、章ごとに別々の参考文献一覧を持たせたいこともあるでしょうし、異なるカテゴリやテーマごとに別々の参考文献一覧を持たせたいこともあるでしょう。

これらのシナリオに対応しようとして複数の `\bibliography`  を文書内の異なる場所で呼び出しても、それらはすべて同じ項目のリストを含み、文書全体の *すべての* 引用を網羅してしまうことがわかるでしょう。代わりに、適切な LaTeX パッケージを使って、別々の参考文献一覧を正しく生成する必要があります。

まず、 [BibTeX](/latex/ja/to-1/01-bibliography-management-with-bibtex.md) または [biblatex](/latex/ja/to-1/03-bibliography-management-with-biblatex.md)を使っているかどうかを確認する必要があります。これらは混在できない異なるパッケージを必要とします。出版社や大学から提供されたテンプレートを使っている場合は、サンプルテンプレート `.tex` ファイルに `\printbibliography` または `\addbibresource` が含まれているか確認してください。含まれていれば、 `biblatex`の節へ進んでください。 [こちらで](#with-biblatex)それ以外では、おそらく BibTeX を使っているので、以下を読み進めてください。 [こちらで](#packages-for-bibtex).

## BibTeX 用のパッケージ

### chapterbib パッケージ

本や論文の各章の末尾に参考文献一覧を置くだけでよいなら、 `chapterbib` パッケージだけで足りるかもしれません。

1. *各章はそれぞれ `.tex` 独立したファイルにする必要があります。* 次を記述します

   ```latex
   \bibliographystyle{...}
   \bibliography{...}
   ```

   各章の末尾で、各 `.tex` ファイル内に。異なる `.bib` ファイルを各章ごとに指定できます。 `\bibliography`.
2. 「メイン文書」で `.tex` ファイルでは、 `chapterbib` パッケージを読み込みます。 `sectionbib` オプションは、各章の参考文献一覧を、実際の章の後に番号なし章としてではなく番号なし節として表示したい場合に便利です。

   ```latex
   \usepackage[sectionbib]{chapterbib}
   ```
3. 使う `\include` メイン文書ファイルの中で各章の `.tex` ファイルをどう準備するかを簡単に見てきました。 *`\input` を **含まれていません** と組み合わせて `chapterbib` 章ごとの参考文献一覧を生成できます。*
4. ローカルマシンでコンパイルする場合: メイン文書をコンパイルすると `.tex` 個の `.aux` ファイルが生成され、章ごとに 1 つずつ `.tex` ファイルを含めていたことになります。今度は `bibtex` これらすべての `.aux` ファイルに対して `.tex` メイン文書ファイルをもう一度コンパイルする前に。 [Overleaf のビルドツール、 `latexmk`,](/latex/ja/narejjibsu/064-how-does-overleaf-compile-my-project.md) がこれらの処理手順をすべて自動で行ってくれるので、あとは **「再コンパイル」** ボタンを 1 回クリックするだけです。

なお、 *してはいけません* 、 `\bibliobraphy{...}` をメイン文書 `.tex` ファイルに書くことは `chapterbib`を使う場合は。さもないと、 *"Illegal; another \bibdata command"*&#x306B;関する BibTeX のエラーメッセージが大量に出ることがあります。文書全体のすべての引用を集める「グローバル」参考文献一覧も必要な場合は、 `bibunits` パッケージのほうがよい選択かもしれません。

[Overleafで例を開く](https://www.overleaf.com/project/new/template/5694?id=8827885\&mainFile=main.tex\&templateName=Per-chapter+bibliographies+with+chapterbib)

### bibunits パッケージ

この `bibunits` パッケージでも章ごとの参考文献一覧を作成でき、章を別々のファイルにする必要はありません。 `.tex` ファイルをどう準備するかを簡単に見てきました。

1. まず次を書きます: `\usepackage[sectionbib]{bibunits}` をメイン文書 `.tex`のプリアンブルに。
2. 同じ `.bib` ファイルと参考文献スタイルを文書内のすべての引用に使うには、 `\defaultbibliographystyle{...}` や `\defaultbibliography{...}`  コマンドを、 `bibunits`たとえば:

   ```latex
   \defaultbibliographystyle{unsrt}
   \defaultbibliography{references} % 拡張子を除いた .bib ファイル名
   ```
3. 追加します。 `\bibliographyunit[\chapter]` の後に `\begin{document}`.
4. 各章の末尾に、 `\putbib` を追加します。これにより、最後の `\cite` \chapter `以降に現れた`のすべてのインスタンスに対する参考文献一覧が出力されます。 `\bibliographyunit`  を文書の後のほうで引数なしで書けば、自動的な `bibunit`化をオフにできます。
5. ローカルマシンでコンパイルする場合: メイン文書をコンパイルすると `.tex` 個の `.aux` ファイルが生成され、章ごとに 1 つずつ `.tex` ファイルを含めていたことになります。今度は `bibtex` これらすべての `.aux` ファイルに対して `.tex` メイン文書ファイルをもう一度コンパイルする前に。 [Overleaf のビルドツール、 `latexmk`,](/latex/ja/narejjibsu/064-how-does-overleaf-compile-my-project.md) がこれらの処理手順をすべて自動で行ってくれるので、あとは **「再コンパイル」** ボタンを 1 回クリックするだけです。

[Overleafで例を開く](https://www.overleaf.com/project/new/template/5695?id=8828133\&mainFile=main.tex\&templateName=Per-chapter+bibliographies+with+bibunits)

いくつか追加のヒント:

* 別の `.bib` ファイルを章ごと/単位ごとに使う場合は、 `\putbib`を使うことを推奨します。たとえば `\putbib[chap1refs]`—注意、 `.bib` 拡張子があります。
* 文書を任意の「参考文献単位」に分割する必要がある場合（つまり、 `以降に現れた` や他の節見出しコマンドに限定されない場合）で、自己完結した引用と参考文献一覧を持たせたいなら、 `bibunit` 環境を、 `\putbib` とともに使うことができます。

  ```latex
  \begin{bibunit}
  ...\cite{smith2012} and \cite{wilkins2008}...
  \putbib
  \end{bibunit}
  ```

  特定の `bibunit` に対して別のスタイルが必要な場合、つまり `\defaultbibliographystyle{...}` とは異なる場合は、 `bibunit`: `\begin{bibunit}**[plain]**`
* さらに、すべての章または bibunit からのすべての引用を含む「グローバル」参考文献一覧も必要な場合は、 `globalcitecopy`  オプションを、 `bibunits` パッケージを使っています： `\usepackage[sectionbib,**globalcitecopy**]{bibunits}`

### multibib パッケージ

カテゴリごとに別々の参考文献一覧を持たせたいことがあります。これを実現する一つの方法は、 `multibib`  パッケージを使うことです。たとえば、化学関連の参考文献一覧と物理関連の参考文献一覧を作る手順は次のとおりです。

1. パッケージを読み込み、 `multibib`  コマンドを使って `\newcites` 「`Math`」および「`Phys`」の参考文献タイプを作成します。参考文献の見出しは「Math Readings」と「Physics Readings」になります。

   ```latex
   \usepackage[resetlabels,labeled]{multibib}

   \newcites{Math}{Math Readings}
   \newcites{Phys}{Physics Readings}
   ```

   同じ `\newcites{}`  コマンドで、カンマ区切りの値を使って複数の参考文献タイプを作成できます。ただし、参考文献タイトルの数も正しく指定していることを確認してください。

   ```latex
   \newcites{Math,Phys}{Math Readings,Physics Readings}
   ```
2. 各新しい参考文献 `X`について、次の新しいコマンド `\citeX`, `\bibliographystyleX`, `\bibliographyX` が使えるようになります。したがって、これに加えて既定の

   * `\citeMath`, `\bibliographystyleMath`, `\bibliographyMath`
   * `\citePhys`, `\bibliographystylePhys`, `\bibliographyPhys`

   &#x20;が利用できます。 `\cite`, `\bibliographystyle`, `\bibliography`

   ここで `\bibliographystyle`, `\bibliographystyleMath`, `\bibliographystylePhys`  を使って各参考文献一覧のスタイルを指定し、 `.bib` それぞれの `\bibliography`, `\bibliographyMath`, `\bibliographyPhys`ファイルを指定できます。 `.bib` （参考文献スタイルは通常、すべての参考文献一覧で統一されていますが、異なる

   ```latex
   \cite{paper1} と \cite{paper2} は \citeMath{paper3} より後に出版されました。\citePhys{paper4} も参照してください。
   \citeMath{paper3}。\citePhys{paper4} も参照してください。

   \bibliographystyle{unsrt}
   \bibliography{references}

   \bibliographystyleMath{unsrt}
   \bibliographyMath{refs-etc}

   \bibliographystylePhys{unsrt}
   \bibliographyPhys{refs-etc}
   ```

   この例では、 `paper1` や `paper2`  は `references.bib` で定義されており、既定の参考文献一覧に掲載されます。 `paper3`  は「Math Readings」参考文献一覧に掲載されます。 `paper4`  は「Physics Readings」参考文献一覧に掲載されます。どちらも `paper3` や `paper4`  は `refs-etc.bib` ファイルとまったく同じ綴り・大文字小文字を使ってください。
3. ローカルマシンでコンパイルする場合: メイン文書をコンパイルすると `.tex` 個の `.aux` ファイルです。今度は `bibtex` これらすべての `.aux` ファイルに対して `.tex` これらすべてのファイルに対して実行する必要があります。メイン文書ファイルをもう一度コンパイルする前に、Overleaf では **再コンパイル** ボタンをクリックするだけで、これらの手順をすべて自動で処理してくれます。

[Overleafで例を開く](https://www.overleaf.com/project/new/template/18645?id=3104751\&latexEngine=pdflatex\&mainFile=main.tex\&templateName=Multiple+Bibliographies+with+multibib)

## biblatex を使う場合

biblatex パッケージを使っているなら、前の節で挙げたパッケージを **読み込んではいけません。これには** が含まれます。 `natbib`, `chapterbib`, `bibunits`, `multibib`.

### 章ごとの参考文献一覧

この `biblatex` パッケージには `refsection` 機構があり、「`bibunit`".

1. biblatex に `biblatex` 自動的に新しい `refsection` refsection を開始させることができます `以降に現れた`章に出会ったときに **`refsection=chapter`**  オプションを読み込むときに指定することで `biblatex`:

   ```latex
   \usepackage[natbib,style=authoryear,refsection=chapter]{biblatex}
   \addbibresource{refs.bib}
   ```
2. その後、 `\printbibliography` 各章の末尾に `以降に現れた`、最後の `以降に現れた`refsection 以降に現れた引用だけを一覧表示することができます。以下のコード例では、 `heading=subbibintoc`  オプションを `\printbibliography` に対して使っているので、参考文献一覧は章の末尾に番号なし節（`subbib`）として出力され、番号なし章にはなりません。さらに、目次（`intoc`).

   ```latex
   \chapter{First Chapter}

   \section{Section Heading}
   こちらに引用があります！ \citep{latex:companion}
   \printbibliography[heading=subbibintoc]


   \chapter{Second Chapter}

   \section{Section Heading}
   さらに別の引用です！ \citep{lshort}
   \printbibliography[heading=subbibintoc]
   ```
3. あるいは、 `\begin{refsection}...\end{refsection}`  を各章の周り、または任意のテキストブロックの周りに置くこともできます。この場合、 `refsection=chapter` オプションは使わないでください:

   ```latex
   \usepackage[natbib,style=authoryear]{biblatex}
   \addbibresource{refs.bib}
   ...
   \begin{refsection}
   \chapter{First Chapter}
   \section{Section Heading}
   こちらに引用があります！ \citep{latex:companion}
   \printbibliography[heading=subbibintoc]
   \end{refsection}

   \begin{refsection}
   \chapter{Second Chapter}
   \section{Section Heading}
   さらに別の引用です！ \citep{lshort}
   \printbibliography[heading=subbibintoc]
   \end{refsection}

   %% この方法で出版物一覧を作成できます
   \begin{refsection}
   \nocite{paper1,paper2}
   %% ここでは番号なし章が欲しいですが、別のタイトルにします
   \printbibliography[title={List of Publications}]
   \end{refsection}
   ```

[Overleaf で例を開く。](https://www.overleaf.com/docs?snip_uri=https://assets.ctfassets.net/nrgyaltdicpt/3mfINcJWZRlegHyXND3SEQ/7843cab4a5d022161a43bea6662bc00b/biblatex-perchapter.zip) この例では、 `main.tex` は `[refsection=chapter]` パッケージオプションを使う一方で、 `alt.tex` では手動で挿入された `refsection` 環境を閉じます。

### 異なるカテゴリの参考文献一覧

キーワードやカテゴリを使って、異なるトピックに基づく別々の参考文献一覧を作成できます。

#### キーワードを使う

1. この方法では、 **`keywords`** フィールドを `.bib` の文献エントリに追加する必要があります。たとえば、

   ```bibtex
   @article{paper4,
     title={High energy colliders as black hole factories...},
     ...
     keywords={phys}
   }
   ```
2. 参考文献は通常どおり引用します。
3. その後、いくつかの `\printbibliography` コマンドを発行し、どの `キーワード` を含めるかを指定します。各 `タイトル`スタイルを異なるものに設定できます。 `\printbibliography` コマンドで指定します：

   ```latex
   % 既定の「メイン」参考文献一覧
   \printbibliography[notkeyword={math},notkeyword={phys}]

   % Math の参考文献一覧
   \printbibliography[keyword={math},title={Math Readings}]

   % Physics の参考文献一覧
   \printbibliography[keyword={phys},title={Physics Readings}]
   ```

[Overleafで例を開く](https://www.overleaf.com/docs?snip_uri=https://assets.ctfassets.net/nrgyaltdicpt/3Bt5Tf9eSCtcXQrGshjQJT/7c64c3820a4adc4e20468aee752dc1e9/biblatex-keywords.zip)

#### カテゴリを使う

1. この方法では、 `.bib` ファイルに追加のフィールドを入れる必要はありません。代わりに、カテゴリの種類を宣言し、文献を各カテゴリに追加します。 `.tex` ファイルのプリアンブルで次のようにします:

   ```latex
   \addbibresource{refs-nokeywords.bib}
   \DeclareBibliographyCategory{math}
   \DeclareBibliographyCategory{phys}
   \addtocategory{math}{paper3}
   \addtocategory{phys}{paper4}
   ```
2. 参考文献は通常どおり引用します。
3. その後、いくつかの `\printbibliography` コマンドを使って、どの `カテゴリ` を出力するかをそれぞれ指定します。

   ```latex
   % 既定の「メイン」参考文献一覧
   \printbibliography[notcategory={math},notcategory={phys}]

   % Math の参考文献一覧
   \printbibliography[category={math},title={Math Readings}]

   % Physics の参考文献一覧
   \printbibliography[category={phys},title={Physics Readings}]
   ```

[Overleafで例を開く](https://www.overleaf.com/docs?snip_uri=https://assets.ctfassets.net/nrgyaltdicpt/6l5HYYfby0AscSXwLsWKPM/71b6fb3e848f473fc9d2735847af7ec1/biblatex-categories.zip)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/ja/to-2/07-creating-multiple-bibliographies-in-the-same-document.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
