> 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-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}

%导入 natbib 宏包并设置参考文献和引用样式
\usepackage{natbib}
\bibliographystyle{abbrvnat}
\setcitestyle{authoryear,open={((},close={))}} %与引用相关的命令

\title{Natbib 示例}

\author{Overleaf 团队}

\begin{document}

\maketitle

\section{第一节}
本文档是一个包含两个引用条目的示例：\textit{The \LaTeX\ Companion} 一书 \cite[see][chap 2]{latexcompanion} 以及爱因斯坦的期刊论文 \citep{einstein}。

%导入参考文献文件“sample.bib”
\bibliography{sample}

\end{document}
```

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

用于格式化引用样式的特定命令是：

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

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

* 引用模式： `作者-年份`, `行号` 或 `上标`.
* 括号： `圆括号` 或 `方括号`。你可以手动使用以下方式设置其他任意起始和结束字符： `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://overleaf-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.
