Scissor LaTeX 中的 natbib
natbib 宏包在 Scissor LaTeX 中基本可用:\citet、\citep、\citeyear 及其首字母大写形式都可用,\bibliographystyle{plainnat} 或 unsrtnat 能给出作者-年份引用;numbers、round 等宏包选项和 \setcitestyle 会被忽略,所以样式始终由 \bibliographystyle 决定。
宏包的作用
natbib 为 BibTeX 增加了作者-年份引用。它的两个主要命令是:\citet{key} 用于作为句子一部分的引用,例如“Doe and Mustermann (2024)”;\citep{key} 用于括号中的引用,例如“(Doe and Mustermann, 2024)”。宏包选项可以在圆括号和方括号之间切换,或改为数字引用,plainnat 等作者-年份样式则用来格式化参考文献列表。
用 \usepackage{natbib} 加载它,并用 \bibliographystyle{plainnat} 选择样式。
这里可用的功能
| 命令或选项 | 在 Scissor LaTeX 中 | 说明 |
|---|---|---|
\citet{key}, \Citet{key} | 可用 | “Doe and Mustermann (2024)”。 |
\citep{key}, \Citep{key} | 可用 | “(Doe and Mustermann, 2024)”。 |
\citep{a,b} | 可用 | “(Doe and Mustermann, 2024; Mustermann, 2021)”。 |
\citep[p.~44]{key} | 可用 | 附注放在括号内。 |
\citep[see][p.~44]{key} | 部分可用 | “see”输出在括号前面。 |
\citeyear{key} | 可用 | “2024”。 |
\citeyearpar{key} | 部分可用 | 输出“2024”,不带括号。 |
\citeauthor{key} | 部分可用 | 输出与 \citet 相同,带有年份。 |
\citet*, \citep* | 部分可用 | 与 \citet 和 \citep 相同;作者列表不会展开。 |
\citealt, \citealp, \citenum | 部分可用 | 像 \citep 一样输出,带括号。 |
\bibliographystyle{plainnat}, abbrvnat | 可用 | 作者-年份格式,列表按作者排序。 |
\bibliographystyle{unsrtnat} | 可用 | 作者-年份格式,列表按引用顺序排列。 |
选项 numbers、round、square、authoryear、sort&compress | 忽略 | 样式只由 \bibliographystyle 决定。 |
\setcitestyle{...} | 忽略 | 被忽略,不显示提示。 |
\bibpunct{...}... | 不支持 | 在导言区中被忽略;在正文中会被跳过并显示提示,它的参数会作为文本输出。 |
如果没有 \bibliographystyle 行,即使加载了 natbib,引用也会以方括号中的数字编号。加上 \bibliographystyle{plainnat} 才能得到作者-年份引用。
示例
配合 plainnat 使用常见的 natbib 命令:
配合 plainnat 的 \citet、\citep 和 \citeyear
\citet{doe2024} measured 44 samples. Long tables have their own
rules \citep[ch.~2]{mustermann2021}, and so do plots
\citep{mustermann2023}. The book appeared in \citeyear{mustermann2021}.
\bibliographystyle{plainnat}
\bibliography{refs}unsrtnat 按你引用的顺序而不是按作者列出文献:
unsrtnat:按引用顺序排列参考文献
Plots are discussed by \citet{mustermann2023}, and the careful
measurement behind them by \citet{doe2024}.
\bibliographystyle{unsrtnat}
\bibliography{refs}宏包选项 numbers 不起作用。引用样式只取决于 \bibliographystyle,所以使用 plainnat 时仍然得到作者-年份引用:
numbers 选项被忽略
\documentclass{article}
\usepackage[numbers]{natbib}
\begin{document}
Measured by \citet{doe2024}, see also \citep{doe2025}.
\bibliographystyle{plainnat}
\bibliography{refs}
\end{document}如需数字引用,请使用 plain、unsrt 或 ieeetr 等数字样式(在这里三者都会给出方括号中的数字)。样式列表见参考文献页面。
兼容性
- 从 TeX 发行版迁移到这里: 含有
\citet和\citep的文档可以原样排版。只有当\bibliographystyle指定了作者-年份样式时,才会得到作者-年份引用;宏包选项和\setcitestyle不会改变任何东西。 - 从这里迁移到 TeX 发行版: 文档无需修改即可在那里编译。请在那里运行 BibTeX,并注意 natbib 的选项届时会生效。
完整手册见 CTAN:ctan.org/pkg/natbib。关于引用的一般用法,请参阅参考文献和引用;另一种方案请参阅 biblatex。
常见问题
为什么我得到的是数字而不是作者-年份引用?
文档中没有 \bibliographystyle 行,或者它指定的是数字样式。请加上 \bibliographystyle{plainnat}。在这里,仅靠 natbib 的 authoryear 和 round 选项不会改变样式。
\citet 和 \citep 有什么区别?
\citet 给出“Doe and Mustermann (2024)”,用于句子之中;\citep 给出“(Doe and Mustermann, 2024)”,用于分句末尾的引用。
使用 natbib 需要运行 BibTeX 吗?
不需要。Scissor LaTeX 每次排版时都会读取项目中的 .bib 文件。
本页的每个示例都在构建网站时由 Scissor LaTeX 排版。 最后更新:2026-11-07