> For the complete documentation index, see [llms.txt](https://ayakaleaf-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://ayakaleaf-pro.ayaka.space/latex/zh-cn/can-kao-wen-xian-he-yin-yong/06-natbib-citation-styles.md).

# Natbib 引用样式

Natbib 使用与相应的 [参考文献样式](/latex/zh-cn/can-kao-wen-xian-he-yin-yong/04-bibtex-bibliography-styles.md#natbib-styles) 相对应的引用样式；如果没有声明特定的引用命令。还有一些额外命令用于控制某些标点参数。请参见下面的示例：

```latex
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

%Import the natbib package and sets a bibliography  and citation styles
\usepackage{natbib}
\bibliographystyle{abbrvnat}
\setcitestyle{authoryear,open={((},close={))}} %Citation-related commands

\title{Natbib Example}

\author{Overleaf team}

\begin{document}

\maketitle

\section{First Section}
本文档是一个示例，其中引用了两个条目：\textit{The \LaTeX\ Companion} 这本书 \cite[see][chap 2]{latexcompanion}，以及爱因斯坦的期刊论文 \citep{einstein}。

%Imports the bibliography file "sample.bib"
\bibliography{sample}

\end{document}
```

![CitationStylesEx1Overleaf.png](/files/c7204e65dd6eee838ceecba04b07d6a1d0e6afac)

用于格式化引用样式的具体命令是：

```latex
\setcitestyle{authoryear, open={((},close={))}
```

这些由逗号分隔的参数告诉 LaTeX 使用 *作者-年份* 引用模式，并使用双圆括号作为起始和结束标记。可以传递给该命令的各项参数如下：

* 引用模式： `作者-年份`, `numbers` 或 `上标`.
* 括号： `圆括号` 或 `方括号`。你可以使用以下方式手动设置任何其他起始和结束字符： `open={char}` 以及 `close={char}`.
* 引用分隔符： `分号`, `逗号`.
* 作者与年份之间的分隔符： `aysep{char}`.
* 同一作者不同年份之间的分隔符： `yysep={char}`.
* 后注之前的文本： `notesep={text}`.

还有其他附加引用命令，具体取决于引用模式。例如，在上面的示例中，命令 `\cite[see][chap 2]{latexcompanion}` 接受两个额外参数；第一个可选参数 *参见* 会显示在引用标记之前，而第二个可选参数 *第2章* 会显示在引用标记之后。下面是一个描述若干附加引用命令的表格：

| 命令              | 说明                               |
| --------------- | -------------------------------- |
| `\citet{}`      | 文本引用                             |
| `\citep{}`      | 括号引用                             |
| `\citet*{}`     | 与……相同 `\citet` 但如果有多个作者，则会打印所有姓名 |
| `\citep*{}`     | 与……相同 `\citep` 但如果有多个作者，则会打印所有姓名 |
| `\citeauthor{}` | 仅打印作者姓名                          |
| `\citeyear{}`   | 仅打印出版年份。                         |

有关本示例中其余命令的更多信息，请参见 [使用 natbib 管理参考文献](/latex/zh-cn/can-kao-wen-xian-he-yin-yong/02-bibliography-management-with-natbib.md)

[打开一个……的示例 `natbib` Overleaf 中的宏包](https://www.overleaf.com/project/new/template/19422?id=65532643\&templateName=Natbib+citation+styles+example\&latexEngine=\&texImage=texlive-full%3A2020.1\&mainFile=)

## 进一步阅读

* [使用 natbib 管理参考文献](/latex/zh-cn/can-kao-wen-xian-he-yin-yong/02-bibliography-management-with-natbib.md)
* [Natbib 参考文献样式](/latex/zh-cn/can-kao-wen-xian-he-yin-yong/05-natbib-bibliography-styles.md)
* [Natbib 宏包文档](http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/natbib/natbib.pdf)
* [国际语言支持](/latex/zh-cn/yu-yan/03-international-language-support.md)
* [大型项目中的管理](/latex/zh-cn/wen-dang-jie-gou/07-management-in-a-large-project.md)
* [目录](/latex/zh-cn/wen-dang-jie-gou/02-table-of-contents.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://ayakaleaf-pro.ayaka.space/latex/zh-cn/can-kao-wen-xian-he-yin-yong/06-natbib-citation-styles.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.
