> 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/zh-tw/geng-duo-zhu-ti/05-bibliography-management-in-latex.md).

# LaTeX 中的參考文獻管理

## 簡介

關於參考文獻管理套件，LaTeX 中有三個主要選項： `bibtex`, `natbib` 和 `biblatex`.

本文說明如何使用 `biblatex` 套件來管理並格式化 LaTeX 文件中的參考文獻。 `biblatex` 是一個處理參考文獻資訊的現代選項，提供比另外兩個選項更簡單、更彈性的介面，以及更好的語言本地化支援。

以下是一個 `biblatex` 套件的最小可執行範例：

```latex
\documentclass[letterpaper,10pt]{article}
\usepackage{biblatex} %匯入 biblatex 套件
\addbibresource{sample.bib} %匯入參考文獻檔案

\begin{document}
來引用看看！愛因斯坦的期刊論文 \cite{einstein} 和狄拉克的
書籍 \cite{dirac} 都是與物理相關的項目。

\printbibliography %列印參考文獻

\end{document}
```

![BiblatexEx1OLV2.png](/files/4ddf5b90fae979828ef8e3dfdd5c33f29bd3f443)

此範例中有四個與參考文獻相關的指令：

**\usepackage{biblatex}**

匯入 biblatex 套件。

**\addbibresource{sample.bib}**

匯入參考文獻資料檔 sample.bib：此檔案包含每本被引用的書籍、文章等資訊。更多資訊請見參考文獻檔案章節。

**\cite{einstein}**

此指令會在文件中插入一個參考文獻，在此情況下為 \[1]，其對應於參考文獻中的一個條目；einstein 是 sample.bib 中某個條目的關鍵字。

**\printbibliography**

列出被引用的參考文獻，預設標題在 article 文件類別中為「References」，在書籍與報告中為「Bibliography」。

Overleaf 提供多個具有預先定義樣式的範本來管理參考文獻。請參見 [此連結](https://www.overleaf.com/gallery/tagged/bibliography). [在 Overleaf 中開啟 biblatex 套件範例](https://www.overleaf.com/project/new/template/19714?id=66708264\&templateName=Biber+bibliography+example\&latexEngine=\&texImage=texlive-full%3A2020.1\&mainFile=)

## 基本用法

套件匯入指令可傳入多個參數，如下例所示：

```latex
\documentclass{article}

\usepackage[
backend=biber,
style=alphabetic,
sorting=ynt
]{biblatex}
\addbibresource{sample.bib}

\title{參考文獻管理：\texttt{biblatex} 套件}
\author{Overleaf}
\date{ }

\begin{document}

\maketitle

使用 \texttt{biblatex}，您可以顯示分成
多個區段的參考文獻，依引用類型而定。來引用看看！愛因斯坦的
期刊論文 \cite{einstein} 與狄拉克的書籍 \cite{dirac} 都是
與物理相關的項目。接著，\textit{The \LaTeX\ Companion} 書籍
 \cite{latexcompanion}、Donald Knuth 的網站 \cite{knuthwebsite}、
\textit{The Comprehensive Tex Archive Network}（CTAN）
\cite{ctan} 都是與 \LaTeX 相關的項目；但其他的，Donald Knuth 的項目，
\cite{knuth-fa,knuth-acp} 則是與程式設計相關。

\medskip

\printbibliography

\end{document}
```

![BiblatexExample2OLV2.png](/files/bbccc03983a565e6b6df05312cbc6112814b864e)

匯入時可加入一些額外選項，這些選項寫在中括號內並以逗號分隔， `biblatex`:

**backend=biber**

將後端設定為用來排序參考文獻；biber 是預設且建議使用的後端，因為它為多個指令提供完整的本地化支援，而且 biber 的樣式更容易修改，因為它們使用標準的 LaTeX 巨集。另一個支援的後端是 bibtex，這是一個較傳統的程式；若將其設為後端，bibtex 只會用來排序參考文獻，因此此處無法使用 bibtex 樣式。

**style=alphabetic**

定義參考文獻樣式與引用樣式，此處為 alphabetic。視樣式而定，可能會有更多引用指令可用。更多資訊請見 biblatex 參考文獻樣式與引用樣式。

**sorting=ynt**

決定參考來源的排序準則。在此情況下，它們會依年份、名稱與標題排序。排序選項清單請見參考指南。

其餘指令已在 [引言](#introduction).

[開啟一個更完整的 `biblatex` 範例](https://www.overleaf.com/project/new/template/19715?id=66713383\&templateName=A+biblatex+example\&latexEngine=\&texImage=texlive-full%3A2020.1\&mainFile=)

## 參考文獻檔案

參考文獻檔案必須使用標準的 bibtex 語法

```latex
@article{einstein,
    author = "Albert Einstein",
    title = "{Zur Elektrodynamik bewegter K{\"o}rper}. (德文)
    [{關於}運動物體的電動力學]",
    journal = "Annalen der Physik",
    volume = "322",
    number = "10",
    pages = "891--921",
    year = "1905",
    DOI = "http://dx.doi.org/10.1002/andp.19053221004",
    keywords = "physics"
}

@book{dirac,
    title = {量子力學原理},
    author = {Paul Adrien Maurice Dirac},
    isbn = {9780198520115},
    series = {物理學國際專著叢書},
    year = {1981},
    publisher = {Clarendon Press},
    keywords = {physics}
}

@online{knuthwebsite,
    author = "Donald Knuth",
    title = "Knuth：電腦與排版",
    url  = "http://www-cs-faculty.stanford.edu/~uno/abcde.html",
    addendum = "（存取日期：01.09.2016）",
    keywords = "latex,knuth"
}

@inbook{knuth-fa,
    author = "Donald E. Knuth",
    title = "基礎演算法",
    publisher = "Addison-Wesley",
    year = "1973",
    chapter = "1.2",
    keywords  = "knuth,programming"
}
...
```

此檔案包含特殊格式的記錄；例如，第一筆參考文獻是定義如下：

**@article{...}**

這是記錄項目的第一行，@article 告訴 BibTeX 這裡儲存的資訊是關於一篇文章。這筆條目的資訊被包在大括號中。除了範例中顯示的條目類型（article、book、online 和 inbook）之外，還有更多類型，請參見參考指南。

**einstein**

標籤 einstein 指派給這筆條目，它是一個可用來在文件中指代此文章的唯一識別碼。

**author = "Albert Einstein",**

這是參考文獻條目的第一個欄位，表示這篇文章的作者是 Albert Einstein。可以使用相同的 \`key = value\` 語法新增多個以逗號分隔的欄位，例如：title、pages、year、URL 等。可能的欄位清單請參見參考指南。

此檔案中的資訊之後可以在 LaTeX 文件中列印並引用，如前幾節所示，使用指令 `\addbibresource{sample.bib}`。.bib 檔案中的資訊不一定都會顯示，這取決於文件中設定的參考文獻樣式。

[開啟一個更完整的 `biblatex` 範例](https://www.overleaf.com/project/new/template/19715?id=66713383\&templateName=A+biblatex+example\&latexEngine=\&texImage=texlive-full%3A2020.1\&mainFile=)

## 自訂參考文獻

Biblatex 可讓您以極少的工夫高度自訂參考文獻區段。前面提到有多種 [引用樣式](/latex/zh-tw/can-kao-wen-xian-yu-yin-wen/08-biblatex-citation-styles.md) 和 [參考文獻樣式](/latex/zh-tw/can-kao-wen-xian-yu-yin-wen/07-biblatex-bibliography-styles.md) 可供使用，您也可以建立新的樣式。另一個自訂選項是變更參考文獻區段的預設標題。

```latex
\documentclass{article}

\usepackage[
backend=biber,
style=alphabetic,
sorting=ynt
]{biblatex}
\addbibresource{sample.bib}

\title{參考文獻管理：\texttt{biblatex} 套件}
\author{Overleaf}
\date{2021年5月}

\begin{document}

\maketitle

使用 \texttt{biblatex}，您可以顯示分成區段的參考文獻，
依引用類型而定。來引用看看！愛因斯坦的期刊論文 \cite{einstein}
與狄拉克的書籍 \cite{dirac} 都是與物理相關的項目。接著，\textit{The \LaTeX\ Companion}
書籍 \cite{latexcompanion}、Donald Knuth 的網站 \cite{knuthwebsite}、
\textit{The Comprehensive Tex Archive Network}（CTAN） \cite{ctan} 是
\LaTeX 相關的項目；但其他的，Donald Knuth 的項目，
\cite{knuth-fa,knuth-acp} 則是與程式設計相關。

\medskip

\printbibliography[title={完整參考文獻}]
```

![BiblatexEx3OLV2.png](/files/1dc7cfa7aac6217148770c78224b3bdbac32af75)

額外的參數 `title={完整參考文獻}` 透過中括號傳入指令 `\printbibliography` 的就是會變更標題的那一個。

參考文獻也可以根據不同的篩選條件再細分成多個區段，例如：只列印相同作者、相同期刊或相似標題的參考文獻。以下為範例。

```latex
\printbibliography[type=article,title={僅文章}]
\printbibliography[type=book,title={僅書籍}]

\printbibliography[keyword={physics},title={僅與物理相關}]
\printbibliography[keyword={latex},title={僅與 \LaTeX 相關}]
```

![BiblatexEx4OLV2.png](/files/0fe327f8894f67ce46992cd7d32816cf7bc3973b)

這裡，參考文獻被分成 4 個區段。此處使用的指令語法如下所示：

**\printbibliography\[type=article,title={僅文章}]**

只列印類型為 "article" 的條目，並將此區段標題設為「僅文章」。相同語法也適用於其他任何條目類型。

**\printbibliography\[keyword={physics},title={僅與物理相關}]**

篩選在任何欄位中包含「physics」一詞的參考文獻條目，並將該區段標題設為「僅與物理相關」。

[開啟一個更完整的 `biblatex` 範例](https://www.overleaf.com/project/new/template/19715?id=66713383\&templateName=A+biblatex+example\&latexEngine=\&texImage=texlive-full%3A2020.1\&mainFile=)

## 將參考文獻加入目錄

若要將參考文獻列印在目錄中，必須額外將一個選項傳入 `\printbibliography`

```latex
\printbibliography[
heading=bibintoc,
title={完整參考文獻}
]

\printbibliography[heading=subbibintoc,type=article,title={僅文章}]
```

![BiblatexEx5OLV2.png](/files/5589ffb2a87cce17b716b1dfcf26c366bf04ccaf)

一個章節和一個小節會被加入目錄中：

* 在第一種情況下，加入 `heading=bibintoc` 會將標題加入目錄；若可行則作為無編號章節，否則作為無編號小節。
* 第二種情況是 `heading=subbibintoc` 會將標題作為目錄中的第二層條目加入；在此範例中，作為嵌套於「完整參考文獻」之下的小節。

[開啟一個更完整的 `biblatex` 範例](https://www.overleaf.com/project/new/template/19715?id=66713383\&templateName=A+biblatex+example\&latexEngine=\&texImage=texlive-full%3A2020.1\&mainFile=)

## 參考指南

**支援的條目類型**

|               |                |              |
| ------------- | -------------- | ------------ |
| article       | book           | mvbook       |
| inbook        | bookinbook     | suppbook     |
| booklet       | collection     | mvcollection |
| incollection  | suppcollection | manual       |
| misc          | 線上             | patent       |
| periodical    | suppperiodical | proceedings  |
| mvproceedings | inproceedings  | 參考           |
| mvreference   | inreference    | 報告           |
| set           | thesis         | unpublished  |
| custom        | conference     | electronic   |
| masterthesis  | phdthesis      | techreport   |

**支援的條目欄位** （列印出的資訊取決於參考文獻樣式）

|               |              |               |                 |
| ------------- | ------------ | ------------- | --------------- |
| abstract      | addendum     | afterword     | annotate        |
| author        | authortype   | bookauthor    | bookpagination  |
| booksubtitle  | booktitle    | chapter       | commentator     |
| date          | doi          | edition       | editor          |
| editortype    | eid          | entrysubtype  | eprint          |
| eprinttype    | eprintclass  | eventdate     | eventtitle      |
| 檔案            | foreword     | holder        | howpublished    |
| indextitle    | institution  | 引言            | isan            |
| isbn          | ismn         | isrn          | issue           |
| issuesubtitle | issuetitle   | iswc          | journalsubtitle |
| journaltitle  | label        | 語言            | 函式庫             |
| location      | mainsubtitle | maintitle     | month           |
| note          | number       | organization  | origdate        |
| origlanguage  | origlocation | origpublisher | origtitle       |
| pages         | pagetotal    | pagination    | part            |
| publisher     | pubstate     | reprinttitle  | 系列              |
| shortauthor   | shortedition | shorthand     | shorthandintro  |
| shortjournal  | shortseries  | shorttitle    | subtitle        |
| title         | translator   | type          | url             |
| venue         | version      | volume        | year            |

**參考文獻排序選項**

| 選項      | 說明                  |
| ------- | ------------------- |
| `nty`   | 依名稱、標題、年份排序         |
| `nyt`   | 依名稱、年份、標題排序         |
| `nyvt`  | 依名稱、年份、卷號、標題排序      |
| `anyt`  | 依字母標籤、名稱、年份、標題排序    |
| `anyvt` | 依字母標籤、名稱、年份、卷號、標題排序 |
| `ydnt`  | 依年份（遞減）、名稱、標題排序     |
| `無`     | 條目會依引用順序處理          |

如需這些條目與選項的詳細資訊，請參見套件文件。

## 延伸閱讀

更多資訊請參見

* [Biblatex 參考文獻樣式](/latex/zh-tw/can-kao-wen-xian-yu-yin-wen/07-biblatex-bibliography-styles.md)
* [Biblatex 引用樣式](/latex/zh-tw/can-kao-wen-xian-yu-yin-wen/08-biblatex-citation-styles.md)
* [使用 natbib 管理書目](/latex/zh-tw/can-kao-wen-xian-yu-yin-wen/02-bibliography-management-with-natbib.md)
* [使用 bibtex 管理書目](/latex/zh-tw/can-kao-wen-xian-yu-yin-wen/01-bibliography-management-with-bibtex.md)
* [在 Overleaf 上使用 BibTeX 建立與管理參考文獻](https://www.overleaf.com/blog/532)
* [Biblatex 套件文件](http://linorg.usp.br/CTAN/macros/latex/contrib/biblatex/doc/biblatex.pdf)
* [國際語言支援](/latex/zh-tw/yu-yan/03-international-language-support.md)
* [目錄](/latex/zh-tw/wen-jian-jie-gou/02-table-of-contents.md)
* [大型專案中的管理](/latex/zh-tw/wen-jian-jie-gou/07-management-in-a-large-project.md)
* [多檔案 LaTeX 專案](/latex/zh-tw/wen-jian-jie-gou/08-multi-file-latex-projects.md)


---

# 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/zh-tw/geng-duo-zhu-ti/05-bibliography-management-in-latex.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.
